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.ts7
1 files changed, 6 insertions, 1 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 421ce4934..640858025 100644
--- a/client/src/assets/player/p2p-media-loader/hls-plugin.ts
+++ b/client/src/assets/player/p2p-media-loader/hls-plugin.ts
@@ -89,6 +89,8 @@ class Html5Hlsjs {
89 private readonly source: videojs.Tech.SourceObject 89 private readonly source: videojs.Tech.SourceObject
90 private readonly vjs: typeof videojs 90 private readonly vjs: typeof videojs
91 91
92 private maxNetworkErrorRecovery = 5
93
92 private hls: Hlsjs 94 private hls: Hlsjs
93 private hlsjsConfig: Partial<HlsConfig & { cueHandler: any }> = null 95 private hlsjsConfig: Partial<HlsConfig & { cueHandler: any }> = null
94 96
@@ -225,7 +227,7 @@ class Html5Hlsjs {
225 } 227 }
226 228
227 private _handleNetworkError (error: any) { 229 private _handleNetworkError (error: any) {
228 if (this.errorCounts[Hlsjs.ErrorTypes.NETWORK_ERROR] <= 5) { 230 if (this.errorCounts[Hlsjs.ErrorTypes.NETWORK_ERROR] <= this.maxNetworkErrorRecovery) {
229 console.info('trying to recover network error') 231 console.info('trying to recover network error')
230 232
231 // Wait 1 second and retry 233 // Wait 1 second and retry
@@ -371,6 +373,9 @@ class Html5Hlsjs {
371 this.dvrDuration = data.details.totalduration 373 this.dvrDuration = data.details.totalduration
372 374
373 this._duration = this.isLive ? Infinity : data.details.totalduration 375 this._duration = this.isLive ? Infinity : data.details.totalduration
376
377 // Increase network error recovery for lives since they can be broken (server restart, stream interruption etc)
378 if (this.isLive) this.maxNetworkErrorRecovery = 300
374 }) 379 })
375 380
376 this.hls.once(Hlsjs.Events.FRAG_LOADED, () => { 381 this.hls.once(Hlsjs.Events.FRAG_LOADED, () => {