Skip to content
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

Expose the fallback language in the API #258 #16

Open
r12a opened this issue Mar 16, 2016 · 0 comments

Comments

@r12a
Copy link
Contributor

commented Mar 16, 2016

§ w3c/webvtt#258

Raised by:Richard Ishida
Opened on:2015-11-16

In #257 I made it possible for the "List of WebVTT Node Objects" object to have an "applicable language", but this can't be exposed in getCueAsHTML() since that object maps to a DocumentFragment, which can't have a lang attribute.

One way to make this work is to change from DocumentFragment to an HTML div or span element, and set lang on it if is has an "applicable language".

Existing scripts that just insert whatever comes out of getCueAsHTML() to the document should continue to work, it would just get an extra element. I suppose span is a bit more versatile than div because it is allowed in more places (e.g. in a p element). OTOH, just dumping all cues and have them be separated from each other by default could be nice.

An alternative could be to have the fallback language be a property of TextTrack, and have JS be responsible for setting a lang attribute on a container element in which it inserts cues with getCueAsHTML().

@r12a r12a added webvtt track labels Mar 16, 2016
@r12a r12a modified the milestone: track Mar 17, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.