Correctlu throws an error on manifestIncompatibleCodecsError
This commit is contained in:
parent
ffd970faf9
commit
e25f83ce21
|
@ -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) {
|
if (data.type === Hlsjs.ErrorTypes.NETWORK_ERROR) {
|
||||||
switch (data.type) {
|
|
||||||
case Hlsjs.ErrorTypes.NETWORK_ERROR:
|
|
||||||
console.info('bubbling network error up to VIDEOJS')
|
console.info('bubbling network error up to VIDEOJS')
|
||||||
error.code = 2
|
error.code = 2
|
||||||
this.tech.error = () => error as any
|
this.tech.error = () => error as any
|
||||||
this.tech.trigger('error')
|
this.tech.trigger('error')
|
||||||
break
|
} else if (data.type === Hlsjs.ErrorTypes.MEDIA_ERROR && data.details !== 'manifestIncompatibleCodecsError') {
|
||||||
|
|
||||||
case Hlsjs.ErrorTypes.MEDIA_ERROR:
|
|
||||||
error.code = 3
|
error.code = 3
|
||||||
this._handleMediaError(error)
|
this._handleMediaError(error)
|
||||||
break
|
} else {
|
||||||
|
|
||||||
default:
|
|
||||||
// cannot recover
|
|
||||||
this.hls.destroy()
|
this.hls.destroy()
|
||||||
console.info('bubbling error up to VIDEOJS')
|
console.info('bubbling error up to VIDEOJS')
|
||||||
this.tech.error = () => error as any
|
this.tech.error = () => error as any
|
||||||
this.tech.trigger('error')
|
this.tech.trigger('error')
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue