Bug 189885

Summary: Picture-in-Picture cannot be initiated when tab is not visible
Product: WebKit Reporter: rob.stone
Component: MediaAssignee: Nobody <webkit-unassigned>
Status: NEW ---    
Severity: Normal CC: ap, eric.carlson, jeremyj-wk, jer.noble
Priority: P2    
Version: Safari Technology Preview   
Hardware: Mac   
OS: macOS 10.13   

Description rob.stone 2018-09-22 08:21:11 PDT
When attempting to initiate picture-in-picture mode with `webkitSetPresentationMode("picture-in-picture")` while the tab is not visible, the following error occurs: `HTMLMediaElement::enterFullscreen(C4262CD8)   returning because document is hidden`.

While full screen mode should not be allowed to initiate when tab is not visible, picture-in-picture should not be subject to this same rule.
Comment 1 Alexey Proskuryakov 2018-09-22 15:00:59 PDT
What is the scenario where a user would want an invisible tab to start PiP?
Comment 2 rob.stone 2018-09-22 19:53:06 PDT
When navigating to another tab or app, it is convenient to automatically invoke picture-in-picture as occurs on iPad.

Undesired launches of picture-in-picture mode would not be likely due to the rules on auto-play media.