Automatically Play and Pause video as it enters and leaves the viewport/screen

So you have a bunch of video on your site that autoplays. Maybe it would be good to automatically pause the videos when they aren’t on screen? This little code snippet will do just that. It finds all the videos on the page and then uses an Intersection Observer to play them when they are […]


This content originally appeared on Ben Frain and was authored by Ben Frain

So you have a bunch of video on your site that autoplays. Maybe it would be good to automatically pause the videos when they aren't on screen? This little code snippet will do just that. It finds all the videos on the page and then uses an Intersection Observer to play them when they are […]


This content originally appeared on Ben Frain and was authored by Ben Frain


Print Share Comment Cite Upload Translate Updates
APA

Ben Frain | Sciencx (2021-08-06T13:52:06+00:00) Automatically Play and Pause video as it enters and leaves the viewport/screen. Retrieved from https://www.scien.cx/2021/08/06/automatically-play-and-pause-video-as-it-enters-and-leaves-the-viewport-screen/

MLA
" » Automatically Play and Pause video as it enters and leaves the viewport/screen." Ben Frain | Sciencx - Friday August 6, 2021, https://www.scien.cx/2021/08/06/automatically-play-and-pause-video-as-it-enters-and-leaves-the-viewport-screen/
HARVARD
Ben Frain | Sciencx Friday August 6, 2021 » Automatically Play and Pause video as it enters and leaves the viewport/screen., viewed ,<https://www.scien.cx/2021/08/06/automatically-play-and-pause-video-as-it-enters-and-leaves-the-viewport-screen/>
VANCOUVER
Ben Frain | Sciencx - » Automatically Play and Pause video as it enters and leaves the viewport/screen. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2021/08/06/automatically-play-and-pause-video-as-it-enters-and-leaves-the-viewport-screen/
CHICAGO
" » Automatically Play and Pause video as it enters and leaves the viewport/screen." Ben Frain | Sciencx - Accessed . https://www.scien.cx/2021/08/06/automatically-play-and-pause-video-as-it-enters-and-leaves-the-viewport-screen/
IEEE
" » Automatically Play and Pause video as it enters and leaves the viewport/screen." Ben Frain | Sciencx [Online]. Available: https://www.scien.cx/2021/08/06/automatically-play-and-pause-video-as-it-enters-and-leaves-the-viewport-screen/. [Accessed: ]
rf:citation
» Automatically Play and Pause video as it enters and leaves the viewport/screen | Ben Frain | Sciencx | https://www.scien.cx/2021/08/06/automatically-play-and-pause-video-as-it-enters-and-leaves-the-viewport-screen/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.