]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/commitdiff
Fix HLS fallback
authorChocobozzz <me@florianbigard.com>
Fri, 28 Oct 2022 13:32:06 +0000 (15:32 +0200)
committerChocobozzz <me@florianbigard.com>
Fri, 28 Oct 2022 13:32:06 +0000 (15:32 +0200)
client/src/assets/player/shared/p2p-media-loader/p2p-media-loader-plugin.ts

index 2ed09c61c49857a73d66576095a4963268722599..0757aa5ded048c50358c0978a7c21a28a165e0a5 100644 (file)
@@ -54,7 +54,16 @@ class P2pMediaLoaderPlugin extends Plugin {
       if (message) {
         logger.warn(message)
 
-        player.ready(() => player.trigger('error', new Error(message)))
+        const error: MediaError = {
+          code: MediaError.MEDIA_ERR_SRC_NOT_SUPPORTED,
+          message,
+          MEDIA_ERR_ABORTED: MediaError.MEDIA_ERR_ABORTED,
+          MEDIA_ERR_DECODE: MediaError.MEDIA_ERR_DECODE,
+          MEDIA_ERR_NETWORK: MediaError.MEDIA_ERR_NETWORK,
+          MEDIA_ERR_SRC_NOT_SUPPORTED: MediaError.MEDIA_ERR_SRC_NOT_SUPPORTED
+        }
+
+        player.ready(() => player.error(error))
         return
       }
     } else {