From 52807a075fdc4933d20e882844f7835e9c38afeb Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 2 Jun 2023 15:59:16 +0200 Subject: [PATCH] Fix storyboard on firefox --- .../assets/player/shared/control-bar/storyboard-plugin.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/client/src/assets/player/shared/control-bar/storyboard-plugin.ts b/client/src/assets/player/shared/control-bar/storyboard-plugin.ts index c1843f595..81ab60842 100644 --- a/client/src/assets/player/shared/control-bar/storyboard-plugin.ts +++ b/client/src/assets/player/shared/control-bar/storyboard-plugin.ts @@ -34,10 +34,10 @@ class StoryboardPlugin extends Plugin { this.boundedHijackMouseTooltip = this.hijackMouseTooltip.bind(this) + this.init() + this.player.ready(() => { player.addClass('vjs-storyboard') - - this.init() }) } @@ -54,8 +54,8 @@ class StoryboardPlugin extends Plugin { this.spritePlaceholder = videojs.dom.createEl('div', { className: 'vjs-storyboard-sprite-placeholder' }) as HTMLElement this.seekBar?.el()?.appendChild(this.spritePlaceholder) - this.player.on([ 'ready', 'loadstart' ], evt => { - if (evt !== 'ready') { + this.player.on([ 'ready', 'loadstart' ], event => { + if (event.type !== 'ready') { const spriteSource = this.player.currentSources().find(source => { return Object.prototype.hasOwnProperty.call(source, 'storyboard') }) as any