Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: adjust dynascale debouncing for upscaling and downscaling #1621

Merged
merged 2 commits into from
Dec 17, 2024

Conversation

myandrienko
Copy link
Contributor

We currently debounce requests to update participant subscriptions when a bound video element size changes with a delay of 1200ms. That's too long of delay, but there are also other considerations.

Not all size changes are equal: when upscaling, low quality video in a larger video element is very noticeable; high quality video in a smaller video element for a second or two is not a big deal.

Proposal:

  1. When a video element upscales significantly (currently that means that either width or height went up more than 20%), update participant subscription with minimal debouncing.
  2. When a video element upscales a little, debounce more aggressively, to guard against quick-firing resize events.
  3. When a video element downscales, it's also fine to debounce more aggressively. That will guard us against switching to lower quality when several people are talking over other and the dominant speaker changes quickly.

Comment on lines 429 to 433
// the participant just started to publish a track
requestTrackWithDimensions(DebounceType.FAST, {
requestTrackWithDimensions(DebounceType.IMMEDIATE, {
width: videoElement.clientWidth,
height: videoElement.clientHeight,
});
Copy link
Contributor Author

@myandrienko myandrienko Dec 12, 2024

Choose a reason for hiding this comment

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

For this case (subscribing after a participant started to publish video), do we even need debouncing? I think it would be nice to just subscribe immediately. But for now, I've just set minimal debouncing timeout here.

@myandrienko myandrienko merged commit 7b3a721 into main Dec 17, 2024
11 checks passed
@myandrienko myandrienko deleted the smart-dynascale-debounce branch December 17, 2024 11:00
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.

2 participants