Document Picture-in-Picture lets custom video players keep their controls
Standard video.requestPictureInPicture() only pops out the raw video, which drops any custom controls. The Document Picture-in-Picture API instead opens an always-on-top window that can hold your own DOM. The approach moves the live player node into that window without cloning it, so playback continues uninterrupted. Styles must be copied over and keyboard shortcuts rebound, since listeners on the original document stop firing while the PiP window has focus. The author tested it in Chromium 158 with hls.js, and browsers without the API, such as Safari, need to fall back to classic PiP.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)
Log in to join the discussion and vote.
Log in