mirror of
https://github.com/webadderallorg/Recordly.git
synced 2026-09-28 08:45:41 +00:00
good catch. Stopping seek is timeline seeking only
This commit is contained in:
@@ -3274,18 +3274,22 @@ export default function VideoEditor() {
|
||||
setAutoSuggestZoomsTrigger(0);
|
||||
}, []);
|
||||
|
||||
function handleSeek(time: number) {
|
||||
function handleSeek(time: number, options: { pause?: boolean } = {}) {
|
||||
const playback = videoPlaybackRef.current;
|
||||
const video = playback?.video;
|
||||
if (!video) return;
|
||||
|
||||
if (!video.paused) {
|
||||
if (options.pause && !video.paused) {
|
||||
playback?.pause();
|
||||
}
|
||||
|
||||
video.currentTime = mapTimelineTimeToSourceTime(time * 1000) / 1000;
|
||||
}
|
||||
|
||||
const handleTimelineSeek = useCallback((time: number) => {
|
||||
handleSeek(time, { pause: true });
|
||||
}, []);
|
||||
|
||||
const handleSelectZoom = useCallback((id: string | null) => {
|
||||
setSelectedZoomId(id);
|
||||
if (id) {
|
||||
@@ -6271,7 +6275,7 @@ export default function VideoEditor() {
|
||||
videoDuration={duration}
|
||||
currentTime={currentTime}
|
||||
playheadTime={timelinePlayheadTime}
|
||||
onSeek={handleSeek}
|
||||
onSeek={handleTimelineSeek}
|
||||
videoPath={videoPath}
|
||||
cursorTelemetry={normalizedCursorTelemetry}
|
||||
autoSuggestZoomsTrigger={autoSuggestZoomsTrigger}
|
||||
|
||||
Reference in New Issue
Block a user