Chrome tests the Picture-in-Picture API for pop-up videos outside the browser
Browser makers are working on the W3C API, which will adopt the Picture-in-Picture (PiP) mode and allow sites to display pop-up videos outside the browser window.
In the past, PiP was only supported inside the canvas as a pop-up window that appears only in the active tab, while the user scrolls the page up and down.
Some platforms added support for PiP-mode, but these were APIs sharpened for OS, that is, working with any video applications, but not only with browsers.
New Web API at WICG
A W3C unit called the WICG (Web Platform Incubator Community Group) has unveiled details about the browser 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 Beaufort, explaining his January idea about a browser API different from 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, impose custom control buttons, limit certain interactions within the window and collect statistics when users open / close the PiP window and how they did it.
The most important thing that 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 already testing new API
Chrome and Safari have already rolled out the new Picture-in-Picture API. For Safari, Apple rolled out a preliminary PiP API starting with iOS 9 and macOS 10.
And although the API was announced by two Google engineers, nothing is yet ready for the Chrome API in the Chrome browser. The Chrome team is currently planning an experiment to evaluate 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 end 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, check the flags:
- # enable-experimental-web-platform-features
- # enable-surfaces-for-videos
- # enable-picture-in-picture
- Download and unzip the archive with the extension ;
- on the chrome: // extensions tab enable Developer Mode if it is not already enabled;
- to download the extension, click on “Download unpacked extension”;
- a dialog box appears, in it specify the src / directory, that is, the place where you unzipped 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 the new API. Opera already rolled out a feature similar to PiP in 2016 - however, it is based on its own development, and not on the W3C API.