2

I tried searching for the solution and yet no luck.

Problem is, I need to pause the youtube video when the video leaves viewport while scrolling.

I found this sample but this has video id and in my scenario, I have iframe so this solution isn't working on iframe.

Here is my Fiddle

user6725932
  • 333
  • 1
  • 3
  • 16
  • In JQuery, It'll be something like: `if(window.scrollTop() > video.offset().top + video.height){ video.pause(); }` – Vedant Terkar Sep 12 '16 at 05:37
  • 1
    http://stackoverflow.com/questions/34375655/youtube-video-play-pause-depend-on-visibility-of-the-frame-with-jquery I think this is what you need. Check out the answer from kosmos. – GvM Sep 12 '16 at 06:04
  • @GvM Thanks.. That helped – user6725932 Sep 12 '16 at 06:46

0 Answers0