aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/assets/player
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/assets/player')
-rw-r--r--client/src/assets/player/p2p-media-loader/hls-plugin.ts37
1 files changed, 14 insertions, 23 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 ca7a341b4..4283fc7dd 100644
--- a/client/src/assets/player/p2p-media-loader/hls-plugin.ts
+++ b/client/src/assets/player/p2p-media-loader/hls-plugin.ts
@@ -243,30 +243,21 @@ class Html5Hlsjs {
243 if (this.errorCounts[ data.type ]) this.errorCounts[ data.type ] += 1 243 if (this.errorCounts[ data.type ]) this.errorCounts[ data.type ] += 1
244 else this.errorCounts[ data.type ] = 1 244 else this.errorCounts[ data.type ] = 1
245 245
246 // Implement simple error handling based on hls.js documentation 246 if (!data.fatal) return
247 // https://github.com/dailymotion/hls.js/blob/master/API.md#fifth-step-error-handling
248 if (data.fatal) {
249 switch (data.type) {
250 case Hlsjs.ErrorTypes.NETWORK_ERROR:
251 console.info('bubbling network error up to VIDEOJS')
252 error.code = 2
253 this.tech.error = () => error as any
254 this.tech.trigger('error')
255 break
256
257 case Hlsjs.ErrorTypes.MEDIA_ERROR:
258 error.code = 3
259 this._handleMediaError(error)
260 break
261 247
262 default: 248 if (data.type === Hlsjs.ErrorTypes.NETWORK_ERROR) {
263 // cannot recover 249 console.info('bubbling network error up to VIDEOJS')
264 this.hls.destroy() 250 error.code = 2
265 console.info('bubbling error up to VIDEOJS') 251 this.tech.error = () => error as any
266 this.tech.error = () => error as any 252 this.tech.trigger('error')
267 this.tech.trigger('error') 253 } else if (data.type === Hlsjs.ErrorTypes.MEDIA_ERROR && data.details !== 'manifestIncompatibleCodecsError') {
268 break 254 error.code = 3
269 } 255 this._handleMediaError(error)
256 } else {
257 this.hls.destroy()
258 console.info('bubbling error up to VIDEOJS')
259 this.tech.error = () => error as any
260 this.tech.trigger('error')
270 } 261 }
271 } 262 }
272 263