Enter video Picture-in-Picture automatically on more sites

Benjamin Keen
Benjamin Keen
François Beaufort
François Beaufort

Published: March 18, 2026

Starting with Chrome 142, web apps that play audio or video can automatically enter Picture-in-Picture mode if they register a media session action handler. This has been a great addition for music and video players, but it requires developers to implement support explicitly.

To provide a seamless media multitasking experience and improve the discoverability of Picture-in-Picture (PiP), Chrome introduces browser-initiated Auto PiP. This feature lets Chrome automatically open a video PiP window for sites that have not registered a media session action handler. This ensures that your media content remains visible when you switch tabs.

Instructions

  • Use Chrome 142 or a later version on desktop.
  • Enable "Browser initiated automatic picture in picture" in chrome://flags/#browser-initiated-automatic-picture-in-picture and restart Chrome.
  • Go to a video website and play a video (example).
  • Switch to another Chrome tab to trigger a video PiP window.

How it works

When you play media and switch to another tab, Chrome can automatically move the media into an always-on-top video PiP window. Unlike the existing "Auto PiP for Media Playback feature," which supports either video or arbitrary HTML content (using the Document Picture-in-Picture API), browser-initiated requests always open a standard video PiP window.

To ensure a high-quality and non-intrusive user experience, Chrome triggers this behavior only when a strict set of conditions are met:

  • The top frame URL is safe according to the Safe Browsing service.
  • The media is in the top frame.
  • The media has been audible within the last two seconds.
  • The media has audio focus and is playing.
  • A single "normal" player exists, that is, an unmuted media element that has played and is not using MediaStream.
  • The media element must have a video track.
  • The site is not actively using the camera or microphone.
  • The user's Media Engagement Index threshold has been exceeded, which indicates frequent use of the site. This condition applies if the user has not explicitly allowed or denied the feature.
  • No PiP window is currently open. If another PiP window is already open, Chrome does not trigger an automatic transition.
Comparison of browser-initiated Auto PiP (site without an enterpictureinpicture action handler) and Auto PiP for media playback (where the site has registered the handler).

User control and privacy

Browser-initiated Auto PiP respects the same user permissions and settings as site-initiated requests. The first time a site enters PiP automatically, Chrome presents users with a permission dialog that asks if they want to allow this behavior for the site in the future.

Users can also manage these permissions at any time through the "Site Settings".

Developer control and opt-out

While this feature is designed to work out of the box for most video sites, you can opt out of this behavior.

Implement your own handler

If your web app already registers a media session action handler for the enterpictureinpicture action, your implementation takes precedence, and Chrome does not initiate its own automatic transition.

If you want to customize behavior when Chrome thinks a transition is appropriate, the enterpictureinpicture action handler includes a reason in the MediaSessionActionDetails. You can check if the reason is contentoccluded (which means the browser initiated the request because the tab was hidden) and decide how to proceed.

navigator.mediaSession.setActionHandler("enterpictureinpicture", (details) => {
  if (details.reason === "contentoccluded") {
    // The browser suggests entering Picture-in-Picture.
    // You can choose to open a standard video PiP or a Document PiP window, or do
    // nothing (effectively blocking browser-initiated Auto Picture-in-Picture).
  }
});

Best practices for media session

With browser-initiated Auto PiP, your media session configuration helps Chrome understand and interact with your content. A well-configured MediaSession ensures that the PiP window provides a high-quality experience with accurate controls and information for users.

Keep the progress bar in sync

If the setPositionState API is used, and the media session position is not updated properly, PiP windows display an inaccurate progress bar during media playback. To prevent this, always update or unset the position state using navigator.mediaSession.setPositionState() as appropriate (for example, when the media source changes or is reset), so the PiP window reflects the correct position for the playing media.

const video = document.querySelector('video');

function updatePositionState() {
  if ('setPositionState' in navigator.mediaSession) {
    navigator.mediaSession.setPositionState({
      duration: video.duration,
      playbackRate: video.playbackRate,
      position: video.currentTime,
    });
  }
}

// Update when metadata is loaded or when seeking happens.
video.addEventListener("loadedmetadata", updatePositionState);
video.addEventListener("seeked", updatePositionState);

Handle transitions gracefully

If your site automatically plays a "Next Episode," ensure that your MediaSession action handlers and metadata stay active and accurate throughout the transition. If action handlers are removed or unset during the transition to a "Next" element, the PiP window might lose the capabilities that were provided by the handler.

Enable full control

Beyond basic play and pause, consider implementing handlers for seekto, previoustrack, and nexttrack. This lets users navigate your content directly from the PiP window without returning to the original tab.

navigator.mediaSession.setActionHandler("seekto", (details) => {
  if (details.fastSeek && "fastSeek" in video) {
    video.fastSeek(details.seekTime);
    return;
  }
  video.currentTime = details.seekTime;
});

Engage and share feedback

If you have feedback or encounter any issues with this behavior, share them at crbug.com.

Resources