mirror of https://github.com/Chocobozzz/PeerTube
Fix hls error handling
parent
789951460b
commit
d0dd9813d5
|
@ -124,8 +124,11 @@ class Html5Hlsjs {
|
||||||
|
|
||||||
this.videoElement.addEventListener('error', event => {
|
this.videoElement.addEventListener('error', event => {
|
||||||
let errorTxt: string
|
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) {
|
switch (mediaError.code) {
|
||||||
case mediaError.MEDIA_ERR_ABORTED:
|
case mediaError.MEDIA_ERR_ABORTED:
|
||||||
errorTxt = 'You aborted the video playback'
|
errorTxt = 'You aborted the video playback'
|
||||||
|
|
Loading…
Reference in New Issue