Adding Closed Captions or Subtitles
Viblast Player does not process subtitles in any way but instead relys on the build-in support in browser. The only thing you need to do to add subtitles is to add a track
to the video element specifying the appropriate kind
and src
of the subtitle resource. For example:
<body>
...
<video src="//cdn3.viblast.com/streams/hls/airshow/playlist.m3u8" data-viblast-key="my-key" controls>
<track label="English" kind="subtitles" srclang="en" src="cc-en.vtt">
<track label="Deutsch" kind="subtitles" srclang="de" src="cc-de.vtt">
</video>
...
</body>
That's it. After adding the tracks you should see the closed-captions and be able to switch between them. You can also add tracks with different kind
s like metadata
for example.
A note about IE 11
IE 11 ignores subtitles that have a mime type
different than text/vtt
. This is a common problem that leads to subtitles working in Chrome and Firefox but not IE 11. If you encounter it you have to configure your HTTP Server to server the vtt
resources with the mime type
of text/vtt
and this will resolve the problem.