Skip to content

Commit

Permalink
Remove default track cancellation
Browse files Browse the repository at this point in the history
  • Loading branch information
gkatsev committed Aug 13, 2015
1 parent 39ef157 commit f6947e4
Showing 1 changed file with 0 additions and 42 deletions.
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 f6947e4

Please # to comment.