Skip to content

Commit

Permalink
+ tried to fix the continuity of two videos
Browse files Browse the repository at this point in the history
  • Loading branch information
zonetecde committed Aug 24, 2024
1 parent f285e4f commit 6e0d651
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/lib/components/preview/VideoPreview.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
isMuted: false,
id: ''
};
$: currentAudio = $currentProject.timeline.audiosTracks[0].clips.find(
(audio) =>
(audio.start === 0 && audio.start <= $cursorPosition && audio.end >= $cursorPosition) ||
Expand Down
7 changes: 6 additions & 1 deletion src/lib/ext/Utilities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,17 @@ export function reajustCursorPosition() {
const video = get(currentProject).timeline.videosTracks[0].clips[i];
if (!videoPreviewElement.classList.contains(video.id)) {
totalDuration += video.duration;
console.log(totalDuration);
} else {
break;
}
}

cursorPosition.set(videoPreviewElement.currentTime * 1000 + totalDuration);
if (totalDuration > 0) {
setTimeout(() => {
cursorPosition.set(videoPreviewElement.currentTime * 1000 + totalDuration);
}, 500);
} else cursorPosition.set(videoPreviewElement.currentTime * 1000 + totalDuration);
}
}
}

0 comments on commit 6e0d651

Please sign in to comment.