DEV Community

Discussion on: What you need to know about Full screen API 💻

Collapse
 
devhammed profile image
Hammed Oyedele • Edited

Nice there is another cool API called Picture-in-Picture that display elements (I have only tested with videos though) in a separate floating window.

pipButton.addEventListener('click', () => {
  if (document.pictureInPictureElement) {
    document.exitPictureInPicture()
  } else {
    video.requestPictureInPicture()
  }
})