aboutsummaryrefslogtreecommitdiffstats
path: root/src/js/captions.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/js/captions.js')
-rw-r--r--src/js/captions.js9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/js/captions.js b/src/js/captions.js
index f7c24534..04da4651 100644
--- a/src/js/captions.js
+++ b/src/js/captions.js
@@ -133,7 +133,8 @@ const captions = {
});
// Turn off native caption rendering to avoid double captions
- Object.assign(track, { mode: 'hidden' });
+ // eslint-disable-next-line no-param-reassign
+ track.mode = 'hidden';
// Add event listener for cue changes
on.call(this, track, 'cuechange', () => captions.updateCues.call(this));
@@ -150,7 +151,11 @@ const captions = {
toggleClass(this.elements.container, this.config.classNames.captions.enabled, !is.empty(tracks));
// Update available languages in list
- if ((this.config.controls || []).includes('settings') && this.config.settings.includes('captions')) {
+ if (
+ is.array(this.config.controls) &&
+ this.config.controls.includes('settings') &&
+ this.config.settings.includes('captions')
+ ) {
controls.setCaptionsMenu.call(this);
}
},