WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED INVALID
172051
`webkitSetPresentationMode('picture-in-picture');` (PiP) not working on multiple video sources
https://bugs.webkit.org/show_bug.cgi?id=172051
Summary
`webkitSetPresentationMode('picture-in-picture');` (PiP) not working on multi...
Kurt Zenisek
Reported
2017-05-12 14:27:32 PDT
Checking YouTube (which uses blob: for their videos now) shows that you can use `document.getElementsByTagName('video')[0];` in Safari's console on a video player page to obtain the correct video element without issue. However, using `document.getElementsByTagName('video')[0].webkitSetPresentationMode('picture-in-picture');` at that point returns "undefined" and the video is not turned into a Picture-in-Picture (PiP). Meanwhile right-clicking the YouTube video player (to get the context menu for the video element to show) is able to turn the video into a Picture-in-Picture without issue. I'm guessing there's a bug when it comes to the `webkitSetPresentationMode('picture-in-picture');` command being executed on video elements with a `blob:` url as it's source.
Attachments
Add attachment
proposed patch, testcase, etc.
Kurt Zenisek
Comment 1
2017-05-12 14:31:50 PDT
Also, it appears that using `document.getElementsByTagName('video')[0].webkitSetPresentationMode('inline');` _works_ on a YouTube video (if you were to make it a PiP via the video element's context menu) whereas `document.getElementsByTagName('video')[0].webkitSetPresentationMode('picture-in-picture');` does not work (even if you execute this immediately after the inline command worked.)
Kurt Zenisek
Comment 2
2017-05-12 14:49:22 PDT
Finally, it appears that the use of a `javascript:document.getElementsByTagName('video')[0].webkitSetPresentationMode('picture-in-picture');` bookmarklet does work while running `document.getElementsByTagName('video')[0].webkitSetPresentationMode('picture-in-picture');` directly from Safari's console does not. Oddly enough, the use of `document.getElementsByTagName('video')[0].webkitSetPresentationMode('picture-in-picture');` directly in the console starts working after you have used the `javascript:document.getElementsByTagName('video')[0].webkitSetPresentationMode('picture-in-picture');` bookmarklet.
Kurt Zenisek
Comment 3
2017-05-12 14:56:18 PDT
Triggering a PiP shouldn't require a bookmarklet or using the context menu of the video element while using the webkitSetPresentationMode('picture-in-picture'); command directly via the browser's JavaScript (be it an extension or via the browser's console) does not work.
Kurt Zenisek
Comment 4
2017-05-12 15:06:05 PDT
I just tested a non-blob URL, and it appears this issue isn't just restricted to `blob:` video sources.
Radar WebKit Bug Importer
Comment 5
2017-05-16 20:16:27 PDT
<
rdar://problem/32239548
>
Brent Fulgham
Comment 6
2022-02-12 23:33:29 PST
Fullscreen and Picture in picture require a user gesture. Commands run from the web inspector don’t simulate a user gesture while running. The user-gesture requirement is removed after entering fullscreen on an element.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug