Skip to content

Commit

Permalink
@gkatsev removed non-default track auto-disabling. closes #2475
Browse files Browse the repository at this point in the history
  • Loading branch information
gkatsev committed Aug 19, 2015
1 parent cc6369c commit b1055dc
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 42 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ CHANGELOG
* @misternoneill fixed vertical slider issues ([view](https://github.com/videojs/video.js/pull/2469))
* @gkatsev moved default and player dimensions to style els at the top of HEAD ([view](https://github.com/videojs/video.js/pull/2482))
* @gkatsev moved default and player dimensions to style els at the top of HEAD el ([view](https://github.com/videojs/video.js/pull/2482))
* @gkatsev removed non-default track auto-disabling ([view](https://github.com/videojs/video.js/pull/2475))

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

Expand Down
42 changes: 0 additions & 42 deletions src/js/tech/html5.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,6 @@ class Html5 extends Tech {
}

if (this.featuresNativeTextTracks) {
this.on('loadstart', Fn.bind(this, this.hideCaptions));

this.handleTextTrackChange_ = Fn.bind(this, this.handleTextTrackChange);
this.handleTextTrackAdd_ = Fn.bind(this, this.handleTextTrackAdd);
this.handleTextTrackRemove_ = Fn.bind(this, this.handleTextTrackRemove);
Expand Down Expand Up @@ -183,28 +181,6 @@ class Html5 extends Tech {
}


/**
* Hide captions from text track
*
* @method hideCaptions
*/
hideCaptions() {
let tracks = this.el_.querySelectorAll('track');
let i = tracks.length;
const kinds = {
'captions': 1,
'subtitles': 1
};

while (i--) {
let track = tracks[i].track;
if ((track && track['kind'] in kinds) &&
(!tracks[i]['default'])) {
track.mode = 'disabled';
}
}
}

proxyNativeTextTracks_() {
let tt = this.el().textTracks;

Expand Down Expand Up @@ -701,24 +677,6 @@ class Html5 extends Tech {

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 b1055dc

Please sign in to comment.