-
Notifications
You must be signed in to change notification settings - Fork 19
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
IMSC subtitle/caption rendering appears to need(?) VTTCue class which is not in our spec #211
Comments
But that code snippet suggests that VTTCue class is optional as long as TextTrackCue is supported (since its an OR). Therefore it seems fine to omit VTTCue from WMAS as long as TextTrackCue is included? |
|
The Cue variable is used in two places - to provide the constructor for a TextTrackCue or a VTTCue.
or
To quote MDN on TextTrackCue ...
Chrome prevents construction of TextTrackCue instances since 2014. https://www.chromestatus.com/feature/5818821692620800
|
Looking into that line of code further, I don't think
|
You're far more familiar with the types of magic that can be achieved with JavaScript but and this is probably being far too naive but ... If the 'time marches on' algorithm is to be used for subtitle / caption timing then somewhere, something has to be created that is close enough to TextTrackCue that it can successfully be passed to the TextTrack.addCue method. |
I tested in Internet Explorer and Edge on Windows, and both browsers do allow for Cue = window.VTTCue || window.TextTrackCue; handles creating a reference to a cue that works across all major browsers. Also FYI, the Chromium-based Edge that was released today does support
One of those constructors will have to be called to create it (depending on which the browser supports)
Although ES6 added the ability to extend a class, there still is no such thing as an abstract class or an interface in JavaScript, and |
Does our spec then need to require that implementations must support at least one of VTTCue or the constructor for TextTrackCue? |
This would move the Web Media API Snapshot from being "comprised of references to existing specifications in W3C and other specification groups" towards specifying functionality itself. |
As an aside, the proposed DataCue API offers a solution for arbitrary structured timed metadata and timed events, although this is a longer term solution. Input from this community is welcome to help move the proposal forward. |
I wouldn't quite put it that way. It would be a conditional reference to part of the WebVTT spec. |
That would be a reasonable approach. I was responding more to the specifying a |
I apologise for giving that impression but was not what I had in mind. If implementations support a TextTrackCue constructor then there may be something we can reference. |
Sorry, I wasn't being clear earlier. My assumption is that the only reference for a |
At the CTA Fall Forum, there was consensus that we will explicitly agree to not include these details in the Web Media API spec. |
Please can you share some of the reasons for this? |
Yes, sorry for not adding these details originally. The fact that player libraries today decide between In 2020 this would be an issue worth revisiting as we see how cues play out over the next year in W3C & WHATWG standards and in browser implementations. |
Unfortunately this doesn't address the issue. |
Reopening... My apologies, when we originally discussed this we said it may be too complicated to try to integrate into our spec and we should explore options and either consciously include something or consciously decide to not include something related to this... that seems to have shifted to definitely including something, which I'm happy to discuss. So that we can decide on what that should be, I have captured what I believe to be the current state:
Given the above, my first thought is that the User Agent Integration Specifications section of our spec would be the correct place to address this, as it is not based on a spec. So we'd end up with something along the lines of:
@jpiesing and others, what are your thoughts on the above? |
@JohnRiv User agent integration was originally for things that someone porting a browser would need to worry about. This is nothing to do with porting the browser - once the choice of browser has been made, the integrator effectively has no choice of which constructor will be supported in that device. There are no good solutions to this. I would be happy with something under "Media specifications" a little like this ... Devices MUST support a mechanism to construct instances of TextTrackCue or an interface that inherits from it. This would avoid problematic normative references :) |
I think @jpiesing 's language is more accurate, but would another bullet under "Exceptions" for HTML be a better place for it? |
Thanks for the background & suggested text @jpiesing. Better stated than my first attempt :-) I agree with @johnluther that associating it with HTML would be preferred over Media Specifications because:
If we put it in the HTML section of Core web specifications, I'd lean towards it being an additional note rather than an exception though, since every "exception" instance in our spec is to call out a feature that is not yet widely supported, and in our case TextTrackCue is supported across the board, just the UA implementations differ. I could also see a case where it would make sense as a bullet under Other web specifications since we already mention other features required as part of the HTML specification there. Based on @jpiesing's text & the above, here are a couple options:
There may be some additional background around that Other web specifications section that I'm not familiar with, so please feel free to educate me. Right now I'm leaning towards the first option but I'd be happy with either or up for another. |
@JohnRiv I'm not sure about putting "MUST" in a note. Some places see that as contradictory or even exclude it. |
Good to know. We could then change option 1 to be either:
Or just go with option 2 |
I vote for SHOULD. |
I think it's important that it's MUST or must so would prefer to remove "Note:". |
I could go either way here... since all UAs do either construct instances of TextTrackCue or an interface that inherits from it, it seems OK to use a "MUST" here... I'm also starting to wonder if our other Note without an all-caps MUST is an issue... how about we address both and update the full HTML bullet points to the following:
|
It's been a few days since the last comment and we need to wrap this up next week so, I'm adding the "Call for Consensus" label to this. If there are no objections the copy in my previous comment directly above will be used for the 2019 update. |
Fine by me. |
* Added link to Web browsers and other interactive user agents Took some web searching to find that conformance class, so I figured a link to it would be helpful for others * Added info about TextTrackCue and removed "Note" from HTML "MUST" comments. This addresses #211
Closed via #222 |
The Web Media API spec doesn't include WebVTT - a situation I wholly agree with.
But ...
When researching how subtitle rendering works when video & audio is presented via MSE, I was referred to this file from DASH.js.
https://github.com/Dash-Industry-Forum/dash.js/blob/master/src/streaming/text/TextTracks.js
In this code, the IMSC subtitles/captions are parsed and rendered in JS but the timing is all done through HTML5 by creating *Cue objects using the constructor, adding them to TextTracks and relying on the time marches on algorithm to fire onenter and onexit events as appropriate.
The problem is that the constructor for TextTrackCue is not intended to be called. You can find various references to this via Google. DASH.js includes the following logic for this;
If the reality is that the timing aspect of rendering IMSC subtitles requires the VTTCue class then we should consider including that class in the Web Media API spec.
The text was updated successfully, but these errors were encountered: