Skip to content
This repository has been archived by the owner on Jul 19, 2024. It is now read-only.

Closed captioning

Scott Miller edited this page Mar 17, 2016 · 2 revisions

The MediaPlayer uses the standard W3C tracks element. If the MediaPlayer's video tag has track elements, the MediaPlayer will automatically display UI to allow the user to turn on and off captions as well as see which captions are currently enabled.

Below is a code example:

HTML
<div id="myMediaPlayer">
<video src="http://www.contoso.com/video.mp4">
<track src="captions.vtt" label="English" kind="captions" srclang="en-us" default>
</video>
</div>

JavaScript

var mediaPlayer = new TVJS.MediaPlayer(document.getElementById("myMediaPlayer"));