fix(webui): preserve video ended state by skipping playhead snap on ended

This commit is contained in:
yiling
2026-07-01 14:46:12 +08:00
parent d71b0de056
commit d0bda60b9f
@@ -126,8 +126,11 @@ export function useFramePlayer(
setCurrentFrame(clamped)
// Snap the playhead to the center of the paused frame to align browser compositor
const safeCenterTime = calculateFrameCenterTime(clamped, frameRate)
video.currentTime = safeCenterTime
// Skip snapping if the video has ended to preserve the native ended state and allow native replay
if (!video.ended) {
const safeCenterTime = calculateFrameCenterTime(clamped, frameRate)
video.currentTime = safeCenterTime
}
}
video.addEventListener('play', handlePlay)