Skip to content

fix(call): start meetings with mic and camera off - #214

Merged
Anuraj-dev merged 3 commits into
mainfrom
fix/default-media-off
Aug 18, 2026
Merged

fix(call): start meetings with mic and camera off#214
Anuraj-dev merged 3 commits into
mainfrom
fix/default-media-off

Conversation

@Anuraj-dev

Copy link
Copy Markdown
Owner

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

  • Keep lobby tracks acquired for device pickers, but start them disabled
  • Default startAudioOn / startVideoOn to false on instant-join and omitted flags
  • Honor an explicit unmute / camera-on from the lobby
  • Device swap while off stays off
  • SFU host-mute e2e turns the guest mic on first so there is a live producer to pause

Why

Joining a call should not surprise the room with live audio/video.

Testing

  • Unit tests (npm test --workspace=client — 250 passed; client typecheck passed)
  • Integration tests
  • Manual verification (localhost after PR)

Checklist

  • Scope is focused and atomic
  • No debug logs or dead code
  • Naming is clear and consistent
  • No unrelated changes
  • Follows code style guidelines

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.
@vercel

vercel Bot commented Aug 18, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
a-meet Ready Ready Preview Aug 18, 2026 5:37pm

@Anuraj-dev

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 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".

Comment on lines +148 to +149
const desiredAudioOnRef = useRef(devices.startAudioOn ?? false);
const desiredVideoOnRef = useRef(devices.startVideoOn ?? false);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge 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);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge 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; });

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge 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.
@Anuraj-dev

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Delightful!

Reviewed commit: 0b35d5f27d

ℹ️ 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".

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.
@Anuraj-dev
Anuraj-dev merged commit b69ff0f into main Aug 18, 2026
19 of 21 checks passed
@Anuraj-dev
Anuraj-dev deleted the fix/default-media-off branch August 18, 2026 17:58
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