From: Chocobozzz Date: Wed, 21 Apr 2021 08:02:28 +0000 (+0200) Subject: Better hls warn/error logging X-Git-Tag: v3.2.0-rc.1~154 X-Git-Url: https://git.immae.eu/?a=commitdiff_plain;h=48d7e4ad13bda061c4f75e32cda4a4f579dc4302;p=github%2FChocobozzz%2FPeerTube.git Better hls warn/error logging --- diff --git a/client/src/assets/player/p2p-media-loader/hls-plugin.ts b/client/src/assets/player/p2p-media-loader/hls-plugin.ts index 672a85d0b..53969a5a5 100644 --- a/client/src/assets/player/p2p-media-loader/hls-plugin.ts +++ b/client/src/assets/player/p2p-media-loader/hls-plugin.ts @@ -259,13 +259,17 @@ class Html5Hlsjs { const error: { message: string, code?: number } = { message: `HLS.js error: ${data.type} - fatal: ${data.fatal} - ${data.details}` } - console.error(error.message) // increment/set error count if (this.errorCounts[ data.type ]) this.errorCounts[ data.type ] += 1 else this.errorCounts[ data.type ] = 1 - if (!data.fatal) return + if (!data.fatal) { + console.warn(error.message) + return + } + + console.error(error.message) if (data.type === Hlsjs.ErrorTypes.NETWORK_ERROR) { error.code = 2