video.js
video.js copied to clipboard
Subtitles only downloading a single file
Description
Safari and HLS.js download all of the subtitle files, but Video.js appears to only download a single file and then stop rather than downloading all of the files in the manifest
Reduced test case
https://awresports-hls-dev.s3.amazonaws.com/jccc_1_1/m3u8/2024/02/29/19/index.m3u8
Steps to reproduce
- Open Video.js demo page ( https://videojs-http-streaming.netlify.app/ )
- Add above URL
- Load subtitles
- Observe that only a single file is downloaded (and usually cancelled)
Errors
No error output is observed
What version of Video.js are you using?
8.10.0
Video.js plugins used.
No response
What browser(s) including version(s) does this occur with?
122.0.6261.94 (Official Build) (x86_64)
What OS(es) and version(s) does this occur with?
14.3.1
looks like it's failing due to the use EMPTY in the vtt track. I've never seen that before.
Seems like shaka also stops loading it at the first EMPTY
Do you mean that it needs an extension? I changed it to empty.vtt and it still has the same problem.
But if you referring to it being empty as a problem, then that shouldn't be the case, because it states that's possible in the spec:
A WebVTT Segment MAY contain no cues; this indicates that no subtitles are to be displayed during that period.
I changed it so the first track isn't empty and it's still not loading the data, so it appears there's an issue with the handling of EXT-X-MAP or something like that
@gkatsev is it possible that WebVTT EXT-X-MAP is not supported? I saw a similar issue here
Definitely possible that it isn't supported. Last I checked, it seemed like it could have because the init segment gets downloaded in the vtt segment loader (https://github.com/videojs/http-streaming/blob/main/src/vtt-segment-loader.js#L82), which is where I paused my investigation last time. So, it could be downloaded but not applied as expected.
Should be fixed, though, I've rarely seen init segments used for vtt files.
Is there a better way to handle having to set X-TIMESTAMP-MAP for livestreams and VODs?
Using init segments for VTT files is the best option I've found for doing that
to be clear, you shouldn't need to do anything. However, to get things working now, you probably need to make sure that the VTT segments are complete and include the init the body section.
Can you point me at an example that does a livestream with subtitles that doesn't use X-TIMESTAMP-MAP and an init segment with the VTT files?
the timestamp map is still used, it's just in every file. For example, https://demo.unified-streaming.com/k8s/features/stable/video/tears-of-steel/tears-of-steel-multiple-subtitles.ism/.m3u8
Here's 4 different versions of storing the subtitle info with X-TIMESTAMP-MAP and they all work with Safari, but only the init_header one works with Video.js:
https://awresports-hls-dev.s3.amazonaws.com/jccc_1_1/m3u8/2024/02/29/19/index_init_empty.m3u8
https://awresports-hls-dev.s3.amazonaws.com/jccc_1_1/m3u8/2024/02/29/19/index_init_header.m3u8
https://awresports-hls-dev.s3.amazonaws.com/jccc_1_1/m3u8/2024/02/29/19/index_map_init.m3u8
https://awresports-hls-dev.s3.amazonaws.com/jccc_1_1/m3u8/2024/02/29/19/index_map_header.m3u8
Here's another set of the same 4 different versions: https://awresports-hls-dev.s3.amazonaws.com/lp10_0/m3u8/2024/05/12/15/index_init_empty.m3u8 https://awresports-hls-dev.s3.amazonaws.com/lp10_0/m3u8/2024/05/12/15/index_init_header.m3u8 https://awresports-hls-dev.s3.amazonaws.com/lp10_0/m3u8/2024/05/12/15/index_map_init.m3u8 https://awresports-hls-dev.s3.amazonaws.com/lp10_0/m3u8/2024/05/12/15/index_map_header.m3u8