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

Text Track doesn't get removed properly? #2799

Closed
chemoish opened this issue Nov 10, 2015 · 3 comments
Closed

Text Track doesn't get removed properly? #2799

chemoish opened this issue Nov 10, 2015 · 3 comments

Comments

@chemoish
Copy link
Member

removeTrack_(rtrack) can oddly get called with either an HTMLTrackElement or a {track: track}—neither of which will be removed from
https://github.com/videojs/video.js/blob/master/src/js/tracks/text-track-list.js#L91, but instead it looks like its going to remove the last track in the loop?


Html5 tech will eventually fire a removeTrack_(e.track). Which looks like it will remove the last track found in the previous loop.

this.remoteTextTracks().addTrack_(track.track);

https://github.com/videojs/video.js/blob/master/src/js/tech/html5.js#L754

this.textTracks().addTrack_(e.track);

https://github.com/videojs/video.js/blob/master/src/js/tech/html5.js#L275

this.remoteTextTracks().removeTrack_(track);

https://github.com/videojs/video.js/blob/master/src/js/tech/html5.js#L772

this.textTracks().removeTrack_(e.track);

https://github.com/videojs/video.js/blob/master/src/js/tech/html5.js#L279

if (this.featuresNativeTextTracks) {
  this.handleTextTrackChange_ = Fn.bind(this, this.handleTextTrackChange);
  this.handleTextTrackAdd_ = Fn.bind(this, this.handleTextTrackAdd);
  this.handleTextTrackRemove_ = Fn.bind(this, this.handleTextTrackRemove);
  this.proxyNativeTextTracks_();
}

https://github.com/videojs/video.js/blob/master/src/js/tech/html5.js#L70

@gkatsev
Copy link
Member

gkatsev commented Nov 10, 2015

Don't remember the specifics but I think it's probably doing a slightly better job of removing things than you think but also probably not as good of a job as it should.
As for why removeTrack_ takes either an HTMLTrackElement or {track: track} is because {track: track} is sort of our emulated HTMLTrackElement until we get a real emulated HTMLTrackElement.

@chemoish
Copy link
Member Author

probably doing a slightly better job of removing things than you think

Agreed, lol, hence the ❓.

@gkatsev
Copy link
Member

gkatsev commented Jul 6, 2017

There's been a lot of work around this. I hope we do a good job now.
I'm going to close this issue until someone raises it again.

@gkatsev gkatsev closed this as completed Jul 6, 2017
@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 26, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants