web api instance property
Window: documentPictureInPicture property
Secure context
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
SpecificationsStandards references are available on the canonical MDN page.
Browser compatibility
Browser compatibilityCompatibility data is available on the canonical MDN page.