diff options
Diffstat (limited to 'client')
-rw-r--r-- | client/src/assets/player/shared/p2p-media-loader/hls-plugin.ts | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/client/src/assets/player/shared/p2p-media-loader/hls-plugin.ts b/client/src/assets/player/shared/p2p-media-loader/hls-plugin.ts index d83ec625a..378bc89fb 100644 --- a/client/src/assets/player/shared/p2p-media-loader/hls-plugin.ts +++ b/client/src/assets/player/shared/p2p-media-loader/hls-plugin.ts | |||
@@ -20,6 +20,8 @@ type Metadata = { | |||
20 | 20 | ||
21 | type HookFn = (player: videojs.Player, hljs: Hlsjs) => void | 21 | type HookFn = (player: videojs.Player, hljs: Hlsjs) => void |
22 | 22 | ||
23 | let alreadyRegistered = false | ||
24 | |||
23 | const registerSourceHandler = function (vjs: typeof videojs) { | 25 | const registerSourceHandler = function (vjs: typeof videojs) { |
24 | if (!Hlsjs.isSupported()) { | 26 | if (!Hlsjs.isSupported()) { |
25 | logger.warn('Hls.js is not supported in this browser!') | 27 | logger.warn('Hls.js is not supported in this browser!') |
@@ -33,8 +35,9 @@ const registerSourceHandler = function (vjs: typeof videojs) { | |||
33 | return | 35 | return |
34 | } | 36 | } |
35 | 37 | ||
36 | // Already registered | 38 | if (alreadyRegistered) return |
37 | if ((html5 as any).canPlaySource({ type: 'application/x-mpegURL' })) return | 39 | |
40 | alreadyRegistered = true; | ||
38 | 41 | ||
39 | // FIXME: typings | 42 | // FIXME: typings |
40 | (html5 as any).registerSourceHandler({ | 43 | (html5 as any).registerSourceHandler({ |