aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/assets/player/p2p-media-loader/hls-plugin.ts
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/assets/player/p2p-media-loader/hls-plugin.ts')
-rw-r--r--client/src/assets/player/p2p-media-loader/hls-plugin.ts16
1 files changed, 6 insertions, 10 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 53969a5a5..3050110cd 100644
--- a/client/src/assets/player/p2p-media-loader/hls-plugin.ts
+++ b/client/src/assets/player/p2p-media-loader/hls-plugin.ts
@@ -264,20 +264,16 @@ class Html5Hlsjs {
264 if (this.errorCounts[ data.type ]) this.errorCounts[ data.type ] += 1 264 if (this.errorCounts[ data.type ]) this.errorCounts[ data.type ] += 1
265 else this.errorCounts[ data.type ] = 1 265 else this.errorCounts[ data.type ] = 1
266 266
267 if (!data.fatal) { 267 if (data.fatal) console.warn(error.message)
268 console.warn(error.message) 268 else console.error(error.message, data)
269 return
270 }
271
272 console.error(error.message)
273 269
274 if (data.type === Hlsjs.ErrorTypes.NETWORK_ERROR) { 270 if (data.type === Hlsjs.ErrorTypes.NETWORK_ERROR) {
275 error.code = 2 271 error.code = 2
276 this._handleNetworkError(error) 272 this._handleNetworkError(error)
277 } else if (data.type === Hlsjs.ErrorTypes.MEDIA_ERROR && data.details !== 'manifestIncompatibleCodecsError') { 273 } else if (data.fatal && data.type === Hlsjs.ErrorTypes.MEDIA_ERROR && data.details !== 'manifestIncompatibleCodecsError') {
278 error.code = 3 274 error.code = 3
279 this._handleMediaError(error) 275 this._handleMediaError(error)
280 } else { 276 } else if (data.fatal) {
281 this.hls.destroy() 277 this.hls.destroy()
282 console.info('bubbling error up to VIDEOJS') 278 console.info('bubbling error up to VIDEOJS')
283 this.tech.error = () => error as any 279 this.tech.error = () => error as any
@@ -286,12 +282,12 @@ class Html5Hlsjs {
286 } 282 }
287 283
288 private switchQuality (qualityId: number) { 284 private switchQuality (qualityId: number) {
289 this.hls.nextLevel = qualityId 285 this.hls.currentLevel = qualityId
290 } 286 }
291 287
292 private _levelLabel (level: Hlsjs.Level) { 288 private _levelLabel (level: Hlsjs.Level) {
293 if (this.player.srOptions_.levelLabelHandler) { 289 if (this.player.srOptions_.levelLabelHandler) {
294 return this.player.srOptions_.levelLabelHandler(level) 290 return this.player.srOptions_.levelLabelHandler(level as any)
295 } 291 }
296 292
297 if (level.height) return level.height + 'p' 293 if (level.height) return level.height + 'p'