Skip to content

Commit

Permalink
@gkatsev removed non-default track auto-disabling. closes #2468
Browse files Browse the repository at this point in the history
  • Loading branch information
gkatsev committed Aug 21, 2015
1 parent c03e26c commit a02f0be
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 43 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ CHANGELOG
=========

## HEAD (Unreleased)
_(none)_
* @gkatsev removed non-default track auto-disabling ([view](https://github.com/videojs/video.js/pull/2468))

--------------------

Expand Down
42 changes: 0 additions & 42 deletions src/js/media/html5.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit a02f0be

Please # to comment.