[Video] Throw error when playback fails (#5132)
parent
dee28f378a
commit
d94ff2695d
|
@ -101,9 +101,18 @@ function VideoControls({
|
|||
setTimeRemaining(secondsRemaining)
|
||||
},
|
||||
)
|
||||
const statusSub = player.addListener(
|
||||
'statusChange',
|
||||
(status, _oldStatus, error) => {
|
||||
if (status === 'error') {
|
||||
throw error
|
||||
}
|
||||
},
|
||||
)
|
||||
return () => {
|
||||
volumeSub.remove()
|
||||
timeSub.remove()
|
||||
statusSub.remove()
|
||||
}
|
||||
}, [player])
|
||||
|
||||
|
|
Loading…
Reference in New Issue