Closed beaufortfrancois closed 5 years ago
With the PR, the following case is treated as "visible", which is probably not intended:
Indeed! I've updated PR.
@beaufortfrancois looks good to me now, thank you.
@mounirlamouri I've tried Safari and it looks like Picture-in-Picture doesn't make any difference.
@jernoble, is that intended? Shall we set visibilityState
attribute to be "visible" when
pictureInPictureElement
is set even when document is in background.
To summarise a discussion @beaufortfrancois and I had offline: Chrome Android auto-PIP exposes that the page is hidden but Chrome desktop PIP feature seems to make the page visible by default. This isn't intentional and I'm actually surprised it does. I do understand some of the concerns shared from the bug report but my understanding is that these concerns are mostly for backward compatibility and websites expecting PIP should be using the API discover the state. I do not have a strong opinion either way but compatibility matters here.
For info, you can play with PiP and Page Visibility API at https://beaufortfrancois.github.io/sandbox/media/picture-in-picture-playground
@mounirlamouri I wasn't able to see document.visibilityState
set to hidden
when video plays AutoPiP in Chrome for Android in Canary. Did I miss anything?
@beaufortfrancois I may have been very wrong :)
Though, the compatibility point still applies but between Safari and Chrome I guess.
After talking to @jernoble at TPAC 2018, we agreed we should go ahead with this PR.
@mounirlamouri We'd have to fix Chrome for Android implementation of AutoPiP to make sure that document.visibilityState
is visible
when video is in Picture-in-Picture.
Safari would also need to update its implementation, right?
Yes, and we'd like to.
FYI I've filed https://bugs.chromium.org/p/chromium/issues/detail?id=898495 to make sure Chromium implementation is updated accordingly.
FIX #80
Preview | Diff