Skip to content

Commit

Permalink
[Video] Throw error when playback fails (#5132)
Browse files Browse the repository at this point in the history
  • Loading branch information
haileyok authored Sep 4, 2024
1 parent dee28f3 commit d94ff26
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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])

Expand Down

0 comments on commit d94ff26

Please sign in to comment.