-
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
Check for text track changes that occurred before tech was listening #2835
Conversation
Tests passed. Automated cross-browser testing via Sauce Labs and Travis CI shows that the JavaScript changes in this pull request are: CONFIRMED Commit: 8a3a97ecc936e34ca052570e4efb14ea1d8e1e45 (Please note that this is a fully automated comment.) |
'we didn\'t have an extra text tracks update for non native text tracks'); | ||
|
||
Player.prototype.textTracks = origTextTracks; | ||
Tech.prototype['featuresNativeTextTracks'] = false; |
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.
What if the original value was true?
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.
Good call. Will store the original value and reset it here.
8a3a97e
to
dc174d8
Compare
Tests passed. Automated cross-browser testing via Sauce Labs and Travis CI shows that the JavaScript changes in this pull request are: CONFIRMED Commit: dc174d890bef253d042e086aa8add0986afac9d9 (Please note that this is a fully automated comment.) |
LGTM |
@@ -322,6 +322,7 @@ class Tech extends Component { | |||
} | |||
|
|||
let textTracksChanges = Fn.bind(this, function() { | |||
let tracks = this.textTracks(); |
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.
Is this necessary? Seems like this function could not run unless tracks
was already defined at the assignment in emulateTextTracks
above.
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.
It isn't strictly necessary but it makes testing this significantly easier.
dc174d8
to
b02fdef
Compare
Tests passed. Automated cross-browser testing via Sauce Labs and Travis CI shows that the JavaScript changes in this pull request are: CONFIRMED Commit: b02fdef (Please note that this is a fully automated comment.) |
Sweet, that test looks a lot nicer now too. |
LGTM |
Lgtm! |
If any code sets a track mode during player setup (e.g.,
track.mode = 'showing'
) for non native text tracks, there is a race case where the player may not be listening for changes on the track. For instance:The caption settings will show the captions as on for the track, but the captions will not show up on the video unless a user switches to fullscreen or changes the caption settings (both will update display appropriately).
This change ensures that before videojs starts listening to change events on tracks, it gets any changes that may have happened between then and the start of setup.