Fix hls error handling

pull/3672/head
Chocobozzz 2021-01-29 14:03:30 +01:00
parent 789951460b
commit d0dd9813d5
No known key found for this signature in database
GPG Key ID: 583A612D890159BE
1 changed files with 4 additions and 1 deletions

View File

@ -124,8 +124,11 @@ class Html5Hlsjs {
this.videoElement.addEventListener('error', event => {
let errorTxt: string
const mediaError = (event.currentTarget as HTMLVideoElement).error
const mediaError = ((event.currentTarget || event.target) as HTMLVideoElement).error
if (!mediaError) return
console.log(mediaError)
switch (mediaError.code) {
case mediaError.MEDIA_ERR_ABORTED:
errorTxt = 'You aborted the video playback'