-
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
fix: prevent dispose error and text track duplicate listeners #6984
Conversation
@@ -241,12 +248,10 @@ class TextTrack extends Track { | |||
// On-demand load. | |||
loadTrack(this.src, this); | |||
} | |||
this.tech_.off('timeupdate', timeupdateHandler); |
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.
Should we also return early in this function if the mode is the same as the current mode? Is there a reason we trigger modechange
when a track goes from disabled
to disabled
again?
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.
Making this change makes sense. I think we'd want to see whether doing that causes any issues for the captions menu, though, I doubt it.
Is there a specific timing for adding the throttling? I've tried it and cannot reproduce. I think this hasn't really come up previously because the menu itself prevents changing the mode to the same item already. It's only an issue programmatically. |
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.
Changes here make sense, though, I wasn't able to reproduce.
src/js/tracks/text-track.js
Outdated
this.tech_.off('dispose', disposeHandler); | ||
}; | ||
|
||
this.tech_.on('dispose', disposeHandler); |
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.
alternatively, use .one here?
5ce1af2
to
e6dda7c
Compare
Description
Noticed an error when disposing a player with text tracks on and was able to replicate it on our standard simple demo by turning on throttling to 6x in chrome and disposing the player with the default text track on. I also noticed that we do two other things:
showing
more then once in a text track we add another update handler, without a limit to how many we can add.