Browser manufacturers are working on the W3C API, which will approve the Picture-in-Picture (PiP) mode and allow sites to show pop-up videos outside the browser window.
In the past, PiP was supported only inside the canvas as a pop-up window that appears only in the active tab until the user scrolls the page up and down.
Some platforms added support for PiP mode, but they were API sharpened for OS, that is, working with any video applications, but not only with browsers.
New Web API at work at WICG
The W3C division, called the WICG (Web Platform Incubator Community Group), unveiled details about the browser-based API for standardizing PiP interactions that allow sites to open external “pop-up videos.”
')
“Many users want to watch videos while they interact with other content / sites / applications on their device,” says Google developer Francois Beeffort, explaining his January idea of ​​a browser-based API different from the existing OS implementations.
According to the new API, sites will be able to control when to open and close the PiP window, set the window size, overlay custom control buttons, restrict certain interactions inside the window and collect statistics when users opened / closed the PiP window and how they did it.
The most important thing we noticed during the experiments was that the PiP extension worked with almost all test videos; This means that the new feature does not rely on code changes in sites.
Chrome and Safari are already testing a new API.
Chrome and Safari have already rolled out a new Picture-in-Picture API. For Safari, Apple rolled out the preliminary PiP API starting with iOS 9 and macOS 10.
And although the API is announced by two Google engineers, nothing is really ready for the new Chrome browser in Chrome. The Chrome team is now planning an experiment to estimate the cost of the API, after which it will decide whether to implement the new API upon completion of the test.
The experiment will begin when Chrome 68 reaches the beta stage (scheduled for June 7, 2018) and ends when Google rolls out Chrome 69 (expected August 30, 2018).
In the meantime, the feature is available to Google Canary users, who can enable it right now:
- On the chrome: // flags tab, select the flags:
- # enable-experimental-web-platform-features
- # enable-surfaces-for-videos
- # enable-picture-in-picture
- download and unpack the archive with the extension ;
- on the chrome tab : // extensions enable Developer mode if it is not already included;
- To download an extension, click on “Download unpacked extension”;
- A dialog box will appear, in it specify the src / directory, that is, the place where you unpacked the zip archive;
- open any video on Youtube and click on the extension icon to open the PiP window for the current video.
The Firefox and Edge teams have not publicly announced plans for a new API. Opera was already rolling out a feature similar to PiP
in 2016 - however, it is based on our own developments, and not on the W3C API.