RESOLVED FIXED203933
Picture-in-Picture events are not fired if we switch the Picture-in-Picture mode through modern media controls
https://bugs.webkit.org/show_bug.cgi?id=203933
Summary Picture-in-Picture events are not fired if we switch the Picture-in-Picture m...
Peng Liu
Reported 2019-11-06 17:23:24 PST
Picture-in-Picture events are not fired when enter/exit the Picture-in-Picture mode through modern media controls
Attachments
Patch (3.93 KB, patch)
2019-11-06 17:31 PST, Peng Liu
no flags
Patch (1.83 KB, patch)
2019-11-11 14:42 PST, Peng Liu
no flags
Radar WebKit Bug Importer
Comment 1 2019-11-06 17:24:54 PST
Peng Liu
Comment 2 2019-11-06 17:31:50 PST
Eric Carlson
Comment 3 2019-11-06 18:39:24 PST
Comment on attachment 382990 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=382990&action=review > Source/WebCore/Modules/modern-media-controls/media/pip-support.js:55 > - media.webkitSetPresentationMode(media.webkitPresentationMode === PiPMode ? InlineMode : PiPMode); > + if (!document.pictureInPictureElement) > + media.requestPictureInPicture(); > + else > + document.exitPictureInPicture(); Is this required, or is the change just modernize the controls code? If it is required, does that mean that existing code that uses video.webkitSetPresentationMode (e.g. all WebKit-specific PiP code) won't behave correctly?
Peng Liu
Comment 4 2019-11-06 20:53:04 PST
Comment on attachment 382990 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=382990&action=review >> Source/WebCore/Modules/modern-media-controls/media/pip-support.js:55 >> + document.exitPictureInPicture(); > > Is this required, or is the change just modernize the controls code? > > If it is required, does that mean that existing code that uses video.webkitSetPresentationMode (e.g. all WebKit-specific PiP code) won't behave correctly? It is required. The video.webkitSetPresentationMode() will continue working, but if we use it, the video element won't fire the events defined in the picture-in-picture API spec (enterpictureinpicture, leavepictureinpicture) properly.
Peng Liu
Comment 5 2019-11-07 22:05:52 PST
In Bug 203989, we will let video.webkitSetPresentationMode() fire the events like the interface defined in the picture-in-picture API spec.
WebKit Commit Bot
Comment 6 2019-11-08 10:06:51 PST
Comment on attachment 382990 [details] Patch Clearing flags on attachment: 382990 Committed r252240: <https://trac.webkit.org/changeset/252240>
WebKit Commit Bot
Comment 7 2019-11-08 10:06:52 PST
All reviewed patches have been landed. Closing bug.
Truitt Savell
Comment 8 2019-11-11 10:17:59 PST
It looks like the changes in: https://trac.webkit.org/changeset/252240/webkit caused two tests to timeout: media/modern-media-controls/media-controller/media-controller-inline-to-fullscreen-to-pip-to-inline.html media/modern-media-controls/pip-support/pip-support-click.html history: https://results.webkit.org/?suite=layout-tests&suite=layout-tests&test=media%2Fmodern-media-controls%2Fmedia-controller%2Fmedia-controller-inline-to-fullscreen-to-pip-to-inline.html&test=media%2Fmodern-media-controls%2Fpip-support%2Fpip-support-click.html Can this be looked at today?
Peng Liu
Comment 9 2019-11-11 10:21:00 PST
Got it, will look into them now. Thanks!
Peng Liu
Comment 10 2019-11-11 14:42:41 PST
Reopening to attach new patch.
Peng Liu
Comment 11 2019-11-11 14:42:42 PST
Peng Liu
Comment 12 2019-11-11 14:43:48 PST
Comment on attachment 383302 [details] Patch This patch can fix the timeout failure of media/modern-media-controls/pip-support/pip-support-click.html.
Peng Liu
Comment 13 2019-11-11 14:56:54 PST
(In reply to Truitt Savell from comment #8) > It looks like the changes in: https://trac.webkit.org/changeset/252240/webkit > > caused two tests to timeout: > media/modern-media-controls/media-controller/media-controller-inline-to- > fullscreen-to-pip-to-inline.html For this layout test, can we disable it for mac-wk1 for now? It is related to the test runner updates that need to be done in bug 203723. Also, I need to look into bug 183490 to see the related media control bugs.
WebKit Commit Bot
Comment 14 2019-11-12 07:39:56 PST
Comment on attachment 383302 [details] Patch Clearing flags on attachment: 383302 Committed r252365: <https://trac.webkit.org/changeset/252365>
WebKit Commit Bot
Comment 15 2019-11-12 07:39:58 PST
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.