hlsjs-playback
hlsjs-playback copied to clipboard
Subtitles/ClosedCaptions never loaded for VOD
With the given VOD
https://senvuvod.azureedge.net/pvvodsoc-fl/definst/mp4:azrsoc/archives/PV750/2020/2020-06-25/9637_Senate%20sitting%20no.%2027_13-30-41_VL.mp4/playlist.m3u8?audioindex=2
HLSJS.Events.SUBTITLE_TRACK_LOADED is never triggered HLSJS.Events.SUBTITLE_TRACKS_UPDATED gets triggered
Therefore the closed captions are never loaded. I tried removing this._playbackType === Playback.LIVE
from the following code
// Live stream subtitle tracks detection hack (may not immediately available)
if (this._ccTracksUpdated && this._playbackType === Playback.LIVE && this.hasClosedCaptionsTracks)
this._onSubtitleLoaded()
but the hasClosedCaptionsTrack was still false when it ran. To fix my issue, I added the following to the _onTimeUpdate method
if (this._ccTracksUpdated && this.hasClosedCaptionsTracks)
this._onSubtitleLoaded();
Is there a better way to do this?
I encountered this as well.
So far I believed this to be a regression with the 0.4.0 architecture change, as my test stream works (apart from neither DEFAULT
nor AUTOSELECT
not being recognized, probably different issue) in the demo which still uses the old architecture by loading https://cdn.jsdelivr.net/npm/clappr@latest/dist/clappr.min.js whereas your stream fails in the demo as well, even in Mac Safari.
Your stream does work in the hls.js demo though.
As the demo is now updated:
pre v0.4.x works - at least with some streams.
v0.4.x: does not show subs or rather does not show the selector.
Should this be filed for core?
I faced with same problem. This looks like fixed.
if (this._ccTracksUpdated && this.hasClosedCaptionsTracks) this._onSubtitleLoaded();
But also if hardcode has externalTrack in the same with manifest url, it is causing to bug.