From cb0df09ce8e5e439695f08a6b75079d5b47f3fc3 Mon Sep 17 00:00:00 2001 From: jrivera Date: Thu, 3 Nov 2016 14:16:45 -0400 Subject: [PATCH 1/7] Added the ability to flag remoteTextTracks to be automatically 'garbage-collected' when the source changes --- src/js/tech/tech.js | 68 ++++++++++++++++++++++++++++--------- test/unit/tech/tech.test.js | 58 ++++++++++++++++++++++++++++++- 2 files changed, 109 insertions(+), 17 deletions(-) diff --git a/src/js/tech/tech.js b/src/js/tech/tech.js index fe56df343e..5fa48ddf20 100644 --- a/src/js/tech/tech.js +++ b/src/js/tech/tech.js @@ -291,6 +291,23 @@ class Tech extends Component { }); } + /** + * Remove any TextTracks added via addRemoteTextTrack that are + * flagged for automatic garbage collection + * + * @method cleanupAutoTextTracks + */ + cleanupAutoTextTracks() { + const list = this.autoRemoteTextTracks_ || []; + let i = list.length; + + while (i--) { + const track = list[i]; + + this.removeRemoteTextTrack(track); + } + } + /** * Reset the tech. Removes all sources and resets readyState. * @@ -531,20 +548,33 @@ class Tech extends Component { * * @param {Object} options The object should contain values for * kind, language, label and src (location of the WebVTT file) + * @param {Boolean} manualCleanup if set to false, the TextTrack will be + * automatically removed from the video element whenever the source changes * @return {HTMLTrackElement} * @method addRemoteTextTrack */ - addRemoteTextTrack(options) { + addRemoteTextTrack(options, manualCleanup) { const track = mergeOptions(options, { tech: this }); - const htmlTrackElement = new HTMLTrackElement(track); + if (manualCleanup !== true && manualCleanup !== false) { + // deprecation warning + log.warn('Calling addRemoteTextTrack without explicitly setting the "manualCleanup" parameter to `true` is deprecated and default to `false` in future version of video.js'); + manualCleanup = true; + } + // store HTMLTrackElement and TextTrack to remote list this.remoteTextTrackEls().addTrackElement_(htmlTrackElement); this.remoteTextTracks().addTrack_(htmlTrackElement.track); + if (manualCleanup !== true) { + // create the TextTrackList if it doesn't exist + this.autoRemoteTextTracks_ = this.autoRemoteTextTracks_ || new TextTrackList(); + this.autoRemoteTextTracks_.addTrack_(htmlTrackElement.track); + } + // must come after remoteTextTracks() this.textTracks().addTrack_(htmlTrackElement.track); @@ -565,6 +595,9 @@ class Tech extends Component { // remove HTMLTrackElement and TextTrack from remote list this.remoteTextTrackEls().removeTrackElement_(trackElement); this.remoteTextTracks().removeTrack_(track); + if (this.autoRemoteTextTracks_) { + this.autoRemoteTextTracks_.removeTrack_(track); + } } /** @@ -820,17 +853,7 @@ Tech.withSourceHandlers = function(_Tech) { this.disposeSourceHandler(); this.off('dispose', this.disposeSourceHandler); - // if we have a source and get another one - // then we are loading something new - // than clear all of our current tracks - if (this.currentSource_) { - this.clearTracks(['audio', 'video']); - - this.currentSource_ = null; - } - if (sh !== _Tech.nativeSourceHandler) { - this.currentSource_ = source; // Catch if someone replaced the src without calling setSource. @@ -838,7 +861,6 @@ Tech.withSourceHandlers = function(_Tech) { this.off(this.el_, 'loadstart', _Tech.prototype.firstLoadStartListener_); this.off(this.el_, 'loadstart', _Tech.prototype.successiveLoadStartListener_); this.one(this.el_, 'loadstart', _Tech.prototype.firstLoadStartListener_); - } this.sourceHandler_ = sh.handleSource(source, this, this.options_); @@ -854,7 +876,6 @@ Tech.withSourceHandlers = function(_Tech) { // On successive loadstarts when setSource has not been called again _Tech.prototype.successiveLoadStartListener_ = function() { - this.currentSource_ = null; this.disposeSourceHandler(); this.one(this.el_, 'loadstart', _Tech.prototype.successiveLoadStartListener_); }; @@ -863,10 +884,25 @@ Tech.withSourceHandlers = function(_Tech) { * Clean up any existing source handler */ _Tech.prototype.disposeSourceHandler = function() { - if (this.sourceHandler_ && this.sourceHandler_.dispose) { + // if we have a source and get another one + // then we are loading something new + // than clear all of our current tracks + if (this.currentSource_) { + this.clearTracks(['audio', 'video']); + this.currentSource_ = null; + } + + // always clean up auto-text tracks + this.cleanupAutoTextTracks(); + + if (this.sourceHandler_) { this.off(this.el_, 'loadstart', _Tech.prototype.firstLoadStartListener_); this.off(this.el_, 'loadstart', _Tech.prototype.successiveLoadStartListener_); - this.sourceHandler_.dispose(); + + if (this.sourceHandler_.dispose) { + this.sourceHandler_.dispose(); + } + this.sourceHandler_ = null; } }; diff --git a/test/unit/tech/tech.test.js b/test/unit/tech/tech.test.js index f5edd7f5a6..72ea255644 100644 --- a/test/unit/tech/tech.test.js +++ b/test/unit/tech/tech.test.js @@ -146,7 +146,7 @@ QUnit.test('dispose() should clear all tracks that are added after creation', fu assert.equal(tech.audioTracks().length, 2, 'should have two audio tracks at the start'); assert.equal(tech.videoTracks().length, 2, 'should have two video tracks at the start'); - assert.equal(tech.textTracks().length, 2, 'should have two video tracks at the start'); + assert.equal(tech.textTracks().length, 2, 'should have two text tracks at the start'); assert.equal(tech.remoteTextTrackEls().length, 2, 'should have two remote text tracks els'); @@ -167,6 +167,62 @@ QUnit.test('dispose() should clear all tracks that are added after creation', fu assert.equal(tech.textTracks().length, 0, 'should have zero video tracks after dispose'); }); +QUnit.test('switching sources should clear all remote tracks that are added with manualCleanup = false', function(assert) { + // Define a new tech class + const MyTech = extendFn(Tech); + + // Create source handler + const handler = { + canPlayType: () => 'probably', + canHandleSource: () => 'probably', + handleSource: () => { + return { + dispose: () => {} + }; + } + }; + + // Extend Tech with source handlers + Tech.withSourceHandlers(MyTech); + + MyTech.registerSourceHandler(handler); + + const tech = new MyTech(); + + // set the initial source + tech.setSource({src: 'foo.mp4', type: 'mp4'}); + + // default value for manualCleanup is true + tech.addRemoteTextTrack({}); + // should be automatically cleaned up when source changes + tech.addRemoteTextTrack({}, false); + + assert.equal(tech.textTracks().length, 2, 'should have two text tracks at the start'); + assert.equal(tech.remoteTextTrackEls().length, + 2, + 'should have two remote text tracks els'); + assert.equal(tech.remoteTextTracks().length, 2, 'should have two remote text tracks'); + assert.equal(tech.autoRemoteTextTracks_.length, + 1, + 'should have one auto-cleanup remote text track'); + + // change source to force cleanup of auto remote text tracks + tech.setSource({src: 'bar.mp4', type: 'mp4'}); + + assert.equal(tech.textTracks().length, + 1, + 'should have one text track after source change'); + assert.equal(tech.remoteTextTrackEls().length, + 1, + 'should have one remote remote text track els after source change'); + assert.equal(tech.remoteTextTracks().length, + 1, + 'should have one remote text track after source change'); + assert.equal(tech.autoRemoteTextTracks_.length, + 0, + 'should have zero auto-cleanup remote text tracks'); +}); + QUnit.test('should add the source handler interface to a tech', function(assert) { const sourceA = { src: 'foo.mp4', type: 'video/mp4' }; const sourceB = { src: 'no-support', type: 'no-support' }; From 08a1eb6fdf163ef4d5a973dcd450eb19f5c10c93 Mon Sep 17 00:00:00 2001 From: jrivera Date: Fri, 4 Nov 2016 19:02:41 -0400 Subject: [PATCH 2/7] Added deprecation notice to doc comment --- src/js/tech/tech.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/js/tech/tech.js b/src/js/tech/tech.js index 5fa48ddf20..e171d4e790 100644 --- a/src/js/tech/tech.js +++ b/src/js/tech/tech.js @@ -548,9 +548,11 @@ class Tech extends Component { * * @param {Object} options The object should contain values for * kind, language, label and src (location of the WebVTT file) - * @param {Boolean} manualCleanup if set to false, the TextTrack will be + * @param {Boolean} [manualCleanup=true] if set to false, the TextTrack will be * automatically removed from the video element whenever the source changes * @return {HTMLTrackElement} + * @deprecated The default value of the "manualCleanup" parameter will default + * to "false" in upcoming versions of Video.js * @method addRemoteTextTrack */ addRemoteTextTrack(options, manualCleanup) { @@ -718,7 +720,7 @@ Tech.prototype.featuresNativeTextTracks = false; * * ##### EXAMPLE: * - * Tech.withSourceHandlers.call(MyTech); + * Tech.withSourceHandlers(MyTech); * */ Tech.withSourceHandlers = function(_Tech) { From 8a5fd4950b689d437531cc4b8cbcefef9d5809c2 Mon Sep 17 00:00:00 2001 From: jrivera Date: Mon, 7 Nov 2016 18:10:49 -0500 Subject: [PATCH 3/7] Fix the auto-managed remoteTexttTacks to work correctly when using both emulated and native TextTracks. * Remove the redundancy in Html5 & Tech around remote text tracks. * Changed Tech construction to call emulateTextTracks immediately but defer the creation of the webvtt to the `ready` event, if necessary. * Player now passes along all arguments to the underlying Tech on addRemoteTextTrack. --- src/js/player.js | 4 +- src/js/tech/html5.js | 39 +++++++--------- src/js/tech/tech.js | 66 +++++++++++++++++----------- test/unit/tracks/text-tracks.test.js | 1 - 4 files changed, 58 insertions(+), 52 deletions(-) diff --git a/src/js/player.js b/src/js/player.js index 5406a02be5..d42e1ba39d 100644 --- a/src/js/player.js +++ b/src/js/player.js @@ -2525,9 +2525,9 @@ class Player extends Component { * * @param {Object} options Options for remote text track */ - addRemoteTextTrack(options) { + addRemoteTextTrack(...theArgs) { if (this.tech_) { - return this.tech_.addRemoteTextTrack(options); + return this.tech_.addRemoteTextTrack(...theArgs); } } diff --git a/src/js/tech/html5.js b/src/js/tech/html5.js index 368aa40b6f..a7f8fbfbdd 100644 --- a/src/js/tech/html5.js +++ b/src/js/tech/html5.js @@ -607,18 +607,10 @@ class Html5 extends Tech { return this.el_.addTextTrack(kind, label, language); } - /** - * Creates a remote text track object and returns a html track element - * - * @param {Object} options The object should contain values for - * kind, language, label and src (location of the WebVTT file) - * @return {HTMLTrackElement} - */ - addRemoteTextTrack(options = {}) { + createRemoteTextTrack(options) { if (!this.featuresNativeTextTracks) { - return super.addRemoteTextTrack(options); + return super.createRemoteTextTrack(options); } - const htmlTrackElement = document.createElement('track'); if (options.kind) { @@ -640,11 +632,20 @@ class Html5 extends Tech { htmlTrackElement.src = options.src; } - this.el().appendChild(htmlTrackElement); + return htmlTrackElement; + } + + /** + * Creates a remote text track object and returns a html track element + * + * @param {Object} options The object should contain values for + * kind, language, label and src (location of the WebVTT file) + * @return {HTMLTrackElement} + */ + addRemoteTextTrack(options = {}, ...theRest) { + const htmlTrackElement = super.addRemoteTextTrack(options, ...theRest); - // store HTMLTrackElement and TextTrack to remote list - this.remoteTextTrackEls().addTrackElement_(htmlTrackElement); - this.remoteTextTracks().addTrack_(htmlTrackElement.track); + this.el().appendChild(htmlTrackElement); return htmlTrackElement; } @@ -655,15 +656,7 @@ class Html5 extends Tech { * @param {TextTrackObject} track Texttrack object to remove */ removeRemoteTextTrack(track) { - if (!this.featuresNativeTextTracks) { - return super.removeRemoteTextTrack(track); - } - - const trackElement = this.remoteTextTrackEls().getTrackElementByTrack_(track); - - // remove HTMLTrackElement and TextTrack from remote list - this.remoteTextTrackEls().removeTrackElement_(trackElement); - this.remoteTextTracks().removeTrack_(track); + super.removeRemoteTextTrack(track); const tracks = this.$$('track'); diff --git a/src/js/tech/tech.js b/src/js/tech/tech.js index e171d4e790..d59ee78ce4 100644 --- a/src/js/tech/tech.js +++ b/src/js/tech/tech.js @@ -85,9 +85,11 @@ class Tech extends Component { } if (!this.featuresNativeTextTracks) { - this.on('ready', this.emulateTextTracks); + this.emulateTextTracks(); } + this.autoRemoteTextTracks_ = new TextTrackList(); + this.initTextTrackListeners(); this.initTrackListeners(); @@ -410,18 +412,7 @@ class Tech extends Component { }); } - /** - * Emulate texttracks - * - * @method emulateTextTracks - */ - emulateTextTracks() { - const tracks = this.textTracks(); - - if (!tracks) { - return; - } - + addWebVttScript() { if (!window.WebVTT && this.el().parentNode !== null && this.el().parentNode !== undefined) { const script = document.createElement('script'); @@ -441,6 +432,32 @@ class Tech extends Component { window.WebVTT = true; this.el().parentNode.appendChild(script); } + } + + /** + * Emulate texttracks + * + * @method emulateTextTracks + */ + emulateTextTracks() { + const tracks = this.textTracks(); + + if (!tracks) { + return; + } + + this.remoteTextTracks().on('addtrack', (e) => { + this.textTracks().addTrack_(e.track); + }); + + this.remoteTextTracks().on('removetrack', (e) => { + this.textTracks().removeTrack_(e.track); + }); + + // Initially, Tech.el_ is a child of a dummy-div wait until the Component system + // signals that the Tech is ready at which point Tech.el_ is part of the DOM + // before inserting the WebVTT script + this.on('ready', this.addWebVttScript); const updateDisplay = () => this.trigger('texttrackchange'); const textTracksChanges = () => { @@ -543,6 +560,14 @@ class Tech extends Component { return createTrackHelper(this, kind, label, language); } + createRemoteTextTrack(options) { + const track = mergeOptions(options, { + tech: this + }); + + return new HTMLTrackElement(track); + } + /** * Creates a remote text track object and returns a emulated html track element * @@ -556,10 +581,7 @@ class Tech extends Component { * @method addRemoteTextTrack */ addRemoteTextTrack(options, manualCleanup) { - const track = mergeOptions(options, { - tech: this - }); - const htmlTrackElement = new HTMLTrackElement(track); + const htmlTrackElement = this.createRemoteTextTrack(options); if (manualCleanup !== true && manualCleanup !== false) { // deprecation warning @@ -573,13 +595,9 @@ class Tech extends Component { if (manualCleanup !== true) { // create the TextTrackList if it doesn't exist - this.autoRemoteTextTracks_ = this.autoRemoteTextTracks_ || new TextTrackList(); this.autoRemoteTextTracks_.addTrack_(htmlTrackElement.track); } - // must come after remoteTextTracks() - this.textTracks().addTrack_(htmlTrackElement.track); - return htmlTrackElement; } @@ -590,16 +608,12 @@ class Tech extends Component { * @method removeRemoteTextTrack */ removeRemoteTextTrack(track) { - this.textTracks().removeTrack_(track); - const trackElement = this.remoteTextTrackEls().getTrackElementByTrack_(track); // remove HTMLTrackElement and TextTrack from remote list this.remoteTextTrackEls().removeTrackElement_(trackElement); this.remoteTextTracks().removeTrack_(track); - if (this.autoRemoteTextTracks_) { - this.autoRemoteTextTracks_.removeTrack_(track); - } + this.autoRemoteTextTracks_.removeTrack_(track); } /** diff --git a/test/unit/tracks/text-tracks.test.js b/test/unit/tracks/text-tracks.test.js index fd7094c02c..df53357535 100644 --- a/test/unit/tracks/text-tracks.test.js +++ b/test/unit/tracks/text-tracks.test.js @@ -377,7 +377,6 @@ QUnit.test('removes cuechange event when text track is hidden for emulated track endTime: 5 }); player.tech_.textTracks().addTrack_(tt); - player.tech_.emulateTextTracks(); let numTextTrackChanges = 0; From 402a12667713774c5dd495412b2258b0997ae454 Mon Sep 17 00:00:00 2001 From: jrivera Date: Mon, 7 Nov 2016 18:22:36 -0500 Subject: [PATCH 4/7] Added doc comments for createRemoteTextTrack --- src/js/tech/html5.js | 8 ++++++++ src/js/tech/tech.js | 10 ++++++++++ 2 files changed, 18 insertions(+) diff --git a/src/js/tech/html5.js b/src/js/tech/html5.js index a7f8fbfbdd..7fd1c4ffb2 100644 --- a/src/js/tech/html5.js +++ b/src/js/tech/html5.js @@ -607,6 +607,14 @@ class Html5 extends Tech { return this.el_.addTextTrack(kind, label, language); } + /** + * Creates either native TextTrack or an emulated TextTrack depending + * on the value of `featuresNativeTextTracks` + * + * @param {Object} options The object should contain values for + * kind, language, label and src (location of the WebVTT file) + * @method createRemoteTextTrack + */ createRemoteTextTrack(options) { if (!this.featuresNativeTextTracks) { return super.createRemoteTextTrack(options); diff --git a/src/js/tech/tech.js b/src/js/tech/tech.js index d59ee78ce4..19f4a2ca6b 100644 --- a/src/js/tech/tech.js +++ b/src/js/tech/tech.js @@ -560,6 +560,16 @@ class Tech extends Component { return createTrackHelper(this, kind, label, language); } + /** + * Create an emulated TextTrack for use by addRemoteTextTrack + * + * This is intended to be overridden by classes that inherit from + * Tech in order to create native or custom TextTracks. + * + * @param {Object} options The object should contain values for + * kind, language, label and src (location of the WebVTT file) + * @method createRemoteTextTrack + */ createRemoteTextTrack(options) { const track = mergeOptions(options, { tech: this From b65b8726f2be7dc38bd867b98274f56b7a2bbf53 Mon Sep 17 00:00:00 2001 From: jrivera Date: Mon, 7 Nov 2016 19:20:06 -0500 Subject: [PATCH 5/7] Renamed addWebVttScript function and made it private --- src/js/tech/html5.js | 1 - src/js/tech/tech.js | 10 +++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/js/tech/html5.js b/src/js/tech/html5.js index 7fd1c4ffb2..4d0fa7ddba 100644 --- a/src/js/tech/html5.js +++ b/src/js/tech/html5.js @@ -613,7 +613,6 @@ class Html5 extends Tech { * * @param {Object} options The object should contain values for * kind, language, label and src (location of the WebVTT file) - * @method createRemoteTextTrack */ createRemoteTextTrack(options) { if (!this.featuresNativeTextTracks) { diff --git a/src/js/tech/tech.js b/src/js/tech/tech.js index 19f4a2ca6b..456c73a79a 100644 --- a/src/js/tech/tech.js +++ b/src/js/tech/tech.js @@ -412,7 +412,12 @@ class Tech extends Component { }); } - addWebVttScript() { + /** + * Add vtt.js if necessary + * + * @private + */ + addWebVttScript_() { if (!window.WebVTT && this.el().parentNode !== null && this.el().parentNode !== undefined) { const script = document.createElement('script'); @@ -457,7 +462,7 @@ class Tech extends Component { // Initially, Tech.el_ is a child of a dummy-div wait until the Component system // signals that the Tech is ready at which point Tech.el_ is part of the DOM // before inserting the WebVTT script - this.on('ready', this.addWebVttScript); + this.on('ready', this.addWebVttScript_); const updateDisplay = () => this.trigger('texttrackchange'); const textTracksChanges = () => { @@ -568,7 +573,6 @@ class Tech extends Component { * * @param {Object} options The object should contain values for * kind, language, label and src (location of the WebVTT file) - * @method createRemoteTextTrack */ createRemoteTextTrack(options) { const track = mergeOptions(options, { From ad7008a8622829ec8f0156c06e8d655f0f770c87 Mon Sep 17 00:00:00 2001 From: Gary Katsevman Date: Wed, 9 Nov 2016 14:58:50 -0500 Subject: [PATCH 6/7] Update jsdoc. Move default options to tech --- src/js/player.js | 13 ++++++++++--- src/js/tech/html5.js | 15 ++++++++++----- src/js/tech/tech.js | 10 +++++----- 3 files changed, 25 insertions(+), 13 deletions(-) diff --git a/src/js/player.js b/src/js/player.js index d42e1ba39d..ae6e77d23e 100644 --- a/src/js/player.js +++ b/src/js/player.js @@ -2521,9 +2521,16 @@ class Player extends Component { } /** - * Add a remote text track - * - * @param {Object} options Options for remote text track + * Creates a remote text track object and returns an html track element. + * + * @param {Object} options The object should contain values for + * kind, language, label, and src (location of the WebVTT file) + * @param {Boolean} [manualCleanup=true] if set to false, the TextTrack will be + * automatically removed from the video element whenever the source changes + * @return {HTMLTrackElement} An Html Track Element. + * This can be an emulated {@link HTMLTrackElement} or a native one. + * @deprecated The default value of the "manualCleanup" parameter will default + * to "false" in upcoming versions of Video.js */ addRemoteTextTrack(...theArgs) { if (this.tech_) { diff --git a/src/js/tech/html5.js b/src/js/tech/html5.js index 4d0fa7ddba..f93489dbde 100644 --- a/src/js/tech/html5.js +++ b/src/js/tech/html5.js @@ -643,14 +643,19 @@ class Html5 extends Tech { } /** - * Creates a remote text track object and returns a html track element + * Creates a remote text track object and returns an html track element. * * @param {Object} options The object should contain values for - * kind, language, label and src (location of the WebVTT file) - * @return {HTMLTrackElement} + * kind, language, label, and src (location of the WebVTT file) + * @param {Boolean} [manualCleanup=true] if set to false, the TextTrack will be + * automatically removed from the video element whenever the source changes + * @return {HTMLTrackElement} An Html Track Element. + * This can be an emulated {@link HTMLTrackElement} or a native one. + * @deprecated The default value of the "manualCleanup" parameter will default + * to "false" in upcoming versions of Video.js */ - addRemoteTextTrack(options = {}, ...theRest) { - const htmlTrackElement = super.addRemoteTextTrack(options, ...theRest); + addRemoteTextTrack(options, manualCleanup) { + const htmlTrackElement = super.addRemoteTextTrack(options, manualCleanup); this.el().appendChild(htmlTrackElement); diff --git a/src/js/tech/tech.js b/src/js/tech/tech.js index 456c73a79a..dbbeaaee1c 100644 --- a/src/js/tech/tech.js +++ b/src/js/tech/tech.js @@ -583,18 +583,18 @@ class Tech extends Component { } /** - * Creates a remote text track object and returns a emulated html track element + * Creates a remote text track object and returns an html track element. * * @param {Object} options The object should contain values for - * kind, language, label and src (location of the WebVTT file) + * kind, language, label, and src (location of the WebVTT file) * @param {Boolean} [manualCleanup=true] if set to false, the TextTrack will be * automatically removed from the video element whenever the source changes - * @return {HTMLTrackElement} + * @return {HTMLTrackElement} An Html Track Element. + * This can be an emulated {@link HTMLTrackElement} or a native one. * @deprecated The default value of the "manualCleanup" parameter will default * to "false" in upcoming versions of Video.js - * @method addRemoteTextTrack */ - addRemoteTextTrack(options, manualCleanup) { + addRemoteTextTrack(options = {}, manualCleanup) { const htmlTrackElement = this.createRemoteTextTrack(options); if (manualCleanup !== true && manualCleanup !== false) { From 9359fa370a29809ffc4628f2d8e419ff6478b647 Mon Sep 17 00:00:00 2001 From: Gary Katsevman Date: Wed, 9 Nov 2016 15:28:49 -0500 Subject: [PATCH 7/7] update player.js method signature --- src/js/player.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/js/player.js b/src/js/player.js index ae6e77d23e..358b685983 100644 --- a/src/js/player.js +++ b/src/js/player.js @@ -2532,9 +2532,9 @@ class Player extends Component { * @deprecated The default value of the "manualCleanup" parameter will default * to "false" in upcoming versions of Video.js */ - addRemoteTextTrack(...theArgs) { + addRemoteTextTrack(options, manualCleanup) { if (this.tech_) { - return this.tech_.addRemoteTextTrack(...theArgs); + return this.tech_.addRemoteTextTrack(options, manualCleanup); } }