From a02f0befbce7808aeb0d84f3a3cea817949a1cb2 Mon Sep 17 00:00:00 2001 From: Gary Katsevman Date: Fri, 21 Aug 2015 11:19:55 -0400 Subject: [PATCH] @gkatsev removed non-default track auto-disabling. closes #2468 --- CHANGELOG.md | 2 +- src/js/media/html5.js | 42 ------------------------------------------ 2 files changed, 1 insertion(+), 43 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fbb9720d3e..5e0b4fe434 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ CHANGELOG ========= ## HEAD (Unreleased) -_(none)_ +* @gkatsev removed non-default track auto-disabling ([view](https://github.com/videojs/video.js/pull/2468)) -------------------- diff --git a/src/js/media/html5.js b/src/js/media/html5.js index 4d5298b35d..1552e6b149 100644 --- a/src/js/media/html5.js +++ b/src/js/media/html5.js @@ -59,10 +59,6 @@ vjs.Html5 = vjs.MediaTechController.extend({ } } - if (this['featuresNativeTextTracks']) { - this.on('loadstart', vjs.bind(this, this.hideCaptions)); - } - // Determine if native controls should be used // Our goal should be to get the custom controls on mobile solid everywhere // so we can remove this all together. Right now this will block custom @@ -165,25 +161,6 @@ vjs.Html5.prototype.createEl = function(){ // jenniisawesome = true; }; - -vjs.Html5.prototype.hideCaptions = function() { - var tracks = this.el_.querySelectorAll('track'), - track, - i = tracks.length, - kinds = { - 'captions': 1, - 'subtitles': 1 - }; - - while (i--) { - track = tracks[i].track; - if ((track && track['kind'] in kinds) && - (!tracks[i]['default'])) { - track.mode = 'disabled'; - } - } -}; - // Make video events trigger player events // May seem verbose here, but makes other APIs possible. // Triggers removed using this.off when disposed @@ -426,25 +403,6 @@ vjs.Html5.prototype.addRemoteTextTrack = function(options) { } this.el().appendChild(track); - - if (track.track['kind'] === 'metadata') { - track['track']['mode'] = 'hidden'; - } else { - track['track']['mode'] = 'disabled'; - } - - track['onload'] = function() { - var tt = track['track']; - if (track.readyState >= 2) { - if (tt['kind'] === 'metadata' && tt['mode'] !== 'hidden') { - tt['mode'] = 'hidden'; - } else if (tt['kind'] !== 'metadata' && tt['mode'] !== 'disabled') { - tt['mode'] = 'disabled'; - } - track['onload'] = null; - } - }; - this.remoteTextTracks().addTrack_(track.track); return track;