Skip to content

Commit

Permalink
✔ Fixed preview stutter on video loop
Browse files Browse the repository at this point in the history
  • Loading branch information
vassbo committed Jul 29, 2024
1 parent 52ee5fb commit 6f02345
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/frontend/components/output/layers/BackgroundMedia.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@
$: if (mirror && $videosData[outputId]?.paused) videoData.paused = true
$: if (mirror && $videosData[outputId]?.paused === false) videoData.paused = false
$: if (mirror && $videosTime[outputId]) {
$: if (mirror && $videosTime[outputId] !== undefined) setPreviewVideoTime()
function setPreviewVideoTime() {
const diff = Math.abs($videosTime[outputId] - videoTime)
if (diff > 0.5) {
videoTime = $videosTime[outputId]
Expand Down Expand Up @@ -152,7 +153,7 @@
const speed = 0.01
const margin = 0.9 // video should fade to 0 before clearing
function fadeoutVideo() {
if (!video || !fadingOut || !duration) return
if (mirror || !video || !fadingOut || !duration) return
let time = duration * speed * margin
setTimeout(() => {
Expand Down

0 comments on commit 6f02345

Please sign in to comment.