-
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
Allow viewing in-band metadata tracks from shimmed texttracklist #2272
Conversation
@@ -61,6 +61,9 @@ vjs.Html5 = vjs.MediaTechController.extend({ | |||
|
|||
if (this['featuresNativeTextTracks']) { | |||
this.on('loadstart', vjs.bind(this, this.hideCaptions)); | |||
} else { | |||
// allow us to view the in-band metadata tracks from our shimmed TextTrackList | |||
this.on('loadedmetadata', vjs.bind(this, this.addInBandMetadataTracks)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure that inband tracks will show up by loadedmetadata
. Did you find this in the spec or discover it experimentally?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Experimentally.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Though, this reminds me. I probably need to remove the old ones from the list on source change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
An in-band metadata track might not be evident until a decent amount of buffering has occurred. If there were a way to make the track registration a bit more robust for that case, that would be great.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll take a look whether the addtrack
event fires for it. Might listen to both or something.
This should handle multiple in-band metadata tracks better and should be able to clear them out properly between video loads. |
track, | ||
i = 0; | ||
|
||
for (i = 0; i < tracks.length; i++) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This shouldn't be necessary unless addtrack
fired twice, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I'm not certain it'll be necessarily useful. Even if you re-apply the same video you get a new track.
This was kind of left-over from when I had the removal of tracks in the same method as additions and so far I left it for "extra security" but I'm not certain it actually buys us much.
We should have a test for this. |
I'll try and come up with some tests. |
This will become obsolete as part of the work to fix #2367. I'm using this general framework for that fix anyway. Given that we've decided not to include it in stable, I'm going to close this. |
Fixed #2266.