Community Forums › Forums › Archived Forums › General Discussion › How to Embed video in widget
Tagged: code to embed video in widget, Embedding video in widget, How to Embed video in widget, self-hosted video
- This topic has 8 replies, 5 voices, and was last updated 10 years, 7 months ago by Summer.
-
AuthorPosts
-
August 3, 2013 at 6:21 pm #54011GordyMember
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.
http://www.afroscandic.comAugust 3, 2013 at 8:30 pm #54021AnitaKeymasterThe shortcodes don't seem to work in Text Widgets so you need to place the regular embed code from Youtube.
Love coffee, chocolate and my Bella!
August 3, 2013 at 9:14 pm #54027Brad DaltonParticipantYes, the embed code is the easiest way.
Or add support for shortcodes in widgets to your child themes functions.php file:
add_filter('widget_text', 'do_shortcode');
August 4, 2013 at 2:18 pm #54158GordyMemberI 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?
August 4, 2013 at 6:14 pm #54172SummerMemberUsing 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.
WordPress / Genesis Site Design & Troubleshooting: A Touch of Summer | @SummerWebDesign
Slice of SciFi | Writers, After DarkAugust 5, 2013 at 3:23 am #54201GordyMemberHi 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?
August 5, 2013 at 11:34 am #54259SummerMemberYou 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.
WordPress / Genesis Site Design & Troubleshooting: A Touch of Summer | @SummerWebDesign
Slice of SciFi | Writers, After DarkAugust 5, 2013 at 10:11 pm #54331hawaiiguyMemberHi, 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
August 6, 2013 at 10:35 am #54390SummerMemberWhich 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.
WordPress / Genesis Site Design & Troubleshooting: A Touch of Summer | @SummerWebDesign
Slice of SciFi | Writers, After Dark -
AuthorPosts
- The forum ‘General Discussion’ is closed to new topics and replies.