w3c / picture-in-picture

Picture-in-Picture (PiP)
https://w3c.github.io/picture-in-picture
Other
311 stars 39 forks source link

Does pictureInPictureEnabled need to be false or can be "undefined" if the picture-in-picture support is not available? #170

Closed pliu6 closed 4 years ago

pliu6 commented 4 years ago

https://github.com/w3c/picture-in-picture/blob/4db5e801275ce740f31a3ab7615969a28894bba3/index.bs#L394

beaufortfrancois commented 4 years ago

pictureInPictureEnabled is undefined if Picture-in-Picture Web API is not available. See https://developers.google.com/web/updates/2018/10/watch-video-using-picture-in-picture#feature-support

if (!('pictureInPictureEnabled' in document)) {
  console.log('The Picture-in-Picture Web API is not available.');
}
else if (!document.pictureInPictureEnabled) {
  console.log('The Picture-in-Picture Web API is disabled.');
}