Tagged: light box
-
AuthorPosts
-
September 23, 2016 at 9:00 am #690559
Hi,
my problem is the same as many others have had with Enfold for years (which I found out after some research in the forum):
I want to open a Youtube video in a light box (which is easy with Enfold) and not see the “related videos” at the end.1 – What is the cool solution for this?
2 – it seems that Enfold doenst offer this easy solution? Why? since it is a common problem.Regards,
KlausSeptember 23, 2016 at 9:51 am #690566goto the youtube video and look to the share button – one button right there is the embed button open it
now there is ( a bit hidden) another button with “more” – press it now you got the following image:there is a list what you can choose on options ( one is not listet – the autoplay function! code: ;autoplay=1 )
copy the iframe embed code – without the width / height instructionsthis iframe embed code you can place in a code alb element !
The only thing now is to set up the height/ width of the video
soon more to come here :lol:edit: autoplay does not work in lightbox mode
- This reply was modified 8 years, 3 months ago by Guenni007.
September 23, 2016 at 10:09 am #690572Hi thanks,
I am aware of this function. But for lightboxes Enfold works differently (just by copying the video URL, or an image URL for the same matter). And here these Youtube specific codes dont work. Check this forum for posts, you’ll find lots of the same question.Regards, Klaus
September 23, 2016 at 10:12 am #690575the lightbox solution
you have an image placed and for the link option choose manually insert:
this was the copied code from youtube site:<iframe width="1280" height="720" src="https://www.youtube-nocookie.com/embed/G0k3kHtyoqc?rel=0&showinfo=0" frameborder="0" allowfullscreen></iframe>
you have to put in that manually link now:
https://www.youtube-nocookie.com/embed/G0k3kHtyoqc?rel=0&showinfo=0" frameborder="0" allowfullscreen ?iframe=true
i added for the lightbox option ?iframe=true
Result see here:
http://webers-testseite.de/ikom/full-slider-with-content/- This reply was modified 8 years, 3 months ago by Guenni007.
September 23, 2016 at 10:18 am #690578Check this forum for posts, you’ll find lots of the same question.
Never trust a person who says trust me :lol:
btw: if you like to have a bigger iframe size like in my example above:
.mfp-iframe-scaler { height: 45vw; left: 50%; position: relative; transform: translate(-50%) !important; width: 80vw; }
the height comes from the 16:9 ratio 80% of viewport widht results than in a height of 45%
if you want to optimise it for that iframe you have to set up here a custom class- This reply was modified 8 years, 3 months ago by Guenni007.
September 23, 2016 at 11:40 am #690621by the way – you have to be vimeo member to get rid of other links at the end – thats bad – because by this youtube is better video hoster than
thats it: http://webers-testseite.de/ikom/full-slider-with-content/September 26, 2016 at 2:08 pm #691667it seem to be not so important to you – or was it a rhetorical question and you didn’t expect an answer which solves your problem?
September 26, 2016 at 2:10 pm #691672Hi!
Please try using this plugin – https://wordpress.org/plugins/hide-youtube-related-videos/
@guenni007 thanks for your help :)Best regards,
YigitSeptember 26, 2016 at 3:03 pm #691722yes Yigit works nearly as wanted – there are just before the end of the trailers/videos sometimes recommendations from other members.
with my manual method not!September 26, 2016 at 3:09 pm #691725September 26, 2016 at 4:01 pm #691747yes i tested it – and it works well to get rid of those end film recommendations – but this seems to be a new “feature” just before the film stops there is from one other youtube-user a filmtip. I did not see this before – but now!
October 7, 2016 at 6:44 pm #696668Guenni007, thank you. Have you gotten this solution to autoplay?
October 31, 2016 at 2:55 pm #706186Hi, thank you for your help. It looks to me, that Youtube has changed things now and the insertation of the video link is enough, at least when I just tried it now.
October 31, 2016 at 3:09 pm #706200December 14, 2016 at 8:56 pm #724540what can i do if the plugin is not working?
December 15, 2016 at 1:55 pm #724851Hi,
@spike76 Please refer to this post – https://kriesi.at/support/topic/disable-youtube-related-videos/Best regards,
YigitMarch 2, 2017 at 3:46 pm #754383I thought I would share my solution.
It works only for YOUTBE videos and is a GLOBAL FIX for all current Enfold methods of YouTube video playback.
Add the following code to your child-theme functions.php file:
function change_magnific_popup_iframe_setting(){ ?> <script> jQuery(window).load(function(){ jQuery('a[href*="youtube.com/watch"]').magnificPopup({ type: 'iframe', iframe: { patterns: { youtube: { index: 'youtube.com', id: 'v=', /* src: '//www.youtube.com/embed/%id%?rel=0&autoplay=1'*/ src: '//www.youtube.com/embed/%id%?autoplay=1&rel=0&autohide=1&showinfo=0&fs=1&feature=oembed&wmode=opaque' } } } }); }); </script> <?php } add_action("wp_footer", "change_magnific_popup_iframe_setting"); /**/ function remove_related_videos( $html, $url, $args ) { if ( strpos( $html, 'youtube.com/embed/' ) !== false ) { return str_replace( 'feature=oembed','feature=oembed&rel=0', $html ); } else { return $html; } } add_filter( 'embed_oembed_html', 'remove_related_videos', 10, 3 );
Cheers : )
March 2, 2017 at 8:50 pm #754560 -
AuthorPosts
- The topic ‘Remove "related videos" when displaying Youtube videos in lightbox’ is closed to new replies.