Google lets developers add more HTML elements to picture-in-picture
Google is working on an improved version of the picture-in-picture mode in Chrome. In an experimental version of the browser, developers can add all kinds of HTML functions to a PiP window, such as playback controls.
Google has in the beta version of Chrome 111 added a feature which it calls Document PiP. This adds a new API to the feature to play videos as picture-in-picture. Developers can use it to add HTML elements to a video stream that plays in a separate PiP window.
There is currently an API for this so that web developers can add some simple elements such as a pause button to PiP streams, but it is very limited. As an example of the new mode, Google cites a scrollable playlist that can be loaded into the PiP window. With the new API, developers don’t just get a video stream into which they can load some HTMLVideoElement functions, but a completely open ‘document’ into which to put all conceivable HTMLElements.
The feature is currently available as a beta feature by enabling the chrome://flags/#document-picture-in-picture-api flag. There is currently nothing to see because developers are not yet using the PiP functions. The beta period runs until Chrome version 115, which should be released in September.