mirror of
https://github.com/videojs/video.js.git
synced 2025-07-03 00:57:02 +02:00
@gkatsev fixed captions showing by default in Chrome and Safari. closes #1865
This commit is contained in:
@ -59,6 +59,10 @@ 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
|
||||
@ -161,6 +165,24 @@ vjs.Html5.prototype.createEl = function(){
|
||||
// jenniisawesome = true;
|
||||
};
|
||||
|
||||
|
||||
vjs.Html5.prototype.hideCaptions = function() {
|
||||
var tracks = this.el_.textTracks,
|
||||
track,
|
||||
i = tracks.length,
|
||||
kinds = {
|
||||
'captions': 1,
|
||||
'subtitles': 1
|
||||
};
|
||||
|
||||
while (i--) {
|
||||
track = tracks[i];
|
||||
if (track && track['kind'] in kinds) {
|
||||
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
|
||||
|
Reference in New Issue
Block a user