title: Video starts when current slide // Superslides
body: <p>So I solved the individual slide delay problem with superslides using the answers found at <a href="https://stackoverflow.com/questions/20991815/individual-slide-delay-superslides">Individual slide delay // Superslides</a>, but now I'm having trouble with a video I put in. </p>
  
  <p>The video is Slide 4, but it starts playing when the slider loads. I'm using YTPlayer for the player.</p>
  
  <pre><code>jQuery('#fullscreen , .p-section').superslides({
      play: 12000,
      animation: 'fade',
      inherit_height_from: window,
  });
  
  jQuery('#fullscreen').on('animated.slides', function () {
  var slideNo = jQuery(this).superslides('current');
  if(slideNo === 3){ //slide 4
      jQuery(this).superslides('stop');
      setTimeout(function(){
          jQuery('#fullscreen').superslides('start')
      }, 20000);
  } });
  </code></pre>
  
  <p>That is what I have for the slider. How can I get the video to start playing only when the video is the current slide and then transitions to the next slide after it plays. </p>
  
  <p>UPDATE: IN CASE SOMEONE WAS LOOKING FOR THIS AS WELL.
  With the help of @Sunand, here's what I have.</p>
  
  <pre><code>jQuery('#fullscreen , .p-section').superslides({
      play: 12000,
      animation: 'fade',
      inherit_height_from: window,
  });
  
  jQuery('#fullscreen').on('animated.slides', function () {
  var slideNo = jQuery(this).superslides('current');
  if(slideNo === 3){ //slide 4
  jQuery(this).superslides('stop');
  jQuery(".mb_YTVPBar .buttonBar").css({"display":"block"}); 
  jQuery(".home-elements").css({"display":"none"}); 
  jQuery("#bgndVideo").playYTP();
  
  jQuery("#bgndVideo").on("YTPEnd",function(){
      jQuery('#fullscreen').superslides('start');
       jQuery(".mb_YTVPBar .buttonBar").css({"display":"none"});
       jQuery(".home-elements").css({"display":"block"});  
  });
  }
  });
  </code></pre>
  
  <p>Now I'm still working on if they click next before the video is done, then the video should stop. Will update this when I figure it out.</p>