Skip to content

Publish and pause devices started or stopped while connected - #613

Closed
Magmusacy wants to merge 1 commit into
fix/publish-device-toggled-while-joiningfrom
fix/start-stop-device-while-connected
Closed

Magmusacy wants to merge 1 commit into
fix/publish-device-toggled-while-joiningfrom
fix/start-stop-device-while-connected

Conversation

@Magmusacy

Copy link
Copy Markdown
Collaborator

Stacked on #612.

Description

startMicrophone() / startCamera() and stopMicrophone() / stopCamera() now update the published track while connected, the same way toggleMicrophone() / toggleCamera() do.

  • Start while connected: publishes the device, or replaces the published track if there is one.
  • Stop while connected: stops the device immediately, then pauses the published track (paused: true).
  • toggleDevice now reuses the same start and stop logic, so the two paths can't drift apart.
  • Not connected: unchanged. A device started before joining is still published on joined; stopping after leaveRoom() sends nothing.

Motivation and Context

Start and stop only touched the local device, so the room fell out of sync:

  • stop, then start: the stopped track stayed published, so others heard silence for the rest of the call while the app showed the mic as on;
  • stop: others still saw the device as not paused;
  • start after joining: nothing was published.

On mobile, where muting is done by stopping the microphone, this made unmuting leave the user silent.

Checked:

  • startStopDeviceWhileConnected.spec.ts: 7 tests fail before the change, all 10 pass after; the full react-client suite passes.
  • On an Android emulator in a sandbox room: before, the sender kept the ended track after stop then start; after, stop paused the track and start put the live microphone back on the same published track.

Documentation impact

  • Documentation update required
  • Documentation updated in another PR
  • No documentation update required

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to
    not work as expected)

@linear

linear Bot commented Sep 18, 2026

Copy link
Copy Markdown

FCE-3857

@Magmusacy

Copy link
Copy Markdown
Collaborator Author

Parked for now, tracked in FCE-3857. Branch kept.

@Magmusacy Magmusacy closed this Sep 18, 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.

1 participant