mirror of
https://github.com/videojs/video.js.git
synced 2025-01-02 06:32:07 +02:00
@gkatsev removed non-default track auto-disabling. closes #2475
This commit is contained in:
parent
cc6369c524
commit
b1055dce01
@ -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))
|
||||
|
||||
--------------------
|
||||
|
||||
|
@ -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);
|
||||
@ -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;
|
||||
|
||||
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user