[Video] Throw error when playback fails (#5132)

This commit is contained in:
Hailey
2024-09-04 08:06:58 -07:00
committed by GitHub
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])