-
Notifications
You must be signed in to change notification settings - Fork 7.5k
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
Add a 'loadeddata' event on TextTracks, which fixes issue #1864. #1949
Conversation
Awesome, thanks. I'll take a look over the weekend. |
I'm not sure I like that we're adding a |
Oh, right, now I'm looking more closely at the WhatWG spec, in section sourcing-out-of-band-text-tracks, it mentions:
I don't see the TextTrack element has a text-track-readiness-state, but you're right, really we should return an actual "track" object and fire a "load" event on that. I was working from the HTML5 spec, and this seemed reasonable! |
The Tracks that videojs currently has are actual TextTracks as opposed to the HTMLTrackElement that you linked. I thought that only the former would be sufficient, but seems like even though it gives us 95% of what we need, the other 5% are pretty important too. |
Once we have the HTMLTrackElement shim thing, we probably would still need this event but it just shouldn't be officially exported (like |
I see that the VideoJS TextTracks are not an HTML TrackElement. It's the process of calling addRemoteTrack, calling createTrackHelper, and taking src as an option (which I don't see documented?) which blurs the line between the two. There's the XHR call, and we need to know when that's completed (I'm looking to use it elsewhere). Otherwise, I'd XHR it myself, but then I could only pass it to TextTracks by parsing it myself and feeding it in as Cues, right? |
@OwenEdwards Did you ever encounter race conditions with chapters because of this timeout? |
I think that #2804 incorporates and supersedes this one. Closing. |
…in videojs#1949. - Refactor `parseCue` to be managed by `loadTrack` so that `onflush` event can trigger parse complete (emulate load) - Increased superficial load delay, to something more reliable, but it shouldn't be a problem if vtt.js is embedded in dist.
Propose this useful feature for Text Track handling in general, which also fixes issue #1864.
Note that this needs broader testing, and a specific unit test for the fix; @gkatsev, you seem to be the expert on this? :-)