From 48d7e4ad13bda061c4f75e32cda4a4f579dc4302 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 21 Apr 2021 10:02:28 +0200 Subject: Better hls warn/error logging --- client/src/assets/player/p2p-media-loader/hls-plugin.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'client/src/assets/player') 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 -- cgit v1.2.3