Pip feature Request : Auto trigger
Categories
(Toolkit :: Picture-in-Picture, enhancement, P3)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox130 | --- | fixed |
People
(Reporter: yoann, Assigned: 9wjt17j4z)
References
(Depends on 1 open bug, Regressed 1 open bug)
Details
Attachments
(1 file)
User Agent: Mozilla/5.0 (Android 10; Mobile; rv:68.0) Gecko/68.0 Firefox/68.0
Expected results:
I couldn't find any settings to activate pip.
The ideal situation would trigger pip when a playing video leaves the viewport or
Comment 1•4 years ago
|
||
Please implement this feature. Not just on tab change, but if the window leaves the viewport. I would like to alt-tab to another windows and keep seeing the video.
This feature was also requested here: https://connect.mozilla.org/t5/ideas/auto-pip-when-tab-is-changed/idi-p/7917
and here: https://www.reddit.com/r/firefox/comments/wfjyf0/automatic_pictureinpicture_mode_when_window_focus/
Comment 2•3 years ago
|
||
I like this idea! Yandex browser mobile\desktop have this great functionality!
Hi,
This is something we are considering for development in the future.
I've been looking for a similar option or extension for a while but was not able to find any.
Having the option to automatically open media in PiP while swapping between tabs improves the UX imo.
| Comment hidden (me-too) |
| Assignee | ||
Comment 6•2 years ago
|
||
Updated•2 years ago
|
Comment 8•2 years ago
|
||
Hi Daniele,
Are you still working on this? I responded with some review feedback for your patch. I'm happy to answer any questions you might have about it.
| Assignee | ||
Comment 9•2 years ago
|
||
Hi Mike,
Yes, I'm sorry for the wait. Actually I've implemented the architectural changes you proposed (primarily the usage of the "TabSelect" event), but unfortunately I got stuck on a couple of tests failing due to a bug.
Initially, I tried to move the new maybeTogglePiP function to the TabSelect handler of PictureInPicture.sys.mjs, however that handler is executed only if a PiP window has already been manually opened.
To solve that, I've chosen to use the on_TabSelect handler but in tabs.js.
The patch works as expected, but some tests are failing due to the following behaviour.
If a user has two tabs (e.g., "New tab" and "test_video.html"), with "test_video.html" currently active, with a video playing and with PiP deactivated, as soon as the user closes that tab, it blurs to the sibling tab ("New tab") and the TabSelect event is triggered thus my function is called. The JSActor async message PictureInPicture:KeyToggle is sent instantly, but it is actually received by the PictureInPictureChild.sys.mjs when the tab has been already closed, and this results in a blank PiP window.
Using a debugger I have verified that is a synchronization issue. If I introduce a delay (with a breakpoint right before my maybeTogglePiP function) to allow the PiP trigger to complete its execution also in the child actor, the PiP window appears and it's closed right before when its tab is closed, as expected.
Can I upload my current revision so I may receive some help?
Comment 10•2 years ago
|
||
(In reply to Daniele Ferla from comment #9)
Can I upload my current revision so I may receive some help?
Absolutely!
Comment 11•2 years ago
|
||
Comment 12•2 years ago
|
||
| bugherder | ||
Description
•