diff options
author | Chocobozzz <me@florianbigard.com> | 2021-04-21 10:02:28 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-04-21 15:18:22 +0200 |
commit | 48d7e4ad13bda061c4f75e32cda4a4f579dc4302 (patch) | |
tree | 6eb01b3a5f57d09b0fe408cb6d61c32176f5ef8c /client/src/assets/player | |
parent | e8bb5b6b3a1e4c2aeab368f01cc5092d8478b893 (diff) | |
download | PeerTube-48d7e4ad13bda061c4f75e32cda4a4f579dc4302.tar.gz PeerTube-48d7e4ad13bda061c4f75e32cda4a4f579dc4302.tar.zst PeerTube-48d7e4ad13bda061c4f75e32cda4a4f579dc4302.zip |
Better hls warn/error logging
Diffstat (limited to 'client/src/assets/player')
-rw-r--r-- | client/src/assets/player/p2p-media-loader/hls-plugin.ts | 8 |
1 files changed, 6 insertions, 2 deletions
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 { | |||
259 | const error: { message: string, code?: number } = { | 259 | const error: { message: string, code?: number } = { |
260 | message: `HLS.js error: ${data.type} - fatal: ${data.fatal} - ${data.details}` | 260 | message: `HLS.js error: ${data.type} - fatal: ${data.fatal} - ${data.details}` |
261 | } | 261 | } |
262 | console.error(error.message) | ||
263 | 262 | ||
264 | // increment/set error count | 263 | // increment/set error count |
265 | if (this.errorCounts[ data.type ]) this.errorCounts[ data.type ] += 1 | 264 | if (this.errorCounts[ data.type ]) this.errorCounts[ data.type ] += 1 |
266 | else this.errorCounts[ data.type ] = 1 | 265 | else this.errorCounts[ data.type ] = 1 |
267 | 266 | ||
268 | if (!data.fatal) return | 267 | if (!data.fatal) { |
268 | console.warn(error.message) | ||
269 | return | ||
270 | } | ||
271 | |||
272 | console.error(error.message) | ||
269 | 273 | ||
270 | if (data.type === Hlsjs.ErrorTypes.NETWORK_ERROR) { | 274 | if (data.type === Hlsjs.ErrorTypes.NETWORK_ERROR) { |
271 | error.code = 2 | 275 | error.code = 2 |