Tagged: video
Hi,
I have a full screen slider with an autoplay vimeo video, and all is fine.
However I would like the video to stop when the user scrolls away from it. Is there some way of achieving it?
We could write some JS code for it, but we are not sure what command to use to play/stop the video.
Can you help?
Cheers.
Hey!
You could try something like:
http://stackoverflow.com/questions/6145990/how-to-stop-a-vimeo-video-with-jquery
Cheers!
Josue
Hi,
Thanks for your help.
Where we are struggling is the video source, meaning we do not know what to use as a iframe ID. We have tried all sorts of things, but the console reports it as undefined.
The video is at the top of the following webpage:
http://www.loyalzoo.com/business/
Would you be able to help as to what id to use to stop that video? Once we know how to stop it, we can then generate the code to trigger it when the user scrolls down the page.
Thanks.
Hi,
Try:
jQuery("#fullscreen_slider_0 iframe");
Best regards,
Josue
Thanks! With that command we are now able to stop the video when the user scrolls down the page. The only little issue now is that when we scroll back up, the video doesn’t restart automatically. The user needs to click twice on it to restart it.
Is there a command we could use to just “pause” the video, and one to “resume” it? Do we need to import the Vimeo APIs for that? Or is there an easier way?
Many thanks.
Hey!
I think this post: http://stackoverflow.com/a/12932722 will give you a starting point. Probably you also need to load the froogaloop2.min.js file which contains the api code.
Best regards,
Peter
Great, thanks for the tip! We made it work as intended!
You can see the result at:
http://www.loyalzoo.com/business/
Cheers! ;-)
Great result, can you share it here if you want :)
Best regards,
Josue
Done, many thanks Josue.