Implement Picture-in-Picture Web API on Desktop
Categories
(Core :: DOM: Core & HTML, enhancement, P2)
Tracking
()
People
(Reporter: beaufort.francois, Assigned: sfarre, NeedInfo)
References
(Depends on 1 open bug, Blocks 1 open bug, Regressed 1 open bug)
Details
(5 keywords, Whiteboard: [geckoview:p3][webcompat], [wptsync upstream])
User Story
web-feature: picture-in-picture platform-scheduled:2026-06-30 user-impact-score:900
Attachments
(12 files, 6 obsolete files)
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review |
| Reporter | ||
Comment 1•8 years ago
|
||
| Reporter | ||
Updated•8 years ago
|
Comment 2•8 years ago
|
||
| Reporter | ||
Comment 3•8 years ago
|
||
Comment 4•8 years ago
|
||
Comment 5•7 years ago
|
||
Comment 6•7 years ago
|
||
| Reporter | ||
Comment 7•7 years ago
|
||
Updated•7 years ago
|
Comment 8•7 years ago
|
||
BBC's site is now using this, as discovered in https://webcompat.com/issues/26256.
Updated•7 years ago
|
Comment 9•7 years ago
|
||
Migrating Webcompat whiteboard priorities to project flags. See bug 1547409.
Comment 10•7 years ago
|
||
See bug 1547409. Migrating whiteboard priority tags to program flags.
Updated•6 years ago
|
| Comment hidden (advocacy) |
Updated•6 years ago
|
Comment 13•4 years ago
|
||
why this bug is marked as duplicate of Bug 1611831?
Picture-in-Picture JavaScript API and disablePictureInPicuture attribute is different things.
e.g. sometimes developer want to add customized "Start PiP" button on their website.
Comment 14•4 years ago
|
||
Amininkova, I added the need-info flag for you in order to clarify the question in the previous comment.
Sebastian
Comment 15•4 years ago
|
||
Hi Sebastian and Rinsuki,
Mozilla has no current plans to support Picture-in-Picture Web API or its parts. I will remove the resolution to avoid further confusion but will close the ticket nevertheless.
Comment 16•4 years ago
|
||
But from what I heard in the #standard discussion, it seems our standard team recently changed their thought and we might start supporting this API in the future.
Comment 18•4 years ago
|
||
It seems incredibly strange to me that Firefox supports picture-in-picture web video but not document.pictureInPictureEnabled + video.requestPictureInPicture(). The end result is that a custom video player cannot show a pip control alongside other custom controls in Firefox, instead having the highly inconsistent floating icon.
Strong +1 towards supporting the PIP API, please.
Comment 19•4 years ago
|
||
Hi,
I don't really get why you wont at-all support the disablePictureInPicture attribute. We have built a WebRTC conference application and the usability is completely broken since every participant's video has this ridiculous floating PiP overlay, that completely interferes with the UI and just confuses our users.
The fact that we can not even disable it for video elements that display a WebRTC MediaStream brought us to the decision that we will no longer support Firefox and will recommend the usage of other browsers to our customers.
Comment 20•4 years ago
|
||
Hi Sven! Note that this is the meta-issue for the implementation of all the PiP API (which unfortunately also got closed because Mozilla obviously doesn't have any plans to implement this API, for the time being).
The specific bug for disablePictureInPicture is/was bug 1611831. See Mike Conley's comments there for Mozilla's reasoning not to implement this API. He also mentions there that an enterprise policy got introduced in bug 1619658 that allows system administrators to turn the the PiP overlay off. Users can also individually disable the button in the settings by unchecking the option "Enable picture-in-picture video controls".
Sebastian
Updated•3 years ago
|
Updated•1 year ago
|
Updated•1 year ago
|
Updated•1 year ago
|
Updated•1 year ago
|
Updated•1 year ago
|
Updated•1 year ago
|
Updated•1 year ago
|
Comment 23•1 year ago
|
||
Updated•1 year ago
|
| Comment hidden (advocacy) |
Updated•11 months ago
|
Updated•11 months ago
|
Updated•11 months ago
|
Updated•7 months ago
|
Updated•7 months ago
|
Updated•7 months ago
|
| Assignee | ||
Comment 26•7 months ago
|
||
By introducing nsIPictureInPictureFunctions we can call PictureInPicture functions directly and have JS promises returned to us. With those we can build the parallel queue that we do work on in the spec, by wrapping the promises in our own type that will be a PromiseNativeHandler that on resolve can resume the remainder of the in-parallel steps.
Added a chrome-only way to notify our PictureInPictureWindow of a resize event, which it then can "forward" to web content.
| Assignee | ||
Comment 27•7 months ago
|
||
The PictureInPictureService maintains the parallel queue, protecting the PiP window creation/destruction from races.
It wraps our chrome-js promises into PictureInPictureRequest, which on settling resumes the remainder of the in-parallel steps.
| Assignee | ||
Comment 28•7 months ago
|
||
Co-authored-by: Simon Farre <sfarre@mozilla.com>
Updated•7 months ago
|
Updated•7 months ago
|
Updated•6 months ago
|
| Assignee | ||
Comment 29•6 months ago
|
||
Updated•6 months ago
|
Updated•6 months ago
|
Updated•6 months ago
|
Updated•6 months ago
|
Updated•6 months ago
|
Updated•6 months ago
|
Updated•6 months ago
|
Updated•6 months ago
|
| Assignee | ||
Comment 30•6 months ago
|
||
Set default false
| Assignee | ||
Comment 31•6 months ago
|
||
| Assignee | ||
Comment 32•6 months ago
|
||
Implements the gecko-parts of Picture In Picture API, to which the various platforms can add their implementation for opening a PIP Window to.
nsIPictureInPictureFunctions.idl shall be implemented by the different platforms. For desktop we already have a "native" PIP implementation and this will be re-used.
Platforms which does not implement nsIPictureInPictureFunctions.idl, will signal that they don't support it (and attempts to request via the API algorithms, will reject accordingly).
| Assignee | ||
Comment 33•6 months ago
|
||
Adds implementation of nsIPictureInPictureFunctions.idl for desktop in browser components.
Makes changes to current native implementation by making it so that we can track the entirety of a request via chaining promises effectively by using sendQuery where we can.
Added the (made up) restriction of just having one PIP window per browsing context; technically our desktop implementation supports any number of windows. The spec "allows" for multiple windows, but it's own language actually makes it impossible, at least in current version and the idea here is to match an eventual Android implementation as close as possible and Android's native PIP support, supports just a single window (see https://source.android.com/docs/core/display/pip)
| Assignee | ||
Comment 34•6 months ago
|
||
This is just to prototype the chrome js interface nsIPictureInPictureFunctions.idl to see if it's suitable to wrap all platforms.
The Android PIP implementation here involves creating a new activity, a gecko session and then we load a data URI with the minimal content we want in it (with a video element). This is a super hack, but I couldn't find any other way to make sure that the bc actually gets to live in the content process we want (where the originating video is from).
When the document is loaded, we send messages down using the js window actors, and start cloning.
Updated•6 months ago
|
| Assignee | ||
Comment 35•6 months ago
•
|
||
Description:
This feature exposes the native PIP implementation to be triggered from Picture in picture API. To trigger the behavior, a website has to run the script someVideoElement.requestPictureInPicture(), potentially via clicking a button. I don't know if this is enough context, but if we have previous understanding of how Native PIP works, there should be parity here. It is up to the website to expose this feature in an accessible way.
How do we test this?
- Set the preference
dom.picture-in-picture.enabledto true either via./mach run --setpref dom.picture-in-picture.enabled=true https://developer.mozilla.org/en-US/docs/Web/API/Picture-in-Picture_APIor via about:config - If above command wasn't used to start, navigate to https://developer.mozilla.org/en-US/docs/Web/API/Picture-in-Picture_API
- Scroll down to example and click button
When will this ship?
Fx 152
Tracking bug/issue:
1463402
Design documents (e.g. Product Requirements Document, UI spec):
Overview & android related exploration
Engineering lead:
[:sfarre] Simon Farre
Product manager:
[:hsinyi] Hsin-Yi Tsai
The accessibility team has developed the Mozilla Accessibility Release Guidelines which outline what is needed to make user interfaces accessible: https://wiki.mozilla.org/Accessibility/Guidelines. Please describe the accessibility guidelines you considered and what steps you've taken to address them:
I've not taken any particular steps to address them, but instead has relied on not regressing the native PIP feature on desktop, so if it's possible to defer to the a11y request made for Native PIP (if there is any that is), I will.
Describe any areas of concern to which you want the accessibility team to give special attention:
To ensure that behavior parity/expected behaviors remain the same as for Native PIP, with the exception of that this has to be triggered from web content. So if we have some a11y related review for Native PIP, I'd like to defer to that while main focus would be no regressions/difference beyond how it's triggered.
If there are issues with the request, I'll gladly address these, just let me know!
Edit:
Note: The android patch of this stack is just a prototype and it's possible it will be discarded entirely. So disregard that one.
Updated•6 months ago
|
Updated•6 months ago
|
Updated•5 months ago
|
Comment 36•5 months ago
|
||
As expected, this all looks pretty solid on desktop. Since the only browser UI part is the same as the existing PiP UI, and since the API is triggered by web content which the accessibility engine already makes accessible, there are no accessibility concerns regarding any UI specific to this implementation. This has led me to discover a number of accessibility bugs with the existing PiP UI, but those already apply to native PiP, so those don't block this work.
One open question/minor concern is how this should interact with native PiP. If you start native PiP (e.g. with the keyboard shortcut), document.pictureInPictureElement is null. If you then call video.requestPictureInPicture, this closes PiP. This impacts everyone and is not specific to accessibility. However, I think it disproportionately impacts users who primarily use the keyboard instead of the mouse (including screen reader users) because such users are more likely to use the native keyboard shortcut to open PiP, since many video players on the web don't have proper keyboard and semantic accessibility. Ideally, I think the state would be synchronised somehow, but I can understand that this might be tricky within the bounds of the API. If it's not possible within the current API, it does seem like an issue worth raising against the API, as surely this impacts any other browser with any form of native PiP as well.
:sfarre, is there anything we can do here?
| Assignee | ||
Comment 37•5 months ago
|
||
(In reply to James Teh [:Jamie] from comment #36)
One open question/minor concern is how this should interact with native PiP. If you start native PiP (e.g. with the keyboard shortcut), document.pictureInPictureElement is null. If you then call video.requestPictureInPicture, this closes PiP. This impacts everyone and is not specific to accessibility. However, I think it disproportionately impacts users who primarily use the keyboard instead of the mouse (including screen reader users) because such users are more likely to use the native keyboard shortcut to open PiP, since many video players on the web don't have proper keyboard and semantic accessibility. Ideally, I think the state would be synchronised somehow, but I can understand that this might be tricky within the bounds of the API. If it's not possible within the current API, it does seem like an issue worth raising against the API, as surely this impacts any other browser with any form of native PiP as well.
So, the reason why this closes, is because of a minor check inside our current native picture in picture implementation. Like you're already saying; we can synchronize this somehow. This also only happens if the PIP API is triggered for a video element that is already in Native PIP. The check is there to protect (for our Native PIP) against racyness (see here: https://searchfox.org/firefox-main/source/toolkit/actors/PictureInPictureChild.sys.mjs#182). I believe I can maintain spec correctness, by just checking for that up front (i.e. the PIP API will resolve immediately, because native pip implementation already has "served us" with a window as it were).
Not as important, but a side note:
I'm not sure we can write spec with native PIP in mind, given that the browsers (and platforms) differ in support and behavior. For instance, chrome only supports 1 PIP window in total (though should be able to support more). Safari seems like it's actually constrained by the OS to not have multiple though, it's not clear to me if that assumption is true. For mobile (android) there the OS only supports 1 PIP window in total, and it comes with constraints on how it can receive inputs.
Updated•5 months ago
|
Updated•5 months ago
|
Updated•5 months ago
|
Updated•5 months ago
|
Comment 38•5 months ago
|
||
(In reply to Simon Farre [:sfarre] from comment #37)
I believe I can maintain spec correctness, by just checking for that up front (i.e. the PIP API will resolve immediately, because native pip implementation already has "served us" with a window as it were).
I see you've done this now; thank you. I also see that this sets document.pictureInPictureElement when this resolves, even if we just "reused" the native PIP window.
I'm not sure we can write spec with native PIP in mind, given that the browsers (and platforms) differ in support and behavior. For instance, chrome only supports 1 PIP window in total (though should be able to support more). Safari seems like it's actually constrained by the OS to not have multiple though, it's not clear to me if that assumption is true. For mobile (android) there the OS only supports 1 PIP window in total, and it comes with constraints on how it can receive inputs.
Understood. But is it non-compliant to set document.pictureInPictureElement if native PIP opens? That would at least mean that any JS code that relies on that being set to determine whether PIP is already open will also detect the native case. This might also be useful for the pseudo class. I can see why this might be a problem though; e.g. if there's no way for the browser to notify the page that PIP opened without the author provided trigger being used. Are there other problems with that I'm missing related to multiple PIP windows, etc.?
In any case, with your fix above, I think this decreases the importance of this issue even further.
Speaking of the pseudo class, can you give me some examples of how this might be used in practice? As I understand it, this will match on the element matching document.pictureInPictureElement; e.g. the video which is currently in PIP. I assume this might be used by the author to display some indicator that the video is in PIP, etc.? The reason I ask is that pseudo classes are often accompanied by some sort of state in DOM; e.g. :invalid matches invalid form fields, but invalid form fields also expose a semantic "invalid" state to accessibility. This is useful because these pseudo classes are often just styled using visual only indication (colour, icon, etc.). My hope is that authors would generally include some text indication with the PIP pseudo class as well, but if this isn't normally the case in the wild (i.e. if the indication is usually only visual in nature), we might need to figure out some other way to expose this to accessibility clients in future.
| Assignee | ||
Comment 39•5 months ago
|
||
(In reply to James Teh [:Jamie] from comment #38)
Understood. But is it non-compliant to set document.pictureInPictureElement if native PIP opens? That would at least mean that any JS code that relies on that being set to determine whether PIP is already open will also detect the native case. This might also be useful for the pseudo class. I can see why this might be a problem though; e.g. if there's no way for the browser to notify the page that PIP opened without the author provided trigger being used. Are there other problems with that I'm missing related to multiple PIP windows, etc.?
I actually checked Google chrome's "native" approach, and in fact they have the same behavior your request here, which makes me believe I should probably move to also do that.
Speaking of the pseudo class, can you give me some examples of how this might be used in practice? As I understand it, this will match on the element matching document.pictureInPictureElement; e.g. the video which is currently in PIP. I assume this might be used by the author to display some indicator that the video is in PIP, etc.? The reason I ask is that pseudo classes are often accompanied by some sort of state in DOM; e.g. :invalid matches invalid form fields, but invalid form fields also expose a semantic "invalid" state to accessibility. This is useful because these pseudo classes are often just styled using visual only indication (colour, icon, etc.). My hope is that authors would generally include some text indication with the PIP pseudo class as well, but if this isn't normally the case in the wild (i.e. if the indication is usually only visual in nature), we might need to figure out some other way to expose this to accessibility clients in future.
I wouldn't know exactly how the pseudo class is intended to be used to be honest beyond what you already mention. Given that I'm also addressing the PIP spec in parallel, do you have any suggestions that would be useful, or any potential spec-language (for other things, similar or not) that potentially could be cargo culted (and also implemented, of course)? Does there exist some standards defined way to notify a11y technology or something?
Comment 40•5 months ago
|
||
(In reply to Simon Farre [:sfarre] from comment #39)
(In reply to James Teh [:Jamie] from comment #38)
Speaking of the pseudo class, can you give me some examples of how this might be used in practice? As I understand it, this will match on the element matching document.pictureInPictureElement; e.g. the video which is currently in PIP. I assume this might be used by the author to display some indicator that the video is in PIP, etc.? The reason I ask is that pseudo classes are often accompanied by some sort of state in DOM; e.g. :invalid matches invalid form fields, but invalid form fields also expose a semantic "invalid" state to accessibility. This is useful because these pseudo classes are often just styled using visual only indication (colour, icon, etc.). My hope is that authors would generally include some text indication with the PIP pseudo class as well, but if this isn't normally the case in the wild (i.e. if the indication is usually only visual in nature), we might need to figure out some other way to expose this to accessibility clients in future.
I wouldn't know exactly how the pseudo class is intended to be used to be honest beyond what you already mention. Given that I'm also addressing the PIP spec in parallel, do you have any suggestions that would be useful, or any potential spec-language (for other things, similar or not) that potentially could be cargo culted (and also implemented, of course)? Does there exist some standards defined way to notify a11y technology or something?
Just for reference, the :picture-in-picture pseudo-class is defined here:
https://drafts.csswg.org/selectors/#pip-state
https://w3c.github.io/picture-in-picture/#css-pseudo-class
Sebastian
Comment 41•5 months ago
|
||
(In reply to Simon Farre [:sfarre] from comment #39)
I actually checked Google chrome's "native" approach, and in fact they have the same behavior your request here, which makes me believe I should probably move to also do that.
I do think that would have a better chance of behaving well when a user invokes using native PIP, but for some reason dismisses using a PIP API trigger.
I wouldn't know exactly how the pseudo class is intended to be used to be honest beyond what you already mention.
Fair enough. Can you clarify for me whether the pseudo class applies to the PIP element in the opener or the PIP window? I thought it was the PIP element in the opener, but the CSS definition made me question that.
Given that I'm also addressing the PIP spec in parallel, do you have any suggestions that would be useful, or any potential spec-language (for other things, similar or not) that potentially could be cargo culted (and also implemented, of course)? Does there exist some standards defined way to notify a11y technology or something?
There are standardised ways to expose certain states to accessibility; e.g. required, invalid, checked, pressed. There is not a standard way to expose that something is picture-in-picture. For now, the best thing we can probably do is note in the spec that authors should be aware that there is no implicit exposure of this state to accessibility tools, so any indication should expose text or there should be another indication somewhere nearby in the document.
FWIW, there is a new spec being spun up by the ARIA Working Group for CSS Accessibility API Mappings. I think that spec should mention this as well. However, it isn't far enough along yet for this to be included yet.
Comment 42•5 months ago
|
||
Testing with Chrome on MacOS and checking the a11y tree in devtools and the AX tree in Accessibility Inspector, I notice these things:
- When a video is PiP'd, visually the in-page video box has the text "Playing in picture-in-picture". This text is not exposed to a11y.
- When a page has a PiP, the window's title (AX "Top Level UIElement") includes "Video playing in picture-in-picture mode".
- When a video is PiP'd, the AX tree has Children for the play/pause button and the scrub slider, etc. Regardless of whether there is a
controlsattribute. I think this means screen reader users should be able to navigate to the controls in the PiP window as if they were children of the in-pagevideoelement.
If we want to standardize the third bullet point, https://w3c.github.io/html-aam/#el-video should refer to https://html.spec.whatwg.org/#expose-a-user-interface-to-the-user instead of "If the controls attribute is present", and then HTML can say that UAs should "expose a user interface to the user" if the video is PiP'd, regardless of the controls attribute.
Comment 43•5 months ago
|
||
(In reply to James Teh [:Jamie] from comment #41)
(In reply to Simon Farre [:sfarre] from comment #39)
I wouldn't know exactly how the pseudo class is intended to be used to be honest beyond what you already mention.
Fair enough. Can you clarify for me whether the pseudo class applies to the PIP element in the opener or the PIP window? I thought it was the PIP element in the opener, but the CSS definition made me question that.
It matches the element in the opener. The PiP window can't be styled, at the moment, as far as I know. I've created a request to clarify the CSS specification.
Sebastian
| Assignee | ||
Comment 44•5 months ago
|
||
(In reply to James Teh [:Jamie] from comment #41)
I do think that would have a better chance of behaving well when a user invokes using native PIP, but for some reason dismisses using a PIP API trigger.
Yes that is reasonable I think.
Fair enough. Can you clarify for me whether the pseudo class applies to the PIP element in the opener or the PIP window? I thought it was the PIP element in the opener, but the CSS definition made me question that.
Like :sebo says, it's for the original video element, not the one in the picture in picture window. As far as I understand the feature, the difference between document pip and media pip, is that media pip window is in control of the user agent, so, web content is not actually seeing anything or controlling anything there, in any direct way at least (meaning, there's no access to the <video> element in that window).
There are standardised ways to expose certain states to accessibility; e.g. required, invalid, checked, pressed. There is not a standard way to expose that something is picture-in-picture. For now, the best thing we can probably do is note in the spec that authors should be aware that there is no implicit exposure of this state to accessibility tools, so any indication should expose text or there should be another indication somewhere nearby in the document.
FWIW, there is a new spec being spun up by the ARIA Working Group for CSS Accessibility API Mappings. I think that spec should mention this as well. However, it isn't far enough along yet for this to be included yet.
Ok, given this and what :zcorpan says it means there can be room for improvement, spec wise.
| Assignee | ||
Comment 45•5 months ago
|
||
Ok, latest change makes "Native PIP" and "PIP API" be observed in the same way from web content. Entering PIP "natively" will now fire enter/leave events and this gets us webcompatible with chrome as well. It also means that that document.pictureInPictureElement is also non-null if native PIP was used (which also, is webcompatible with chrome).
Comment 46•5 months ago
|
||
(In reply to Simon Pieters [:zcorpan] from comment #42)
- When a video is PiP'd, visually the in-page video box has the text "Playing in picture-in-picture". This text is not exposed to a11y.
FWIW, Firefox exposes the text "This video is playing in Picture-in-Picture mode." to accessibility. I assume it's also visible too.
- When a video is PiP'd, the AX tree has Children for the play/pause button and the scrub slider, etc. Regardless of whether there is a
controlsattribute. I think this means screen reader users should be able to navigate to the controls in the PiP window as if they were children of the in-pagevideoelement.
This is also true in Firefox.
then HTML can say that UAs should "expose a user interface to the user" if the video is PiP'd, regardless of the
controlsattribute.
I do think that would be nice to standardise if there's no reason not to do so.
(In reply to Simon Farre [:sfarre] from comment #45)
Ok, latest change makes "Native PIP" and "PIP API" be observed in the same way from web content. Entering PIP "natively" will now fire enter/leave events and this gets us webcompatible with chrome as well. It also means that that
document.pictureInPictureElementis also non-null if native PIP was used (which also, is webcompatible with chrome).
Excellent. Thank you.
I'm happy with this overall and from a screen reader and keyboard perspective. Natalie on my team will be doing a few visual spot checks before we close out the accessibility review, but aside from any existing issues with the native video PIP window, I don't anticipate any further issues here.
| Assignee | ||
Comment 47•5 months ago
|
||
So one thing that was raised when discussing the PIP API feature with :pehrsons, is that, by having native PIP be web observable, web sites can effectively "block" our native PIP. I am not sure that's acceptable. The way they would do that, is effectively listen for enter picture in picture events, and in that case, exit immediately.
If we don't emit that event for native pip as a way to circumvent the first trivial block-approach, sites would still trivially block by periodically checking document.pictureInPictureElement and then exit that way.
cc'ing :mconley
Comment 48•5 months ago
|
||
My concerns are essentially:
- As a user, I don't want a site to care or know that I open native-pip.
- Even if we sync native-pip with api-pip for a single pip-window; opening multiple native-pip windows will mis-align with the api-pip model anyway (
document.pictureInPictureElement,document.exitPictureInPictureare enforcing at-most 1 pip per document). - As mentioned, exposing native-pip through api-pip events and attributes will allow sites to effectively block native-pip, which would be a regression.
I would have leaned towards the solution discussed in comment 38, comment 41, etc; to allow distinct native-pip and api-pip windows where api-pip doesn't learn of a native-pip window (by neither events nor attributes) until it requests pip for the same video element. The main concern seems to be that the page cannot collaborate with native-pip if it doesn't know of its state, so the UI might end up confusing. That is not different from today. Native-pip has been a differentiator for us, and it can still be with this solution. If we align with Chrome we lose (most of) that.
It would be good with some guidance from frontend here so we don't regress something we shouldn't.
Comment 49•5 months ago
|
||
Ah, that's a great point. If we can't do this for that reason, I think we can live with this from an accessibility perspective. If someone opens via native PIP (which I think will be more likely for keyboard/screen reader users given the generally poor accessibility of author-implemented video controls), it means the state won't be synchronised, but they can still close native PIP, so that's a minor quirk. I think the downside of a site potentially blocking native PIP outweighs the slightly quirky UX of native and API PIP being unsynchronised, for accessibility and otherwise.
| Assignee | ||
Comment 50•5 months ago
|
||
We could effectively also implement PIP API to throw an exception if Native PIP is engaged for a video element and PIP API tries to open PIP for that same element.
The PR that I have waiting to be landed (and the one I am implementing against) has these steps added to be able to deal with whatever platform/OS errors one may run into when attempting to open a PIP window & configuring it. It was specifically added to leave some room for potential differences between browsers. We could simply abort there and what ultimately is seen is an InvalidStateError exception being thrown.
If we believe that PIP API in any way can hamper our Native PIP or have a11y-related stuff be less good, I think we're perfectly free to reject in that scenario.
Comment 51•5 months ago
|
||
(In reply to Simon Farre [:sfarre] from comment #50)
We could effectively also implement PIP API to throw an exception if Native PIP is engaged for a video element and PIP API tries to open PIP for that same element.
...
If we believe that PIP API in any way can hamper our Native PIP or have a11y-related stuff be less good, I think we're perfectly free to reject in that scenario.
In terms of accessibility, I don't think this change helps. My (minor) concern was opening with native and then having API out of sync (because accessibility users might be more likely to open using native), but as noted above, we can't really have them in sync without the risk of the site blocking our native PIP. That said, I do appreciate your efforts to make this as accessible as possible.
| Assignee | ||
Comment 52•5 months ago
|
||
Updated•5 months ago
|
Updated•4 months ago
|
Updated•4 months ago
|
| Assignee | ||
Comment 53•4 months ago
|
||
Proof of concept on how to trigger PIP from a context menu.
| Assignee | ||
Comment 54•4 months ago
|
||
Proof of concept on how to open PIP from a media notification.
| Assignee | ||
Comment 55•4 months ago
|
||
Added test to verify that iframe attribute is honored.
| Assignee | ||
Comment 56•4 months ago
|
||
Tests the following scenario
Steps:
- video1 enters pip
- video2 requests pip
Observe that video1 has its event handlers fire before video2 sees its enter event. Observe that when video2 enter handler runs, document.pictureInPictureElement is null (i.e. not video1).
At the moment, this requires a change to the exit algorithm, because it always queues a task to fire the exit event in step 3, which would mean that it would always come after the enter event for video2.
Tested on Chrome & Gecko. Both pass.
| Assignee | ||
Comment 57•4 months ago
|
||
Previous Shadow DOM test were nowhere near enough covering. This tests
both current state of spec, but also
https://github.com/w3c/picture-in-picture/issues/248.
| Assignee | ||
Comment 58•4 months ago
|
||
https://w3c.github.io/picture-in-picture/#exit-picture-in-picture-algorithm
Explains "As one of the unloading document cleanup steps, run the exit
Picture-in-Picture algorithm.".
This test verifies that browsers implement this.
| Assignee | ||
Comment 59•3 months ago
|
||
Updated•3 months ago
|
Updated•3 months ago
|
Comment 60•3 months ago
|
||
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/60166 for changes under testing/web-platform/tests
Comment 62•3 months ago
|
||
Comment 63•3 months ago
|
||
Reverted this because it was causing multiple failures.
| Assignee | ||
Comment 64•3 months ago
|
||
Fixed issues and waiting for try run results at https://treeherder.mozilla.org/jobs?repo=try&revision=bcb013f13cc4d2d086f188ac8031c60fdcad9a9d before landing again.
Comment 65•3 months ago
|
||
Upstream PR was closed without merging
Comment 67•3 months ago
|
||
Comment 68•3 months ago
|
||
Reverted this because it was causing multiple failures.
| Assignee | ||
Comment 69•3 months ago
|
||
- Had forgotten an interface test
- Apparently macOS has WebDriver issues where trusted clicks are not going through?
Try run: https://treeherder.mozilla.org/jobs?repo=try&landoInstance=lando-prod-2025&landoCommitID=50287
Upstream PR was closed without merging
Comment 71•3 months ago
|
||
Comment 72•3 months ago
|
||
Comment 73•3 months ago
|
||
Revert for causing dt failures on browser_webconsole_object_inspector_entries.js.
| Assignee | ||
Comment 74•3 months ago
•
|
||
That seems like an intermittent failure and not caused by this landing?
There are other failures related to WPT in that though.
Edit: Found the invocation UPDATE_SNAPSHOT=true ./mach test devtools/client/webconsole/test/browser/browser_webconsole_object_inspector_entries.js --headless to solve it.
| Assignee | ||
Comment 75•3 months ago
|
||
| Assignee | ||
Comment 76•3 months ago
|
||
Comment 77•3 months ago
|
||
Upstream PR was closed without merging
Comment 79•3 months ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/e515978561d4
https://hg.mozilla.org/mozilla-central/rev/abc2d5db3571
https://hg.mozilla.org/mozilla-central/rev/54f426721981
https://hg.mozilla.org/mozilla-central/rev/9428a6ee5ec6
https://hg.mozilla.org/mozilla-central/rev/5a7730602065
https://hg.mozilla.org/mozilla-central/rev/25bfb6334637
https://hg.mozilla.org/mozilla-central/rev/ec56a068b2fe
https://hg.mozilla.org/mozilla-central/rev/361c22c773cd
https://hg.mozilla.org/mozilla-central/rev/6cb0b7fb6d8b
Comment 80•3 months ago
|
||
Comment 81•3 months ago
|
||
Reverted this because it was causing Picture-in-Picture related wpt failures.
Upstream PR merged by moz-wptsync-bot
| Assignee | ||
Comment 83•3 months ago
|
||
It is clear that macOS has some defect with the tests. Will be disabling the tests entirely for the failing platform due to its seemingly intermittent failure (see try runs that don't contain the failures the build had).
Comment 84•3 months ago
|
||
backout merged to central: https://hg.mozilla.org/mozilla-central/rev/7071fdeb0c25
Comment 85•3 months ago
|
||
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/60273 for changes under testing/web-platform/tests
Comment 87•3 months ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/c65f3a1e9edb
https://hg.mozilla.org/mozilla-central/rev/030812a8714f
https://hg.mozilla.org/mozilla-central/rev/46886bcf86e8
https://hg.mozilla.org/mozilla-central/rev/c9a57addabe6
https://hg.mozilla.org/mozilla-central/rev/306d09e4126e
https://hg.mozilla.org/mozilla-central/rev/560c147d61e8
https://hg.mozilla.org/mozilla-central/rev/51b69798195c
https://hg.mozilla.org/mozilla-central/rev/5c20d9f55f50
https://hg.mozilla.org/mozilla-central/rev/545b5ff878db
https://hg.mozilla.org/mozilla-central/rev/1c60e4500c8f
Upstream PR merged by moz-wptsync-bot
Comment 89•3 months ago
|
||
Simon, is that something we should include in the Web platform section of our general release notes?
https://wiki.mozilla.org/Release_Management/Release_Notes_Nomination
Updated•3 months ago
|
| Assignee | ||
Comment 90•3 months ago
|
||
Release Note Request
[Why is this notable]: Release of PIP API support.
[Affects Firefox for Android]: No, Android needs a PIP implementation before deciding on whether it should expose that implementation to the PIP API.
[Suggested wording]:
Picture In Picture API exposes a way for web developers to make use of user agent Picture-In-Picture functionality.
[Links (documentation, blog post, etc)]:
MDN: https://developer.mozilla.org/en-US/docs/Web/API/Picture-in-Picture_API
Comment 91•3 months ago
|
||
Thanks, note added to our 153 nightly release notes in the Web Platform section with this wording:
The Picture In Picture API exposes a way for web developers to make use of user agent Picture-In-Picture functionality.
I am keeping the relnote-firefox? flag set until we include this note in our final 153 release notes, thanks.
Updated•3 months ago
|
Updated•3 months ago
|
Comment 92•3 months ago
|
||
I am keeping the
relnote-firefox?flag set until we include this note in our final 153 release notes, thanks.
(Change of internal process)
Updated•2 months ago
|
Comment 93•2 months ago
|
||
FF153 MDN work for this can be tracked in https://github.com/mdn/content/issues/44464 (Done, in review)
Comment 94•2 months ago
|
||
Bug was resolved, but the web-feature picture-in-picture (definition file) is not yet marked as supported in Firefox.
Feature bugs are usually automatically closed once the corresponding web-features are marked as supported; this typically happens after the feature reaches release.
Description
•