-
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
Player reset() function causes text track issues #5140
Comments
Having reset remove text tracks sounds like the correct behavior. Would you be interested in making a PR for that? I'd be happy to help you figure out what needs to happen. |
Sure, I can pick this up early next week. From studying the source I think the text track backup/restore code is only used as part of the unloadTech and loadTech functions so this should be mostly a case of deleting code. |
Maybe, though, we do want to make sure that text tracks are kept around during tech switches outside of |
There is a bigger problem regarding hls, reset and text tracks. |
Description
The
reset()
function in the Player class appears to have seemingly intentional but undesired side effects. As part of the unloading and reloading of the tech plugin the unloadTech, loadTech functions take a JSON snapshot of the associated text tracks prior to the reset and restores them post reset. Unfortunately when using video.js with plugins like DASH and HLS which usually manage their own text tracks they are removing them during the tech plugin dispose stage and having them subsequently restored afterwards without the plugin itself being aware of this.I have reproduced this in a simplified test case here, simply play the video and press "Click me". You will see an accumulation of subtitle tracks in the subtitle selector.
In the case of videojs-contrib-dash you may need to pull this change in as well: videojs/videojs-contrib-dash#251
Steps to reproduce
Explain in detail the exact steps necessary to reproduce the issue.
Results
Expected
The expected outcome is that only the subtitle tracks associated with the new video should be displayed.
Actual
The subtitle tracks from the original video and additionally the new video will both be displayed.
Error output
No errors seen, this appears to be intentional behaviour.
Additional Information
Please include any additional information necessary here. Including the following:
versions
videojs
6.8
browsers
Tested with DASH on Chrome and native HLS on Safari
OSes
Test with Chrome on Windows 10 and Safari on OSX
plugins
videojs-contrib-dash (for DASH)
None for HLS
The text was updated successfully, but these errors were encountered: