mirror of
https://github.com/shumaiOne/shumai.git
synced 2026-11-22 23:10:13 +00:00
Merge pull request #162 from shumaiOne/fix/video-replay
fix(webui): preserve video ended state by skipping playhead snap on ended
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user