Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Author AlanP57

    (@alanp57)

    That is right. This parameter was added to use in a developer hook function maxgalleria_video_embed_code. Thus a hook function can be added to your functions.php that can specify how to modify the video URL to display or not display related videos once the video finishes playing. ‘&rel=0‘ prevents the display of related videos.

    If this solves your issue thanks in advance for marking this thread as ‘Resolved’ so we know your question has been answered and for giving us and our plugin a rating at Maxgalleria Reviews

    Alan

    Thread Starter phoenixobia

    (@phoenixobia)

    Thanks but Could you please write the exact code I need to add to my functions.php ?

    I mean how can I use maxgalleria_video_embed_code?

    Thank you

    Plugin Author AlanP57

    (@alanp57)

    All right. I had to dig deeper into the code understand how this works. It turns out that a hook function is not needed because 1. by default Youtube shows related videos once the video finishes playing and all this checkbox did was to add the &rel=0 when the box was unchecked and 2. the since we starting using the magnetic popup in Maxgalleria this feature is no longer is used. Thus, it always shows related videos.

    Alan

    Thread Starter phoenixobia

    (@phoenixobia)

    Yes, that’s what I found out too but is there anyway we can stop the lightbox from showing the related videos?

    There must be a file somewhere in the plugin that gets the youtube url or id. I wasn’t able to locate that file but If we add &rel=0 somehow to the youtube url it might do the trick.

    Could you let me know please.

    Thanks

    Plugin Author AlanP57

    (@alanp57)

    Ok. I have not had much success with passing parameters to the youtube video URLs which is what the magnific popup uses rather than embedded URLs. I’ll investigate it tomorrow and let you know.

    Alan

    Thread Starter phoenixobia

    (@phoenixobia)

    Thanks, I appreciate it.

    Plugin Author AlanP57

    (@alanp57)

    Here is a way to not show related videos and have it auto play:

    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'
    	       }
    	     }
    	   }
    	});
    });
    </script>
    <?php
    }
    add_action("wp_footer", "change_magnific_popup_iframe_setting");

    source: https://www.kriesi.at/support/topic/youtube-video-not-working-in-ligthbox/#post-288867

    You can remove ‘&autoplay=1’ if you do not want it to automatically play the video.

    If this solves your issue thanks in advance for marking this thread as ‘Resolved’ so we know your question has been answered and for giving us and our plugin a rating at Maxgalleria Reviews

    Alan

    Thread Starter phoenixobia

    (@phoenixobia)

    Worked like a charm! Thanks a lot.
    I assume this feature will be implemented in future updates somehow so that the “Enable/Disable related videos” checkbox could actually work.

    Thanks

    Plugin Author AlanP57

    (@alanp57)

    For now I have removed the check box in the next release of Maxgalleria and as far as including this as part of the plugin, we will have to give that some thought. Maybe there is a better way to do this.

    Alan

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Enable related videos doesn't work’ is closed to new replies.