-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Meta] Guidance for HTMLMediaElement, HTMLAudioElement, HTMLVideoElement behaviors during remoting #41
Comments
I tagged this [Meta] since other issues might be forked off from it. |
@foolip FYI |
Discussed at the F2F: PROPOSED RESOLUTION: Extend the requirements doc as a start, best effort for UAs to reflect remote state locally otherwise. |
So let's just list all of the things that one can do:
Which of these might be problematic on the remote side? Do we expect to have implementations where the volume can't be changed at all? Where changing the enabled audio track doesn't work? The most troubling of these to me is actually text tracks. WebVTT is built on other web technologies, and if the remote isn't also a web engine, then it would have to be an independent implementation of WebVTT, and it's somewhat likely that just won't be done. @zcorpan |
Being able to implement WebVTT without a Web engine was a design goal originally I believe, and such implementations exist, e.g. Submerge. |
@mfoltzgoogle @avayvod, is Chromecast the only device planned for the implementation in Chrome, and would any of the things in my list be problematic? |
We plan on supporting Chromecast but may support other endpoints in the future.
I believe Cast supports most of those features through their current Receiver SDK including text track support. However I am not in the loop on current implementation status (i.e., are all features of WebVTT supported), I would have to loop in more folks on the Cast and media stack teams regarding WebVTT and fastSeek. |
Can you also check about audio track support? The |
@foolip I think it's not supported, I couldn't find any info in the Cast API reference at least. Tracks are only mentioned in the context of WebVTT for closed captions. |
This was partially addressed by #49 (w.r.t. local/remote state transitions I think), we could be more explicit about what must and should be supported. |
In the spirit of "let's list what one can do". This is just the main
On error, remote playback is likely to disconnect. MUST be set when
Setting |src| MUST try to load the corresponding media resource on the remote playback device.
MAY support. Ignored if not supported.
MAY support. Reflected to the best knowledge of the user agent. Otherwise is always in HAVE_FUTURE_DATA.
MAY support.
MAY support if the remote playback mode provides this info. Otherwise pretend all is buffered or have empty ranges?
MUST load the src on the remote playback device. Can result in an error and disconnect.
MUST return
MUST return HAVE_ENOUGH_DATA, implemented to the best knowledge of the user agent.
MUST be implemented.
MUST be implemented.
MAY be implemented.
MUST be implemented.
MAY be implemented. Returns NaN if not.
MUST be implemented.
MAY support. By default, return 1.0 and ignore setters.
MAY support. By default, return 1.0 and ignore setters. `readonly attribute TimeRanges played; MAY support.
MAY support.
MUST support.
MUST support.
MUST support.
MUST support.
MUST support.
MUST support. Agnostic to remote state.
MAY support.
MAY support.
MAY support.
MUST support. Return the first track if multiple tracks are not supported.
MUST support. Return the first track if multiple tracks are not supported.
MUST support. Return the first track if multiple tracks are not supported.
MAY support. Returns |
Some other HTMLMediaElement extensions (EME, MSE, Audio Sinks):
MUST support. Invokation of
MAY support. By default returns an empty string.
MAY support. Rejects with
MAY support. Return
MAY support. Reject with
MAY support. Otherwise, no-op.
MAY support. Otherwise, no-op.
MAY support. Otherwise, reject with |
MUST support. Depends on representation (poster or just a black 300x150 rectangle).
MUST support. Depends on representation (poster or just a black 300x150 rectangle).
MUST support. Fallback to
MUST support. Fallback to
MUST support.
MUST support. Returns true. Works for the element representation not the actual video played remotely. |
And last but not least, the events that can fire. The rule of thumb is whether the corresponding attributes like
MAY be supported.
MAY be supported.
MAY be supported.
MAY be supported.
MUST be supported.
MAY be supported.
MAY be supported.
MAY be supported.
MAY be supported.
MAY be supported.
MUST be supported.
MAY be supported.
MUST be supported.
MUST be supported.
MUST be supported.
MUST be implemented.
MUST be implemented.
MUST be implemented.
MUST be implemented.
MAY be implemented.
MAY be implemented.
MAY be implemented. |
|
F2F feedback:
|
TBH, the spec for |
Remote Playback changes how |
F2F: group the features into what MUST work but may change the behavior, what MAY not work and how it behaves if it doesn't; only list these features in the spec assuming the rest work without a change. |
F2F: state transition algorithm might be the trickiest ones to change (remote playback device might not provide as many states as HTMLMediaElement exposes to the page). |
For reference, see minutes of the discussion at TPAC |
The update clarifies that the API surface is considered stable and remaining issues minor except issue w3c#41. The SOTD also calls for wide review of the document.
@mfoltzgoogle, the TPAC meeting minutes confirm that was the proposed plan: https://www.w3.org/2016/09/23-webscreens-minutes.html#item02 This issue is a blocker for the CR publication tracked in #73 and based on my assessment this should be resolved to be able to identify possible "at risk" features. The process doc tells us such "at risk" features "may be removed before advancement to Proposed Recommendation without a requirement to publish a new Candidate Recommendation." so in practice we can avoid some back-and-forth movement if we identify such features upfront. All - Contributions welcome! |
IIRC, there were concerns about MUST for basic operations like seeking during the meeting as some remote playback devices might not be able to implement seeking and HTMLMediaElement doesn't really mandate it. Could we avoid listing every feature of the media element by following the Presentation API example w/r/t the Web APIs available on the receiver in this note:
? |
I'm not sure that's relevant; that note is referring to Web APIs on the presentation receiver, not the controller. In my understanding of the Remote Playback API the controller is responsible for sending (or not sending) commands to the remote playback device. Of course it's possible that the device is implemented using HTML but it's not a requirement. |
I meant just noting something like below could be sufficient: "Given the capabilities of the remote playback device, some HTMLMediaElement APIs will not work by design or will be obsolete. In these case they MUST fallback to the same behavior as if the local playback device doesn't support these APIs (e.g. encryption, captions, multiple tracks, and so on)." To be honest, the remote playback device capabilities might not be always a subset of those of the local playback device. The cases when something is not working locally but can work remotely might be worth looking into and adding a note about too. |
I think that is okay, but one concern raised earlier is that there may not be specified behavior for mandatory features not implemented by the playback device. As you say this is also an issue for both local and remote playback, so the fix may be to address this in HTML5, but practically speaking I could see the potential for different interpretations. For example, if muting is not supported, one UA may allow the attribute to be set but not propagate the command to the remote device, while another UA may ignore attempts to set the attribute. In either case content with custom controls may not correctly reflect the remote state depending on whether they recheck the attribute after setting and whether it accurately reflects the remote state. Maybe the note could state that the properties of the media element should reflect as closely as possible the remote playback state, even if not all features are supported by the remote playback device; and events should not be fired unless they reflect actual changes to the remote playback state. Second, one purpose of the Presentation API note was to give specific guidance as to what APIs are not expected to work on the presentation. Can the same be done for remote playback - I think you started a list above, can it be made more explicit? I would be in favor of two separate notes as I think they convey different information. |
Hearing no further comments, I'd ask the editors @avayvod @mounirlamouri to implement the synthesis of the latest proposals. Feel free to use your editorial freedom to mould the text to fit in the spec, but roughly:
Listing MUSTs and MAYs is a start, and optimally we'd add normative language to define expected behaviour in the case of "not supported" for each MAY feature, as to allow web developers feature detect such cases in an interoperable manner across implementations. I opened #88 to discuss the case where the remote playback device capabilities might not always be a subset of those of the local playback device. |
@avayvod @mounirlamouri @mfoltzgoogle, any concerns with the proposal I outlined above? If none, could you please address this remaining issue so we could get to zarro boogs for CR tracked in #73. If the proposal is lacking, I'd be happy if you could synthesize an improved proposal for review. |
I'm a bit concerned about the lack of feedback here. Are folks already out of office? |
I was traveling for the past few days. Happy to have a look but I think @avayvod has more context than me on this issue as he looked into it in the past. |
I consider the PR I uploaded to be the minimum needed to close this issue. Regarding other aspects: I'm not sure if I have a good grasp of what "X, Y, and Z" MUST be implemented by all remote playback devices. That would require understanding better the constraints of current and future implementations, and sounds like specifying a remote playback device itself, which may not be in scope of this spec. Obviously devices that don't support basic commands like pause, mute, etc. are very bad implementations, but not confident enough to specify what is "bad" at this point. Let me think about it, but not sure it should block going to CR. As far as feature detection of supported capabilities of the remote device, I could see this being very useful, for example for a player library that wants to support remote playback on multiple devices with different capabilities. My thinking is adding capability detection would a useful extension to the Media Capabilities API based on implementation experience and developer feedback. Again not blocking CR. |
@avayvod Are you satisfied with the current language around remote playback device capabilities, or do you think more is needed at this point? Basically, we are saying that the browser shouldn't lie about the state of remote playback, but not mandating that the remote playback device implement specific playback features. |
The note is good. I still think that the spec could be clearer about what happens or does not happen during transition. In particular, what happens to the That may not warrant more normative text though. Perhaps it all fits within a Note or example that could explain in substance:
|
I suppose all of these are possible; is this question in reference to a specific remote playback implementation?
I believe this is implied by the note - since playback continues on the remote playback device, there is no Web-visible transition to paused. I can add a sentence to the existing note to make this explicit.
I'm not sure about removing tracks if the remote playback device does not support them. They are still available in the underlying media source, it's just that they may not be playable in the current context. |
No. I'm wondering what needs to be made explicit in the spec to guarantee interoperability between implementations. Taking a concrete example, let's say that my app plays a video, has a pointer to a How do I detect that the Now, I may be creating issues where they don't exist, and we may want to get more implementation and usage experience before we make things more explicit in the spec, so as to understand what can concretely trigger interoperability issues. In other words, current text is probably good enough for now, we can add more notes afterwards as needed. |
I agree there are potential issues with track compatibility, but I don't think we yet have enough information to resolve them concretely. It depends on developer feedback and implementation experience. I can provide some insight into the latter based on what Chrome has shipped, but not sure when I can get to it. If the concern is interoperability, then there's a fairly small set of implementations we would be extrapolating future interoperability from. Maybe that's the best we can do at this time. |
I'm pretty happy with the added note, thanks @mfoltzgoogle! I amended it a bit in #97. @tidoust, do you think it'd be appropriate to advance to CR with the current text if we'd clarify the current status in https://w3c.github.io/remote-playback/#status-of-this-document as follows (feel free to amend):
|
Update SOTD to remove references to #41.
I believe that's fine, @anssiko. The text sets expectations quite nicely, that's good! |
From https://www.w3.org/2017/11/06-webscreens-minutes.html#x03: ACTION: @mfoltzgoogle to add normative language to the spec around local playback state to address issue #41 |
This issue was noted in the Candidate Recommendation as the only remaining substantial open issue. Now this issue has been addressed by e1da486. Thanks @mfoltzgoogle for your contribution. As noted in the spec, we are seeking further developer feedback and implementation experience to identify any interoperability issues around the features discussed in #41, and now in particular for the newly updated Media commands and media playback state section. |
In remoting mode (i.e. state ==
connected
) any side effects on the media element, for example mutations to properties, invocations of methods, or detachment from the DOM may (or may not) affect remote playback.Because the behavior of the remote playback device seems to be out of scope for this spec, there may not be much to say in the normative sections of the spec.
However, in my opinion it would be a better spec to at least say something in regards to what should happen. I can see these behaviors falling into three categories:
The challenge will be in cases where the observable state of the element might be affected by implementation choices. For example, when playing back on a remote device that does not support changing the playback volume, how should the element behave when its
volume
attribute is set?The text was updated successfully, but these errors were encountered: