MDN self-hosted library · e01.org

Window: documentPictureInPicture property

Document Picture-in-Picture API

Open notebook · 1 cells web-api-instance-property upstream source

Document Picture-in-Picture API

The documentPictureInPicture read-only property of the Window interface returns a reference to the DocumentPictureInPicture object for the current document context.

Value

A DocumentPictureInPicture object instance.

Examples

const videoPlayer = document.getElementById("player");

// …

// Open a Picture-in-Picture window.
await window.documentPictureInPicture.requestWindow({
  width: videoPlayer.clientWidth,
  height: videoPlayer.clientHeight,
});

// …

Specifications

Browser compatibility

See also