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

Debounce mediastreamtrack mute events #809

Merged
merged 2 commits into from
Jul 27, 2023
Merged

Debounce mediastreamtrack mute events #809

merged 2 commits into from
Jul 27, 2023

Conversation

lukasIO
Copy link
Contributor

@lukasIO lukasIO commented Jul 26, 2023

For OBS virtual cameras (and reportedly also other devices) mediastreamtrack muted events get emitted in a regular interval, followed by unmute events.
In order to avoid this resulting in a constant pauseUpstream -> resumeUpstream loop, we debounce the mute event so that we only pick it up if the track has been muted consistently for > 5s.

@changeset-bot
Copy link

changeset-bot bot commented Jul 26, 2023

🦋 Changeset detected

Latest commit: c36ebe8

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

This PR includes changesets to release 1 package
Name Type
livekit-client 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

@github-actions
Copy link
Contributor

github-actions bot commented Jul 26, 2023

size-limit report 📦

Path Size
dist/livekit-client.esm.mjs 75.84 KB (+0.17% 🔺)
dist/livekit-client.umd.js 80.36 KB (+0.14% 🔺)

Copy link
Member

@davidzhao davidzhao left a comment

Choose a reason for hiding this comment

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

lgtm!

I tested a few different scenarios. I think muted handling is still needed because sometimes when the computer is put to sleep (closing MacBook cover), Safari still keeps the session and device active. to the other party, it could look like a black tile.

This is a good change to avoid flopping though.

@davidzhao davidzhao merged commit fb8208e into main Jul 27, 2023
@davidzhao davidzhao deleted the lukas/debounce-pause branch July 27, 2023 18:36
@github-actions github-actions bot mentioned this pull request Jul 27, 2023
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