mirror of
https://github.com/videojs/video.js.git
synced 2025-01-13 10:32:26 +02:00
fix(html5): exit early on emulated tracks in html5 (#3772)
addRemoteTextTrack and removeRemoteTextTrack in Html5 tech assumed that they are always called for native text tracks. However, Html5 tech can have emulated text tracks. For those, we just exit early after the super methods are called.
This commit is contained in:
parent
6b477bb737
commit
252bcee959
@ -657,7 +657,9 @@ class Html5 extends Tech {
|
||||
addRemoteTextTrack(options, manualCleanup) {
|
||||
const htmlTrackElement = super.addRemoteTextTrack(options, manualCleanup);
|
||||
|
||||
this.el().appendChild(htmlTrackElement);
|
||||
if (this.featuresNativeTextTracks) {
|
||||
this.el().appendChild(htmlTrackElement);
|
||||
}
|
||||
|
||||
return htmlTrackElement;
|
||||
}
|
||||
@ -670,13 +672,15 @@ class Html5 extends Tech {
|
||||
removeRemoteTextTrack(track) {
|
||||
super.removeRemoteTextTrack(track);
|
||||
|
||||
const tracks = this.$$('track');
|
||||
if (this.featuresNativeTextTracks) {
|
||||
const tracks = this.$$('track');
|
||||
|
||||
let i = tracks.length;
|
||||
let i = tracks.length;
|
||||
|
||||
while (i--) {
|
||||
if (track === tracks[i] || track === tracks[i].track) {
|
||||
this.el().removeChild(tracks[i]);
|
||||
while (i--) {
|
||||
if (track === tracks[i] || track === tracks[i].track) {
|
||||
this.el().removeChild(tracks[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user