Skip to content

Commit ae1ee71

Browse files
authored
Merge pull request #567 from MoYingJi/fix-ldc
fix(player): 修复极端状态下播放异常
2 parents 84d9c99 + 1a36fbf commit ae1ee71

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

src/utils/player.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -912,6 +912,10 @@ class Player {
912912
console.warn("⚠️ Player not ready for seek");
913913
return;
914914
}
915+
if (time < 0 || time > this.player.duration()) {
916+
console.warn("⚠️ Invalid seek time", time);
917+
time = Math.max(0, Math.min(time, this.player.duration()));
918+
}
915919
this.player.seek(time);
916920
statusStore.currentTime = time;
917921
}

0 commit comments

Comments
 (0)