Skip to content

POC - auto play/pause video tag that lives in an iframe when the page is not visible

License

Notifications You must be signed in to change notification settings

oze4/video-in-iframe

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 

Repository files navigation

video-in-iframe

  • Demo can be found here
  • Play the video and click on a different browser tab, or minimize the window, and the video will pause..
  • Then click back to the demo and the video will resume (similar to how Instagram does it).

POC - auto play/pause video tag that lives in an iframe when the page is not visible.

The issue we had was the iframe and video inside of it were not created upon document ready/load. Had to come up with a way to wait for certain elements to be created first before initializing the Page Visible API.

The Page Visible API is how we pause the video when a user switches browser tab, or minimizes the browser, and how we resume playing the video once the tab is 'active' again.

Why this POC was built to begin with

About

POC - auto play/pause video tag that lives in an iframe when the page is not visible

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages