Skip to content

Instantly share code, notes, and snippets.

@erkattak
Created August 3, 2015 17:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save erkattak/3cc396a2f536170ef342 to your computer and use it in GitHub Desktop.
Save erkattak/3cc396a2f536170ef342 to your computer and use it in GitHub Desktop.
vjs.MediaTechController.prototype.emulateTextTracks = function() {
var player = this.player_,
textTracksChanges,
tracks,
script;
if (!window['WebVTT']) {
script = document.createElement('script');
script.src = player.options()['vtt.js'] || '../node_modules/vtt.js/dist/vtt.js';
player.el().appendChild(script);
window['WebVTT'] = true;
}
tracks = this.textTracks();
if (!tracks) {
return;
}
// ...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment