From 2a1f9f357f30000094f10864486e143dacbc448d Mon Sep 17 00:00:00 2001 From: Gary Katsevman Date: Wed, 25 Feb 2015 16:12:01 -0800 Subject: [PATCH] @gkatsev fixed disabling of default text tracks. closes #1892 --- CHANGELOG.md | 2 +- src/js/media/html5.js | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b482633f9c..43175d4247 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ CHANGELOG ========= ## HEAD (Unreleased) -_(none)_ +* @gkatsev fixed disabling of default text tracks ([view](https://github.com/videojs/video.js/pull/1892)) -------------------- diff --git a/src/js/media/html5.js b/src/js/media/html5.js index 4cb83ae5bb..ee55d54e62 100644 --- a/src/js/media/html5.js +++ b/src/js/media/html5.js @@ -167,7 +167,7 @@ vjs.Html5.prototype.createEl = function(){ vjs.Html5.prototype.hideCaptions = function() { - var tracks = this.el_.textTracks, + var tracks = this.el_.querySelectorAll('track'), track, i = tracks.length, kinds = { @@ -176,8 +176,9 @@ vjs.Html5.prototype.hideCaptions = function() { }; while (i--) { - track = tracks[i]; - if (track && track['kind'] in kinds) { + track = tracks[i].track; + if ((track && track['kind'] in kinds) && + (!tracks[i]['default'])) { track.mode = 'disabled'; } }