Google

Chrome Tests Picture-in-Picture API to Show Floating Video Popups Outside the Browser


PiP window in Chrome

Browser makers are working on a new W3C API that will standardize Picture-in-Picture (PiP) mode and allow websites to show a floating video popup outside the browser window itself.

In the past, picture-in-picture has only been supported inside a web page’s canvas as a floating window that only appeared inside the current website, as the user scrolled up and down the page.

Some platforms added support for a picture-in-picture mode, but those were OS-specific APIs that worked with all sorts of video apps, not just browsers.

New Web API in the works at the W3C’s WICG

Now, the Web Platform Incubator Community Group (WICG) at the World Wide Web Consortium (W3C), has released details about a browser-specific API for standardizing picture-in-picture interactions that allow websites to open an external “floating video” popup outside the browser window itself.

“Many users want to continue consuming media while they interact with other content, sites, or applications on their device,” Google software engineer François Beaufort explained this past January when he proposed the idea of a browser-specific API, different from the existing OS-level implementations.

“The proposed Picture-in-Picture API allows websites to initiate and control this behavior,” he says.

According to the new API, websites will be able to control when to open or close the PiP popup, set the popup size, overlay custom controls, restrict certain interactions inside the popup, and gather statistics on when users open or leave PiP and how they used it.

Most importantly, during Bleeping Computer’s experiments, we’ve noticed the PiP extension would float almost all videos we tested, meaning the feature doesn’t rely on website owners changing their code for it to work.

Chrome and Safari are already testing the new API

Chrome and Safari have already shipped out the new Picture-in-Picture API. In Safari, Apple has shipped a vendor-prefixed API for Picture-in-Picture starting with Safari on iOS 9 and macOS 10.

Despite the API being the proposal of two Google engineers, Chrome hasn’t committed that much to the new API. The Chrome team is currently planning an experiment to assess how the API will fare and will decide if to ship the new API at the end of the tests.

The experiment will start when Chrome 68 reaches the Beta channel (currently scheduled for June 7, 2018) and will end when Google ships Chrome 69 Stable (estimated for August 30, 2018).

In the meantime, the feature is already available for Google Canary users, who can enable it right now by following these instructions.

  1. In chrome://flags enable the following flags:

    • #enable-experimental-web-platform-features
    • #enable-surfaces-for-videos
    • #enable-picture-in-picture
  2. Download and extract the extension zip file.

  3. In chrome://extensions toggle Developer mode (upper-right corner) if it is not already on.

  4. To load the extension, click Load Unpacked.

  5. In the dialog box that appears locate and select the src/ folder from the directory where you unpacked the zip file.

  6. Navigate to any YouTube video and click the extension browser icon to toggle Picture-in-Picture for the current video.

Chrome PiP flags

The Firefox and Edge teams have not provided any public signals on their intent towards the new API.

Click to comment

Leave a Reply

Your email address will not be published. Required fields are marked *

Most Popular

To Top