]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/commitdiff
Better hls warn/error logging
authorChocobozzz <me@florianbigard.com>
Wed, 21 Apr 2021 08:02:28 +0000 (10:02 +0200)
committerChocobozzz <me@florianbigard.com>
Wed, 21 Apr 2021 13:18:22 +0000 (15:18 +0200)
client/src/assets/player/p2p-media-loader/hls-plugin.ts

index 672a85d0b0525bfd1d54bf9ed0982d8ca81f6610..53969a5a502b91df146d0a295756b3d72fe72f4d 100644 (file)
@@ -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