-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Question with loading a different m3u8 source will make the 608 caption button disappear #6606
Comments
If you reuse the same video element, then existing text tracks will be reused for the same language. This is because there is no method to remove a track.
This sounds like an issue with videojs-hlsjs-plugin. Replacing the video element when loading a new src may be one way to work around it. |
It looks like even when hls.js reuses a TextTrack it tries to dispatch "addTrack" from the video element to address this issue ( hls.js/src/controller/timeline-controller.ts Lines 225 to 243 in 22481fb
hls.js/src/utils/texttrack-utils.ts Lines 3 to 13 in 22481fb
|
What do you want to do with Hls.js?
We are using hls.js (1.4.X) together with VideoJS (7.18.X) for video playback, and the 2 is based on https://github.com/streamroot/videojs-hlsjs-plugin.
The question is about dynamically switch source via code, causing issues when sources have 608/708 closed captions.
Assume there are 2 sources available, source 1 and source 2. When the player initially loaded with source 1, the playback is fine, the caption selector loaded fine within the control bar, and caption renders fine within the player.
If the code logic to change the playback source from 1 to 2 via code similar as:
player.src({ "src": url, "type": mimeType, });
The player will be using source 2, the playback is fine, it can also remember the caption choice prior so if the caption was on before it will be still on, and vice versa, with the previous selected language. The problem is the caption selector button now no longer available in the control bar, which stops viewers from changing the caption later on.
What have you tried so far?
I have tried my best to identify if the issue is actually related to hls.js, or within the scope of VideoJS, but I don't really have a conclusion so far. What I can definitely see is upon calling the player.src() method, both the old hls.js and videojs instances disposed, which is expected.
However, for the event "addtrack" which I believe achieve the purpose of loading caption button, is not triggered afterwards.
It will be great to get some guidance here as where to look into the issue, and thanks in advance.
The text was updated successfully, but these errors were encountered: