Skip to content

Commit

Permalink
fix: add delay before retrying video playback on error
Browse files Browse the repository at this point in the history
  • Loading branch information
jimchen5209 committed Feb 23, 2025
1 parent a6cc157 commit 5e318e1
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/components/centerBlock/OverlayPlayer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -113,13 +113,13 @@ const handlePlayerError = (event) => {
// Try recover video
if (event.type === 'error') {
videoRef.value.pause()
const time = videoRef.value.currentTime
videoRef.value.load()
videoRef.value.currentTime = time
videoRef.value.play()
.then(() => isVideoError.value = false).catch((err) => console.error(err))
.then(() => updatePlayerStatus())
setTimeout(() => {
videoRef.value.pause()
const time = videoRef.value.currentTime
videoRef.value.load()
videoRef.value.currentTime = time
videoRef.value.play()
}, 5 * 1000);
}
}
Expand Down

0 comments on commit 5e318e1

Please sign in to comment.