mirror of
https://github.com/videojs/video.js.git
synced 2025-01-06 06:50:51 +02:00
@gkatsev removed non-default track auto-disabling. closes #2468
This commit is contained in:
parent
c03e26c575
commit
a02f0befbc
@ -2,7 +2,7 @@ CHANGELOG
|
||||
=========
|
||||
|
||||
## HEAD (Unreleased)
|
||||
_(none)_
|
||||
* @gkatsev removed non-default track auto-disabling ([view](https://github.com/videojs/video.js/pull/2468))
|
||||
|
||||
--------------------
|
||||
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user