Embed responsive youtube video
Home › Forums › Free Theme Support › Asteria Lite › Embed responsive youtube video
-
#91858
Juan Cholbi
On February 7, 2014 at 4:56 amHello, I embed the youtube videos in my blog with this code [youtube=http://www.youtube.com/watch?v=xxxxxxx]
but it is not responsive when I check it in ipads and iphones.
How can I make it responsive?#91976On February 7, 2014 at 8:59 amthe responsive youtube video shortcode is only available in the PRO version.
#97849
Jenny Lambert
On February 24, 2014 at 9:09 pmBonjour,
Hi,The embed responsive youtube video not working. on the wordpress Asteria pro theme y buy. Find nothing on the forum to help me ? Look easy at the bigining but nothing appear on Frontpage ant post when i use the asterai video thumbnails.
My site here :http://www.jinnystudio.com/
My video here: http://www.youtube.com/watch?v=fuPRHV2VVpU&list=UUL6A2zEg4px3hKzirBry3tQ&feature=c4-overviewSince i read and understand better English the write it can you help !!!!! 🙂
Merci,#97851On February 24, 2014 at 9:12 pmtry adding this to your post:
[youtube width="100%" height="100%" autoplay="false"] https://www.youtube.com/watch?v=fuPRHV2VVpU[/youtube]
#98571
Jenny Lambert
On February 26, 2014 at 7:00 pmHello Bonjour again,
Half way working! 🙂
Now I see my video on the post but not on front page thumbnails. By the way I see something…Wierd ?
I try differnet thing like no youtube url in the asteria video thumbnails and nothig apear either.
Thank for the support and hope you find a way to correct the problem.
site:http://www.jinnystudio.com/
post video for the front page: http://www.jinnystudio.com/2014/02/26/test-video-1/Have a nice day
Bonne journée,#98768On February 27, 2014 at 8:22 amJenny make sure you video url starts with
https://
instead ofhttp://
and remove everythng after&
#99316
Jenny happy
On February 28, 2014 at 8:58 pmCa marche !!!!
Well don !
Merci et une bonne journée
#382121On November 11, 2014 at 4:10 pmSo this shortcode can’t be used with shortened YouTube links (i.e. https://youtu.be/…) OR to embed playlists? That is a MAJOR shortcoming. How can I adapt this shortcode to embed playlists? (i.e. https://www.youtube.com/watch?v=ltR4snOdSwI&list=PL1EEA8D333FA0371B )
#383957On November 12, 2014 at 10:03 pmSorry matthew, the shortlinks are not supported yet. You can use the playlist link instead of the youtube link like this:
[youtube width="100%" height="100%" autoplay="false"] https://www.youtube.com/watch?v=ltR4snOdSwI&list=PL1EEA8D333FA0371B[/youtube]
Thanks
#384324On November 13, 2014 at 3:17 am…except that doesn’t work.
All I get is an error from YouTube:
http://matthewebel.com/wp-content/uploads/2014/11/Screen-Shot-2014-11-12-at-10.15.44-PM.png
#384327On November 13, 2014 at 3:22 amThe iFrame that gets implemented is this:
<iframe class="vid_iframe" style=" width: 100%; height: 100%;" src="//www.youtube.com/embed/ltR4snOdSwI&list=PL1EEA8D333FA0371B?autoplay=0" allowfullscreen=""></iframe>
At http://matthewebel.com/geek it’s implemented as this:
<iframe width="600" height="394" src="//www.youtube.com/embed/ltR4snOdSwI?list=PL1EEA8D333FA0371B" frameborder="0" allowfullscreen=""></iframe>
Notice the & and ? placements, I’m pretty sure that’s what’s breaking it.
#389079On November 17, 2014 at 4:54 pmNo. its not that. the playlist requires different code. Open up shortcodes.php and replace this:
function thn_youtube_func($atts, $content) { //extract short code attr extract(shortcode_atts(array( 'width' => '100%', 'height' => '100%', 'autoplay' => 'true', ), $atts)); $content = strip_tags($content); $content =str_replace('http://www.youtube.com/watch?v=', '//www.youtube.com/embed/', $content); $content =str_replace('https://www.youtube.com/watch?v=', '//www.youtube.com/embed/', $content); if ($autoplay == 'true'){ $autoplay= 1; }elseif ($autoplay == 'false'){ $autoplay= 0; } $return_html = '<div style="clear:both;"></div><div class="ast_vid"><div class="responsive-container"><iframe class="vid_iframe" style=" width: '.$width.'; height: '.$height.';" src="'.$content.'?autoplay='.$autoplay.'" allowfullscreen></iframe></div></div>'; return $return_html; } add_shortcode('youtube', 'thn_youtube_func');
with this:
function thn_youtube_func($atts, $content) { //extract short code attr extract(shortcode_atts(array( 'width' => '100%', 'height' => '100%', 'autoplay' => 'true', ), $atts)); $content = strip_tags($content); if (($pos = strpos($content, "list=")) !== FALSE) { $listid = substr($content, $pos+5); $content ='//www.youtube.com/embed/videoseries?list='. $listid; }else{ $content =str_replace('http://www.youtube.com/watch?v=', '//www.youtube.com/embed/', $content); $content =str_replace('https://www.youtube.com/watch?v=', '//www.youtube.com/embed/', $content); } if ($autoplay == 'true'){ $autoplay= '?autoplay=1'; }elseif ($autoplay == 'false'){ $autoplay= ''; } $return_html = '<div style="clear:both;"></div><div class="ast_vid"><div class="responsive-container"><iframe class="vid_iframe" style=" width: '.$width.'; height: '.$height.';" src="'.$content.''.$autoplay.'" allowfullscreen></iframe></div></div>'; return $return_html; } add_shortcode('youtube', 'thn_youtube_func');
let me know.
Thanks
#623284
rampatter
On September 13, 2016 at 5:49 amCheck this one…..make your youtube video responsive
Patter