diff options
author | Chocobozzz <me@florianbigard.com> | 2023-07-13 11:42:58 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2023-07-17 11:31:46 +0200 |
commit | 930e1b939a8f4bdc6586eb5bc1fc531e6c13bfcd (patch) | |
tree | 3439794bf05da3eb8ed0f3cf4e17b007916fc2ad | |
parent | 9bb541bec7003b791cfbbf5622b2d2af47156de8 (diff) | |
download | PeerTube-930e1b939a8f4bdc6586eb5bc1fc531e6c13bfcd.tar.gz PeerTube-930e1b939a8f4bdc6586eb5bc1fc531e6c13bfcd.tar.zst PeerTube-930e1b939a8f4bdc6586eb5bc1fc531e6c13bfcd.zip |
Fix HLS player on mobile
-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({ |