How to Embed video in widget

Community Forums Forums General Discussion How to Embed video in widget

This topic is: not resolved

This topic contains 8 replies, has 5 voices, and was last updated by  Summer 1 year, 2 months ago.

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #54011

    Gordy
    Participant
    Post count: 92

    Hi guys,

    I have tried to embed video in the widget area but, it is not showing.

    I have activated jetpack and I placed this code into the footer : [youtube=http://www.youtube.com/watch?v=JaNH56Vpg-A&w=320&h=240]

    but the video did not show up in the widget whereas it showed in the post and page of the site.

    Could somebody help me with the specific code to embed video in the widget area?

    Thanks.

    • This topic was modified 1 year, 2 months ago by  Gordy.
    • This topic was modified 1 year, 2 months ago by  Gordy.
    http://www.afroscandic.com
    #54021

    AC
    Blocked
    Post count: 7712

    The shortcodes don’t seem to work in Text Widgets so you need to place the regular embed code from Youtube.

    #54027

    braddalton
    Participant
    Post count: 10342

    Yes, the embed code is the easiest way.

    Or add support for shortcodes in widgets to your child themes functions.php file:
    [php]
    add_filter(‘widget_text’, ‘do_shortcode’);
    [/php]


    #54158

    Gordy
    Participant
    Post count: 92

    I don’t understand what you meant by “the regular embed code”

    I copied the url of the youtube video below as the video was playing into the text widget of my site, but it showed same raw code on my site.

    The code is : http://www.youtube.com/watch?v=i-Vie27Ly8o

    Please what else do I need to add to the code that I copied when the video was playing on youtube to the text widget on my site, to get the video displayed?

    #54172

    Summer
    Participant
    Post count: 1111

    Using only the URL of the video only works in posts and pages (and comments if you make an adjustment).

    If you want to place a video in a text widget, your easiest way is to click on the “Share” button for the video, select “Embed” option, and paste that code in the widget. It’ll look something like this:

    <iframe width="420" height="315" src="//www.youtube.com/embed/[video code here]" frameborder="0" allowfullscreen></iframe>

    Not sure when they started excluding the “http:” from their URLs, but they’re YouTube, so they can do almost whatever they want.


    #54201

    Gordy
    Participant
    Post count: 92

    Hi Summer,

    Thank you so much. I never thought about that.

    But, is there a way to stop related video from showing up using the example you gave?

    #54259

    Summer
    Participant
    Post count: 1111

    You can see a list of options here: https://developers.google.com/youtube/player_parameters

    but the ones I use most are showinfo=0 (showing video title/info) and rel=0 (showing related videos after)

    For your video, the code would look like this:

    <iframe width="420" height="315" src="//www.youtube.com/embed/i-Vie27Ly8o?rel=0" frameborder="0" allowfullscreen></iframe>

    or this:

    <iframe width="420" height="315" src="//www.youtube.com/embed/i-Vie27Ly8o?rel=0&showinfo=0" frameborder="0" allowfullscreen></iframe>

    You can also adjust the video dimensions when choosing the embed code, to one of YouTube’s defaults, or a custom size to fit your sidebar.


    #54331

    hawaiiguy
    Participant
    Post count: 11

    Hi, can you please give the coding for a self-hosted video clip? I have my clip hosted on my commercial ISP, and the file is correctly uploaded here:

    [video src="http://chl-pacific.org/wp-content/uploads/2013/08/5210_720_web_rescale.mp4" /]

    What I want to do is embed it in a Text widget in a primary sidebar in a smaller size. I’ve downloaded a lot of plug-ins, but none seem to do it. I would like to have the screen image, media controls, and the ability to click on something to make it expand in size … if that is possible.

    thanks, jim

    #54390

    Summer
    Participant
    Post count: 1111

    Which plugins have you tried? I’d guess that if you used one that had shortcodes, and added Brad’s code above for adding shortcode functionality to widget areas, that should do the trick.


Viewing 9 posts - 1 through 9 (of 9 total)

You must be logged in to reply to this topic.