using shaka player I couldn't add a track to player nor manually neither programmatically.
placing <track src="src" kind="subtitles" > inside <video>
using shaka player addTextTrack(uri, language, kind, mime, opt_codecopt, opt_labelopt) method
In both ways, the vtt file is fetched from the server but it doesn't show anything. using first method cause a cc icon appear next to the volume control but it doesn't do anything.
You can use HTML5 <track> elements if you have subtitles in the WebVTT format. If this isn't the case you may want to handle the conversion server side.
Shaka doesn't quite play by the standard rules, so you we can't handle it like the other libraries. See #994
I managed this issue by overriding textDisplayFactory of shaka-player:
shakaPlayer.configure({
textDisplayFactory: () => {
return {
setTextVisibility: () => {},
isTextVisible: () => true,
destroy: () => { }
}
}
});
Thanks for the update!
I'm not sure what that does though? Does it make Shaka Player use multiple tracks (one per language) like the other libraries (see #994). I'm guessing not?
according to google/shaka-player#1443 I Implement a custom text displayer for shaka which does nothing and let plyr handle displaying captions.
Thanks! I'll leave this open until there's a full example of how to use Plyr with Shaka Player and captions, or if I write one myself. I prefer not to have to dig into the Shaka Player api again.
Most helpful comment
I managed this issue by overriding textDisplayFactory of shaka-player: