Window: documentPictureInPicture property
Limited availability
This feature is not Baseline because it does not work in some of the most widely-used browsers.
Experimental:This is anexperimental technology
Check theBrowser compatibility table carefully before using this in production.
Secure context: This feature is available only insecure contexts (HTTPS), in some or allsupporting browsers.
ThedocumentPictureInPicture
read-only property of theWindow
interface returns a reference to theDocumentPictureInPicture
object for the current document context.
Value
ADocumentPictureInPicture
object instance.
Examples
js
const videoPlayer = document.getElementById("player");// …// Open a Picture-in-Picture window.await window.documentPictureInPicture.requestWindow({ width: videoPlayer.clientWidth, height: videoPlayer.clientHeight,});// …
Specifications
Specification |
---|
Document Picture-in-Picture Specification # dom-window-documentpictureinpicture |