Tagged: 

Viewing 18 posts - 1 through 18 (of 18 total)
  • Author
    Posts
  • #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,
    Klaus

    #690566

    goto 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 instructions

    this 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, 2 months ago by Guenni007.
    #690572

    Hi 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

    #690575

    the 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, 2 months ago by Guenni007.
    #690578

    Check 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, 2 months ago by Guenni007.
    #690621

    by 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/

    #691667

    it 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?

    #691672

    Hi!

    Please try using this plugin – https://wordpress.org/plugins/hide-youtube-related-videos/

    @guenni007
    thanks for your help :)

    Best regards,
    Yigit

    #691722

    yes 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!

    #691725

    Hey!


    @guenni007
    Thanks again! I thought this was an easier solution :)

    Best regards,
    Yigit

    #691747

    yes 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!

    #696668

    Guenni007, thank you. Have you gotten this solution to autoplay?

    #706186

    Hi, 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.

    #706200

    Hey!


    @klausr
    Thank you for your input!

    Best regards,
    Yigit

    #724540

    what can i do if the plugin is not working?

    #724851

    Hi,


    @spike76
    Please refer to this post – https://kriesi.at/support/topic/disable-youtube-related-videos/

    Best regards,
    Yigit

    #754383

    I 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 : )

    #754560

    Hi,


    @HuxburyQuinn
    Thank you very much for sharing your solution :)

    Best regards,
    Yigit

Viewing 18 posts - 1 through 18 (of 18 total)
  • The topic ‘Remove "related videos" when displaying Youtube videos in lightbox’ is closed to new replies.