Skip to content

fix: don't break render loop if video is paused#121

Merged
1egoman merged 2 commits intolivekit:mainfrom
holzgeist:fix-failing-render-loop
Feb 6, 2026
Merged

fix: don't break render loop if video is paused#121
1egoman merged 2 commits intolivekit:mainfrom
holzgeist:fix-failing-render-loop

Conversation

@holzgeist
Copy link
Copy Markdown
Contributor

@1egoman and one more PR from me (hopefully I manage to be more responsive in the future 😄)

Whenever the "Video is paused" warning showed up in the logs, blurring stopped completely for both local and remote participants.
I'm not sure how to trigger this condition, for me on latest Firefox it happens once every ~5-10 times when enabling the video after reloading the page. It's probably some race condition in the browser or my code. In any case, the current handling breaks the render loop completely which is an easy fix

I'm not sure if requestAnimationFrame is the correct way to go, setTimeout(renderLoop, 0) works as well.

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Feb 4, 2026

🦋 Changeset detected

Latest commit: c0461fc

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@livekit/track-processors Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@1egoman
Copy link
Copy Markdown
Contributor

1egoman commented Feb 5, 2026

@holzgeist Thanks for the pull request! I will admit I am a bit hesitant to introduce something like this without understanding the problem a bit deeper as introducing a delay like this could mask larger problems.

There is a related type of "hack" being done in client-sdk-js here that might be worth looking at. It mentions track processor restarting as a potential cause, maybe that is a factor that could be leading to the issue?

@lukasIO The git blame says you wrote the above linked code. Do you remember any context about what it was trying to solve and does it potentially seem related to what this issue is addressing?

Copy link
Copy Markdown
Contributor

@lukasIO lukasIO left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This makes sense to me!

I don't think this change would be delaying anything but rather just ensure that we keep the loop running while the source is paused.

as we're using the requestAnimationFrame pattern further down in the render loop, too, I'd just stick with that.

@1egoman
Copy link
Copy Markdown
Contributor

1egoman commented Feb 6, 2026

Ah, I seem to have misread the diff when I first looked at this. I think that's fairly reasonable, sounds good.

@1egoman 1egoman merged commit 93329f1 into livekit:main Feb 6, 2026
1 check passed
@holzgeist holzgeist deleted the fix-failing-render-loop branch February 11, 2026 08:09
@github-actions github-actions Bot mentioned this pull request Feb 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants