Removing "related videos" at end of video play

2bsuzanne's Avatar

2bsuzanne

21 Nov, 2012 04:40 PM

I added the tag ?rel=0 at the end of my youtube tag to remove "relative Videos boxes" from popping up after video plays in full and the relative videos still show up. Is there a fix for this?

  1. Support Staff 1 Posted by Dmitry Semenov on 21 Nov, 2012 07:13 PM

    Dmitry Semenov's Avatar

    Hi,

    Where do you add it? please check this - http://help.dimsemenov.com/discussions/problems/850-add-youtube-vid...

    Dmitry

  2. 2 Posted by a.corrie on 27 Aug, 2013 04:04 PM

    a.corrie's Avatar

    Hi,

    Youtube have now stopped this from working, is there still a way to get around it?

    I normally use sublime video to embed my videos and it seems to have a built in feature that removes the related videos automatically.

    Cheers
    Adam

  3. Support Staff 3 Posted by Dmitry Semenov on 27 Aug, 2013 08:00 PM

    Dmitry Semenov's Avatar

    Are you sure that you haven't changed anything else except short rel=1 change?

  4. 4 Posted by a.corrie on 06 Sep, 2013 12:48 PM

    a.corrie's Avatar

    Hi Dmitry, yes i'm certain. The "rel" edit only works with embed code now, NOT standard links.

    Do you have a workaround where so i can use the embed code instead?

  5. Support Staff 5 Posted by Dmitry Semenov on 06 Sep, 2013 04:22 PM

    Dmitry Semenov's Avatar

    Please link to page with issue.

  6. 6 Posted by a.corrie on 06 Sep, 2013 04:35 PM

    a.corrie's Avatar

    Hi,

    Thanks for the quick reply.

    http://www.wearesynergy3.co.uk/#page-4

    please click the music page and it is the youtube video on that page.

    you may have to resize the page for the video to show up as i havn't got round to fixing that yet. (thanks for you reply on that too!)

    Cheers
    Adam

  7. Support Staff 7 Posted by Dmitry Semenov on 06 Sep, 2013 04:39 PM

    Dmitry Semenov's Avatar

    The rel attribute can be added only through youTube embed code option, you can not pass it through URL of video.

    Dmitry

  8. 8 Posted by a.corrie on 06 Sep, 2013 04:54 PM

    a.corrie's Avatar

    That's what I thought but how do add the video with the embed code?

    The only option on the royal slider is for url or link and i have put the embed code in both to no avail.

    (Sorry i'm no expert as you can tell)

  9. Support Staff 9 Posted by Dmitry Semenov on 08 Sep, 2013 07:58 AM

    Dmitry Semenov's Avatar

    Slider simply parses a video ID from URL that you provided. And then replaces string %id% in youTubeCode option http://dimsemenov.com/plugins/royal-slider/documentation/#video

    If you wish to change this behavior, you'll need to modify the code or override the playVideo callback http://help.dimsemenov.com/kb/royalslider-javascript-api/adding-sup...

    Dmitry

  10. 10 Posted by mike on 04 Nov, 2013 08:08 PM

    mike's Avatar

    Hi,

    I have added every possible option to try and remove these related videos. Nothing is working. The slider is on the homepage.
    http://vbjfr.sthpp.servertrust.com/

    Can you help me to understand what i need to do?

  11. Support Staff 11 Posted by Dmitry Semenov on 04 Nov, 2013 10:01 PM

    Dmitry Semenov's Avatar

    Hello,

    Add to your slider init code:

    
    video: {
                youTubeCode: '<iframe src="http://www.youtube.com/embed/%id%?autoplay=1&showinfo=0&rel=0" frameborder="no"></iframe>'
    }
    
  12. 12 Posted by mike on 04 Nov, 2013 10:37 PM

    mike's Avatar

    Hi,

    Thank you for your response. I added the following to the slider init, and the slider stopped functioning:

            // slider initialization
            $('#content-slider').royalSlider({
                // example of slider options
                controlNavigation: 'bullets',
               transitionSpeed: 1000,
               
               numImagesToPreload: 0,
                autoPlay: {
                    enabled: true,
                    delay: 4500,
                },
                deeplinking: {
                    enabled: true,
                    prefix: 'slider-'
                }
               video: {
                youTubeCode: '<iframe src="http://www.youtube.com/embed/%id%?rel=1&autoplay=1&showinfo=0&rel=0" frameborder="no"></iframe>'
               }

            });

        });
        </script>

    ANy ideas?

  13. Support Staff 13 Posted by Dmitry Semenov on 05 Nov, 2013 04:14 PM

    Dmitry Semenov's Avatar

    You're missing comma after

    deeplinking: { 
                    enabled: true, 
                    prefix: 'slider-' 
                }
    
  14. 14 Posted by mike on 05 Nov, 2013 04:55 PM

    mike's Avatar

    Hi Dmitry,

    Thank you.

    I still cannot get the slider to exclude the recommended videos from the end of the sequence. I have 3 videos on the slider on the homepage at http://vbjfr.sthpp.servertrust.com/

    I have embedded the final video to test. code:

        <div id="content-slider" class="royalSlider contentSlider rsDefault">
          <div> <img class="rsImg" src="/v/vspfiles/templates/stylepop/images/homepage/JustAddAKid-DWTS.jpg" data-rsVideo="http://youtu.be/O4z2W_jpfnc&rel=0"></div>
          <div> <img class="rsImg" src="/v/vspfiles/templates/stylepop/images/homepage/JustAddAKidPirates.jpg" data-rsVideo="http://youtu.be/6SCDk7RsBYc&rel=0"/></div>
          <div> <img class="rsImg" src="/v/vspfiles/templates/stylepop/images/homepage/JustaddakidMermaid.jpg" data-rsVideo='<iframe src="http://www.youtube.com/embed/umgsF9f2e_U?rel=0&autoplay=1&showinfo=0" frameborder="no"></iframe>'/></div>

    i also tried with &rel=0

    Thank you for your help
    Mike

  15. Support Staff 15 Posted by Dmitry Semenov on 06 Nov, 2013 02:09 PM

    Dmitry Semenov's Avatar

    Hello,

    The data-rsVideo attribute should contain the URL, please refer to docs http://dimsemenov.com/plugins/royal-slider/documentation/#video

    Dmitry

  16. 16 Posted by mike on 06 Nov, 2013 06:06 PM

    mike's Avatar

    Hi,

    If you look at the code below, the data rsVideo DOES contain the URL. I do not understand your comment and I have been through the documentation many times and tried every possible scenario. Still no luck

    Please advise,

    Thank you,
    Mike

  17. Support Staff 17 Posted by Dmitry Semenov on 06 Nov, 2013 07:38 PM

    Dmitry Semenov's Avatar

    You have:

          <div> <img class="rsImg" src="/v/vspfiles/templates/stylepop/images/homepage/JustaddakidMermaid.jpg" data-rsVideo='<iframe src="http://www.youtube.com/embed/umgsF9f2e_U?rel=0&amp;autoplay=1&amp;showinfo=0&quot; frameborder="no"></iframe>'/></div>
    

    Sould be:

    <div>
        <img class="rsImg" src="image.jpg" data-rsVideo="http://www.youtube.com/watch?v=966IBspryFI" />
    </div>
    
  18. 18 Posted by mike on 06 Nov, 2013 07:41 PM

    mike's Avatar

    I cannot see your reply? :(

  19. Support Staff 19 Posted by Dmitry Semenov on 07 Nov, 2013 04:41 PM

    Dmitry Semenov's Avatar

    Sorry, typo, updated it.

  20. 20 Posted by mike on 07 Nov, 2013 06:28 PM

    mike's Avatar

    Hi,

    I have tried this method. It still displays related videos.

    url: http://swfxe.xhjph.servertrust.com/default.asp

    my code is:

          <div> <img class="rsImg" src="/v/vspfiles/templates/stylepop/images/homepage/JustAddAKid-DWTS.jpg" data-rsVideo="http://www.youtube.com/watch?v=O4z2W_jpfnc?rel=0"></div>
          <div> <img class="rsImg" src="/v/vspfiles/templates/stylepop/images/homepage/JustAddAKidPirates.jpg" data-rsVideo="http://www.youtube.com/watch?v=6SCDk7RsBYc"/></div>
          <div> <img class="rsImg" src="/v/vspfiles/templates/stylepop/images/homepage/JustaddakidMermaid.jpg" data-rsVideo="http://www.youtube.com/watch?v=umgsF9f2e_U?rel=0"/></div>

    Any ideas?

  21. Support Staff 21 Posted by Dmitry Semenov on 07 Nov, 2013 09:41 PM

    Dmitry Semenov's Avatar
  22. 22 Posted by FZ on 03 May, 2016 09:03 AM

    FZ's Avatar

    I have YT videos on my slider using the data-rsvideo

    I wanted to remove the related videos too, so have now added the following as recommended to my init slider script:

    video: {
                youTubeCode: '<iframe src="http://www.youtube.com/embed/%id%?autoplay=1&showinfo=0&rel=0" frameborder="no"></iframe>'
    }

    This works and the video now ends as I wish, without showing randomly selected related videos.

    However, I will be using multiple YT videos on my slider, so how do I go about adding this to apply to all my videos please?
    What is the best method to do that?
    Thanks

  23. Support Staff 23 Posted by Dmitry Semenov on 03 May, 2016 05:37 PM

    Dmitry Semenov's Avatar

    @FZ, the code in option is applied for all slides with video.

  24. 24 Posted by aim.aimon on 02 Apr, 2018 04:48 PM

    aim.aimon's Avatar

    Hi. I have a few YouTube videos in the same slider. However, how to put different id for each video?

    video: {
                youTubeCode: '<iframe src="http://www.youtube.com/embed/%id%?autoplay=1&showinfo=0&rel=0" frameborder="no"></iframe>'
    }

    I put this code and replaced %id% with the first video's ID but then other YouTube video in the same slider show the same first one as well, not their own video. How can I specific for each one?

    Thank you.

  25. Support Staff 25 Posted by Dmitry Semenov on 02 Apr, 2018 07:31 PM

    Dmitry Semenov's Avatar

    @aim.aimon, video ID is automatically parsed from data-rsVideo attribute in HTML markup of your slider http://dimsemenov.com/plugins/royal-slider/documentation/#video

  26. 26 Posted by aim.aimon on 03 Apr, 2018 03:19 AM

    aim.aimon's Avatar

    Hi Dmitry, sorry it doesn't work for me.
    I made 2 test files
    1)
    https://communique.club21.co.th/2018apr/test.php
    The first 2 of the slider are videos.
    This one I keep %id%
    video: {
                youTubeCode: '<iframe src="http://www.youtube.com/embed/%id%?autoplay=1&showinfo=0&rel=0" frameborder="no"></iframe>'
    }
    When I clicked to play, they kept loading.

    2)
    https://communique.club21.co.th/2018apr/test2.php
    This one I replaced %id% to the first video URL.
    video: {
                youTubeCode: '<iframe src="https://www.youtube.com/embed/xg2H40H7Rh0?autoplay=1&showinfo=0&rel=0" frameborder="no"></iframe>'
    }
    They both play the video but both from the first one. The More videos function is gone though.

    Is there a way to specific URL differently for each video in the same slider?

  27. Support Staff 27 Posted by Dmitry Semenov on 03 Apr, 2018 04:49 AM

    Dmitry Semenov's Avatar

    @aim.aimon, you need to have https:// and not http:// in youTubeCode option. And as I posted earlier, you don't need to remove %id% from it, it's automatically parsed from HTML markup.

  28. 28 Posted by aim.aimon on 03 Apr, 2018 05:22 AM

    aim.aimon's Avatar

    Thank you very much!! Yes the 's' added then works well.

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac