Skip to content

Commit 1a36fbf

Browse files
committed
fix(player): 修复极端状态下播放异常
由于 `jumpSeek` 现在会减去 `offset`,可能会导致当 `offset` 超出预期时引发一些奇怪的行为
1 parent 236ee0a commit 1a36fbf

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)