hlsjs-playback icon indicating copy to clipboard operation
hlsjs-playback copied to clipboard

Subtitles/ClosedCaptions never loaded for VOD

Open Bubblesphere opened this issue 4 years ago • 3 comments

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?

Bubblesphere avatar Jul 14 '20 15:07 Bubblesphere

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.

phloxic avatar Sep 25 '20 15:09 phloxic

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?

phloxic avatar Sep 29 '20 16:09 phloxic

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.

talaysa avatar Oct 25 '20 20:10 talaysa