Published
Edited
Apr 1, 2022
1 star
Insert cell
# Picture in Picture Any Window
Insert cell
pipVideo = html`<video muted autoplay style="width:250px;">`
Insert cell
{
let button = html`<button>Start`;
const capture = () => {
navigator.mediaDevices
.getDisplayMedia()
.then((stream) => {
pipVideo.srcObject = stream;
pipVideo.onclick = () => pipVideo.requestPictureInPicture();
})
.catch((e) => console.log(e));
};
button.addEventListener("click", capture);
return button;
}
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more