Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove a bunch of code that tried to disable tracks by default #2468

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 0 additions & 42 deletions src/js/media/html5.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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;
Expand Down