Correctlu throws an error on manifestIncompatibleCodecsError
This commit is contained in:
parent
ffd970faf9
commit
e25f83ce21
1 changed files with 14 additions and 23 deletions
|
@ -243,30 +243,21 @@ class Html5Hlsjs {
|
||||||
if (this.errorCounts[ data.type ]) this.errorCounts[ data.type ] += 1
|
if (this.errorCounts[ data.type ]) this.errorCounts[ data.type ] += 1
|
||||||
else this.errorCounts[ data.type ] = 1
|
else this.errorCounts[ data.type ] = 1
|
||||||
|
|
||||||
// Implement simple error handling based on hls.js documentation
|
if (!data.fatal) return
|
||||||
// https://github.com/dailymotion/hls.js/blob/master/API.md#fifth-step-error-handling
|
|
||||||
if (data.fatal) {
|
|
||||||
switch (data.type) {
|
|
||||||
case Hlsjs.ErrorTypes.NETWORK_ERROR:
|
|
||||||
console.info('bubbling network error up to VIDEOJS')
|
|
||||||
error.code = 2
|
|
||||||
this.tech.error = () => error as any
|
|
||||||
this.tech.trigger('error')
|
|
||||||
break
|
|
||||||
|
|
||||||
case Hlsjs.ErrorTypes.MEDIA_ERROR:
|
if (data.type === Hlsjs.ErrorTypes.NETWORK_ERROR) {
|
||||||
error.code = 3
|
console.info('bubbling network error up to VIDEOJS')
|
||||||
this._handleMediaError(error)
|
error.code = 2
|
||||||
break
|
this.tech.error = () => error as any
|
||||||
|
this.tech.trigger('error')
|
||||||
default:
|
} else if (data.type === Hlsjs.ErrorTypes.MEDIA_ERROR && data.details !== 'manifestIncompatibleCodecsError') {
|
||||||
// cannot recover
|
error.code = 3
|
||||||
this.hls.destroy()
|
this._handleMediaError(error)
|
||||||
console.info('bubbling error up to VIDEOJS')
|
} else {
|
||||||
this.tech.error = () => error as any
|
this.hls.destroy()
|
||||||
this.tech.trigger('error')
|
console.info('bubbling error up to VIDEOJS')
|
||||||
break
|
this.tech.error = () => error as any
|
||||||
}
|
this.tech.trigger('error')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue