+ private _handleNetworkError (error: any) {
+ if (this.errorCounts[ Hlsjs.ErrorTypes.NETWORK_ERROR] <= 5) {
+ console.info('trying to recover network error')
+
+ // Wait 1 second and retry
+ setTimeout(() => this.hls.startLoad(), 1000)
+
+ // Reset error count on success
+ this.hls.once(Hlsjs.Events.FRAG_LOADED, () => {
+ this.errorCounts[ Hlsjs.ErrorTypes.NETWORK_ERROR] = 0
+ })
+
+ return
+ }
+
+ console.info('bubbling network error up to VIDEOJS')
+ this.hls.destroy()
+ this.tech.error = () => error
+ this.tech.trigger('error')
+ }
+