aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2023-07-13 11:42:58 +0200
committerChocobozzz <me@florianbigard.com>2023-07-17 11:31:46 +0200
commit930e1b939a8f4bdc6586eb5bc1fc531e6c13bfcd (patch)
tree3439794bf05da3eb8ed0f3cf4e17b007916fc2ad
parent9bb541bec7003b791cfbbf5622b2d2af47156de8 (diff)
downloadPeerTube-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.ts7
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
21type HookFn = (player: videojs.Player, hljs: Hlsjs) => void 21type HookFn = (player: videojs.Player, hljs: Hlsjs) => void
22 22
23let alreadyRegistered = false
24
23const registerSourceHandler = function (vjs: typeof videojs) { 25const 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({