Skip to content

Automatic Picture-in-Picture #707

Description

@bpkeen

WebKittens

@marcoscaceres

Title of the proposal

User Agent Initiated (Automatic) Picture-in-Picture

URL to the spec

https://pr-preview.s3.amazonaws.com/bpkeen/picture-in-picture/pull/241.html#automatic-picture-in-picture-request

URL to the spec's repository

https://github.com/w3c/picture-in-picture

Issue Tracker URL

No response

Explainer URL

https://developer.chrome.com/blog/automatic-picture-in-picture-initiated-by-the-browser

TAG Design Review URL

No response

Mozilla standards-positions issue URL

mozilla/standards-positions#1434

WebKit Bugzilla URL

No response

Radar URL

No response

Description

This proposal extends the Picture-in-Picture API to allow the user agent to automatically open a Picture-in-Picture (PiP) window when the original content becomes occluded, such as when a user switches to another tab.

The proposed spec changes were originally created to define a permission policy for this feature, but have now expanded to also formalize what is an "automatic PiP request".

Specifically, when content occlusion occurs, there are two paths:

  1. Media Session (Building on EnterPictureInPicture MediaSessionAction w3c/mediasession#294): If the site has registered a MediaSessionActionHandler for the enterpictureinpicture action, the user agent may trigger the action with the contentoccluded reason. This allows the site to customize the PiP experience.
  2. User agent: If no handler is registered, the user agent may run the request PiP steps on a desired video element.

Note that above we use "the user agent may", this is to emphasize that the user agent can evaluate additional requirements (e.g. media is playing) to ensure a positive user experience.

The motivation is to provide a seamless multitasking experience when users navigate away from active media or video conferencing apps. For reference, see these articles:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions