Skip to content

fix(audio): silence removed remote tracks in Chromium - #228

Merged
ravindra-cloudflare merged 1 commit into
cloudflare:stagingfrom
yash-garg:fix/chromium-remote-audio-mute
Dec 1, 2026
Merged

ravindra-cloudflare merged 1 commit into
cloudflare:stagingfrom
yash-garg:fix/chromium-remote-audio-mute

Conversation

@yash-garg

@yash-garg yash-garg commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

Description

With two SIP callers in a meeting, Chrome could keep playing a muted caller while the other caller was audible. The fix detaches the audio element before removing the muted track, then resumes playback for the remaining caller.

Related LiveKit PR #2234

@clanky-the-clanker

clanky-the-clanker Bot commented Dec 1, 2026 •

Copy link
Copy Markdown

This pull request's reviews are posted as pull request reviews: see the review of cbd75e0b.

@realtimekit-devprod

Copy link
Copy Markdown
Member

clanky review

@clanky-the-clanker clanky-the-clanker Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Superseded by the review of 67b06e5e.

This review, of cbd75e0b

💬 Approved with comments — Small, targeted fix. One non-blocking question about whether browserSpecs.isChromiumBased() exists in the minimum supported SDK version.

Findings: 1 question

The decision is advisory: this review is a comment and never approves, blocks or requests changes on the pull request.

🔧 Fix with your agent

Paste the following into your coding agent to investigate and fix these issues.

Fix the following code review issues found in pull request #228.

Before making changes, review each issue and present a brief summary table:
- For each finding, state whether you agree, disagree, or need clarification
- If you disagree (e.g., the fix would require disproportionate changes
  for minimal ROI, or the finding is factually incorrect), explain why
- If you need to clarify something before deciding, ask those questions
- Then share your plan for which issues to tackle and in what order

## QUESTIONS (1)

### [Code reviewer] Does the minimum supported SDK version (per `packages/core/package.json`) expose `browserSpecs.isChromiumBased()`? It is called unguarded, so a missing method would throw before the track is removed.
- **File:** packages/core/src/lib/audio.ts:97

📋 Code reviewer: ❓ 1 question

Chromium rebind logic is sound; one question about the SDK method it depends on.

Recommendation: 💬 Optional Nits

  • [QUESTION] Does the minimum supported SDK version (per packages/core/package.json) expose browserSpecs.isChromiumBased()? It is called unguarded, so a missing method would throw before the track is removed. (packages/core/src/lib/audio.ts:97)
View full review

isChromiumBased() is not used anywhere else in this repo, and the only other browserSpecs use is isFirefox, which goes through an optional-chaining helper. If the minimum supported SDK version lacks the method, removeTrack throws before audioStream.removeTrack runs, which would leave the stale track in the stream. A helper in utils/browser.ts using optional chaining would degrade to the old behaviour instead. The new rebind path also has no test.


Reviewed commit: cbd75e0b

@ravindra-cloudflare

Copy link
Copy Markdown
Collaborator

Please add test cases.

@yash-garg
yash-garg force-pushed the fix/chromium-remote-audio-mute branch from cbd75e0 to 67b06e5 Compare December 1, 2026 09:11
@ravindra-cloudflare

Copy link
Copy Markdown
Collaborator

clanky review

@clanky-the-clanker clanky-the-clanker Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💬 Approved with comments — The fix is targeted and the requested tests have been added. One non-blocking question remains: whether browserSpecs.isChromiumBased() exists in every SDK version the package supports.

Findings: 1 question

The decision is advisory: this review is a comment and never approves, blocks or requests changes on the pull request.

🔧 Fix with your agent

Paste the following into your coding agent to investigate and fix these issues.

Fix the following code review issues found in pull request #228.

Before making changes, review each issue and present a brief summary table:
- For each finding, state whether you agree, disagree, or need clarification
- If you disagree (e.g., the fix would require disproportionate changes
  for minimal ROI, or the finding is factually incorrect), explain why
- If you need to clarify something before deciding, ask those questions
- Then share your plan for which issues to tackle and in what order

## QUESTIONS (1)

### [Code Quality] Does every `@cloudflare/realtimekit` version allowed by `^2.2.0-staging.14` provide `browserSpecs.isChromiumBased()`? It is called without a guard. If it is missing, `removeTrack` throws before the track is removed, and the muted caller keeps playing.
- **File:** packages/core/src/lib/audio.ts:97

📋 Code Quality: ❓ 1 question

One open question about SDK compatibility; the new tests cover the rebind path.

Recommendation: 💬 Optional Nits

  • [QUESTION] Does every @cloudflare/realtimekit version allowed by ^2.2.0-staging.14 provide browserSpecs.isChromiumBased()? It is called without a guard. If it is missing, removeTrack throws before the track is removed, and the muted caller keeps playing. (packages/core/src/lib/audio.ts:97)
View full review

The rebind logic in packages/core/src/lib/audio.ts:94-101 is sound:

  • play() is called again only when a physical track was removed and other tracks remain.
  • Rebinding is skipped while the element is paused.
  • play() handles its own errors.

The new packages/core/src/lib/audio.spec.ts covers the Chromium rebind, the last-mute/unmute cycle, shared-track ownership across reconnects, and the non-Chromium and paused cases.

One question from the earlier review is still open. browserSpecs.isChromiumBased() is called without a guard, and packages/core/package.json accepts @cloudflare/realtimekit ^2.2.0-staging.14. If a version in that range lacks the method, removeTrack throws before audioStream.removeTrack runs, and the muted caller keeps playing.


✅ All other checks passed

🔒 Security: ✅ LGTM

No security concerns in this change.


📖 AGENTS.md: ✅ LGTM

The change follows the repository's conventions.


⚡ Performance: ✅ LGTM

No performance concerns.


📝 Documentation: ✅ LGTM

No documentation concerns.


Reviewed commit: 67b06e5e

@ravindra-cloudflare
ravindra-cloudflare merged commit ac8f737 into cloudflare:staging Dec 1, 2026
3 checks passed
github-actions Bot pushed a commit that referenced this pull request Dec 1, 2026
@github-actions

github-actions Bot commented Dec 1, 2026

Copy link
Copy Markdown

🎉 This PR is included in version 2.2.0-staging.11 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

github-actions Bot pushed a commit that referenced this pull request Dec 2, 2026
# [2.2.0](https://github.com/cloudflare/realtimekit-ui/compare/@cloudflare/realtimekit-ui-v2.1.0...@cloudflare/realtimekit-ui-v2.2.0) (2026-12-02)

### Bug Fixes

* **audio:** silence removed remote tracks in Chromium ([#228](#228)) ([ac8f737](ac8f737))
* **firefox:** device list was not refreshed, speakers were never there ([#224](#224)) ([d9d0978](d9d0978))
* **logs:** upgrading realtimekit for proper type ([d8fc02b](d8fc02b))
* **media-toggles:** hiding speakers for safari to be consistent, added permission hints ([#229](#229)) ([27e3de9](27e3de9))
* **notifications:** do not emit notifications for reconnecting participants ([#218](#218)) ([c77533b](c77533b))
* **notifications:** ensure backward compatibility for existing users ([#226](#226)) ([2857659](2857659))
* **pip:** showing hls player for livestream viewer ([#225](#225)) ([fd117fb](fd117fb))
* **rtk-screenshare-view:** when a viewer reconnects, they do not inform sharer of their state ([#227](#227)) ([02996eb](02996eb))
* **screenshare:** added override to disable screenshare tracking, if customers want to ([#222](#222)) ([c8bcf73](c8bcf73))
* **sdk-version-reporting:** report ui kit sdk name and versions ([8d87b6b](8d87b6b))

### Features

* **device-list-alongside-media-toggles:** rtk-mic-toggle & rtk-camera-toggle now have device dropdowns and slots for noise cancellation and video effects ([#214](#214)) ([bb71819](bb71819))
* **notifications:** ability to customize notification sound, duration, and toggle ([#220](#220)) ([5869c2d](5869c2d))
* **pip:** added screenshare support in PIP, fixed every known pip bug ([#213](#213)) ([d7b28b4](d7b28b4))
* **screenshare:** answering the question that gets asked in every meeting - can you see my screen ([#217](#217)) ([33a08b4](33a08b4))

skip-checks: true
@github-actions

github-actions Bot commented Dec 2, 2026

Copy link
Copy Markdown

🎉 This PR is included in version 2.2.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants