Multiple youtube videos without showing rel

nigel's Avatar

nigel

08 May, 2018 07:04 AM

Hi,

Is there a way to use the rsVideo= method and the &rel=1 parameter to not show related videos?

We have a slider that will house 4x youtube videos and are hoping not to see related videos.

Thank you,

  1. Support Staff 1 Posted by Dmitry Semenov on 08 May, 2018 09:28 AM

    Dmitry Semenov's Avatar

    Hello,

    Sure, add video.youTubeCode option to slider initialization code:

    video: {
      youTubeCode: '<iframe src="https://www.youtube.com/embed/%id%?rel=0&autoplay=1&showinfo=0" frameborder="no"></iframe>'    
    }
    
  2. 2 Posted by nigel on 08 May, 2018 09:43 AM

    nigel's Avatar

    Hi,

    Thank you for the reply. What I meant was there are 4x videos. Can I add multiple keys? ie

    video: {
      youTubeCode: '<iframe src="https://www.youtube.com/embed/%id1%?rel=0&autoplay=1&showinfo=0" frameborder="no"></iframe>'
    }, video: { youTubeCode: '<iframe src="https://www.youtube.com/embed/%id2%?rel=0&autoplay=1&showinfo=0" frameborder="no"></iframe>'
    } video: { youTubeCode: '<iframe src="https://www.youtube.com/embed/%id3%?rel=0&autoplay=1&showinfo=0" frameborder="no"></iframe>'
    }, video: { youTubeCode: '<iframe src="https://www.youtube.com/embed/%id4%?rel=0&autoplay=1&showinfo=0" frameborder="no"></iframe>'
    }
  3. Support Staff 3 Posted by Dmitry Semenov on 08 May, 2018 11:59 AM

    Dmitry Semenov's Avatar

    The code applies globally to all videos in the slider, so you need just 1 option.

  4. 4 Posted by nigel on 08 May, 2018 12:03 PM

    nigel's Avatar

    How do you define which slide has video x then?

    Currently on the first slider there is a video, next week there will be another 1 behind slide 2. I am not sure how to define a different video for each slide?

    Thank you for the help

  5. Support Staff 5 Posted by Dmitry Semenov on 08 May, 2018 05:57 PM

    Dmitry Semenov's Avatar

    URLs to video are defined in data-rsVideo attribute, they don't need to have any rel attributes.

    <div class="royalSlider rsDefault">
    
        <a class="rsImg" href="image.jpg" data-rsVideo="https://www.youtube.com/watch?v=ZrP0Mqj9U_c">Video 1</a>
    
         <a class="rsImg" href="image.jpg" data-rsVideo="https://www.youtube.com/watch?v=zOgle88sKro">Video 2</a>
    
    </div>
    
    jQuery(document).ready(function($) {
        $(".royalSlider").royalSlider({
            autoScaleSlider: true,
            // ...
            video: {
                youTubeCode: '<iframe src="https://www.youtube.com/embed/%id%?rel=0&autoplay=1&showinfo=0" frameborder="no"></iframe>'
            }
        });  
    });
    
  6. 6 Posted by nigel on 09 May, 2018 12:00 AM

    nigel's Avatar

    Ahhh! I understand now.

    I mistakingly thought %id% was a placeholder inside the js.
     
    Having an example with rsVideo and youtube links and then the js code helped.

    Thank you for the support!

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