fix(call): start meetings with mic and camera off - #214
Conversation
Lobby preview and the host instant-join path were turning both devices on as soon as getUserMedia succeeded. Join muted and camera-off unless the user turns them on.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5137ba670c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const desiredAudioOnRef = useRef(devices.startAudioOn ?? false); | ||
| const desiredVideoOnRef = useRef(devices.startVideoOn ?? false); |
There was a problem hiding this comment.
Disable tracks before publishing default-off producers
When either start flag is false—which is now the default for instant-created rooms—these refs only cause setupSfu to pause the producer after sendTransport.produce() has completed. The server creates and broadcasts that producer as unpaused in server/src/socket/sfu-handlers.ts:204-228, so existing participants can consume a brief burst of camera or microphone data while the UI already reports both devices off. Apply the desired state to the source tracks before producing, or create the server producer in a paused state.
Useful? React with 👍 / 👎.
| const [permissionDenied, setPermissionDenied] = useState(false); | ||
|
|
||
| const streamRef = useRef<MediaStream | null>(null); | ||
| const videoOnRef = useRef(false); |
There was a problem hiding this comment.
Correct the commit author before merge
The reviewed commit metadata identifies its author as Codex <codex@openai.com>, but this repository requires every commit and PR to be authored as Anuraj alone. Recreate this proposed commit with the required authorship before merging it.
AGENTS.md reference: AGENTS.md:L24-L24
Useful? React with 👍 / 👎.
| return; | ||
| } | ||
|
|
||
| stream.getTracks().forEach((t) => { t.enabled = false; }); |
There was a problem hiding this comment.
Disable the lobby microphone immediately after acquisition
On a first visit where audio permission resolves but the subsequent camera request remains pending, the new audio track stays enabled from the first getUserMedia result until this line runs after the camera request settles. A user can therefore have an active microphone—potentially for the lifetime of an unanswered camera prompt—despite the new off-by-default behavior; disable each acquired track before awaiting the next permission request.
Useful? React with 👍 / 👎.
Client lint rejected assigning video/audio refs during render. Update them in state setters, and pin device-swap-while-off plus both paused producers in tests.
|
@codex review |
|
Codex Review: Didn't find any major issues. Delightful! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
CI audit was red on ip-address, nanoid, postcss, socket.io-parser, and undici. Bump those in the workspace lockfiles so the high-level gate passes.
Summary
Meetings started with mic and camera on as soon as devices were granted. Lobby preview and the host New-meeting path now start muted and camera-off unless the user turns them on.
Changes
startAudioOn/startVideoOnto false on instant-join and omitted flagsWhy
Joining a call should not surprise the room with live audio/video.
Testing
npm test --workspace=client— 250 passed; client typecheck passed)Checklist