mirror of
https://github.com/shumaiOne/shumai.git
synced 2026-12-02 14:04:50 +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)
|
setCurrentFrame(clamped)
|
||||||
|
|
||||||
// Snap the playhead to the center of the paused frame to align browser compositor
|
// Snap the playhead to the center of the paused frame to align browser compositor
|
||||||
const safeCenterTime = calculateFrameCenterTime(clamped, frameRate)
|
// Skip snapping if the video has ended to preserve the native ended state and allow native replay
|
||||||
video.currentTime = safeCenterTime
|
if (!video.ended) {
|
||||||
|
const safeCenterTime = calculateFrameCenterTime(clamped, frameRate)
|
||||||
|
video.currentTime = safeCenterTime
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
video.addEventListener('play', handlePlay)
|
video.addEventListener('play', handlePlay)
|
||||||
|
|||||||
Reference in New Issue
Block a user