From 0b8e50aa8de04ca457ea556990de5c1b330fe2ac Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 28 Oct 2022 15:32:06 +0200 Subject: Fix HLS fallback --- .../player/shared/p2p-media-loader/p2p-media-loader-plugin.ts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'client') diff --git a/client/src/assets/player/shared/p2p-media-loader/p2p-media-loader-plugin.ts b/client/src/assets/player/shared/p2p-media-loader/p2p-media-loader-plugin.ts index 2ed09c61c..0757aa5de 100644 --- a/client/src/assets/player/shared/p2p-media-loader/p2p-media-loader-plugin.ts +++ b/client/src/assets/player/shared/p2p-media-loader/p2p-media-loader-plugin.ts @@ -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 { -- cgit v1.2.3