const videoPlayer = document.getElementById("player");
// …
// Open a Picture-in-Picture window.
await window.documentPictureInPicture.requestWindow({
width: videoPlayer.clientWidth,
height: videoPlayer.clientHeight,
});
// …Window: documentPictureInPicture property / notebook
Window: documentPictureInPicture property
Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.