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

Add composite option to allow join the call without microphone #5671

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

carocao-msft
Copy link
Contributor

What

Add composite option to allow join the call without microphone

Why

How Tested

Process & policy checklist

  • I have updated the project documentation to reflect my changes if necessary.
  • I have read the CONTRIBUTING documentation.

Is this a breaking change?

  • This change causes current functionality to break.

Copy link
Contributor

Copy link
Contributor

github-actions bot commented Feb 26, 2025

@azure/communication-react jest test coverage for stable.

Lines Statements Functions Branches
Base 28026 / 44693
62.7%
28026 / 44693
62.7%
786 / 1436
54.73%
2332 / 3708
62.89%
Current 28084 / 44693
62.83%
28084 / 44693
62.83%
786 / 1436
54.73%
2369 / 3738
63.37%
Diff 58 / 0
0.13%
58 / 0
0.13%
0 / 0
0%
37 / 30
0.48%

Copy link
Contributor

github-actions bot commented Feb 26, 2025

@azure/communication-react jest test coverage for beta.

Lines Statements Functions Branches
Base 58318 / 94260
61.86%
58318 / 94260
61.86%
1177 / 2693
43.7%
3538 / 5832
60.66%
Current 58290 / 94315
61.8%
58290 / 94315
61.8%
1177 / 2693
43.7%
3489 / 5800
60.15%
Diff -28 / 55
-0.06%
-28 / 55
-0.06%
0 / 0
0%
-49 / -32
-0.51%

@@ -797,6 +797,7 @@ export type CallCompositeOptions = {
spotlight?: {
hideSpotlightButtons?: boolean;
};
skipMicCheck?: boolean;
Copy link
Member

@JamesBurnside JamesBurnside Feb 27, 2025

Choose a reason for hiding this comment

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

This name needs to be more specific, it doesn't say what microphone checks are skipped, and could conflict with other microphone checks in the Composite experience. We should also try to always use microphone instead of mic. Consider:

Suggested change
skipMicCheck?: boolean;
joinCallOptions: {
doNotBlockOnMicrophoneAccess: boolean;
}

^That suggestion is a tad verbose

Suggested change
skipMicCheck?: boolean;
joinCallOptions: {
skipMicrophoneCheck: boolean;
}

Would work also, but consider if we had additional options in future such as the ability to block on microphone permission only but allow no microphone plugged in, or the ability to block on not just mic but camera as well we need a naming scheme that is consistent for future scenarios, perhaps also:

Suggested change
skipMicCheck?: boolean;
joinCallOptions: {
microphoneCheck: 'blockOnAccess' /* default */ | 'blockOnEnumeration' /*future*/ | 'skip',
cameraCheck: 'blockOnAccess' | 'blockOnFaceDetection' | // just some examples
}

Not sure what the beahvior is today, is it just on permission or does there have to be an available microphone as well?

Copy link
Member

Choose a reason for hiding this comment

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

Of these options I think I like the last one best as it gives more control to Contoso

Choose a reason for hiding this comment

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

PR Overview

This PR introduces a new composite option (skipMicCheck) to allow users to join a call without requiring a microphone. Key changes include:

  • Adding the skipMicCheck property to the composite options and associated props.
  • Updating logic to conditionally disable the start call button based on skipMicCheck.
  • Propagating the new skipMicCheck option through CallComposite, CallWithChatComposite, and API documentation.

Reviewed Changes

File Description
packages/react-composites/src/composites/CallComposite/pages/ConfigurationPage.tsx Added skipMicCheck prop and updated logic for enabling/disabling the start call button.
packages/react-composites/src/composites/CallWithChatComposite/CallWithChatComposite.tsx Extended composite options to include skipMicCheck and passed it to the CallWithChatScreen.
packages/react-composites/src/composites/CallComposite/CallComposite.tsx Updated CallComposite options to include skipMicCheck and forwarded it to the configuration page.
packages/communication-react/review/stable/communication-react.api.md Updated API documentation to include skipMicCheck in composite option types (stable).
packages/communication-react/review/beta/communication-react.api.md Updated API documentation to include skipMicCheck in composite option types (beta).

Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.

Comments suppressed due to low confidence (3)

packages/react-composites/src/composites/CallComposite/pages/ConfigurationPage.tsx:149

  • Consider adding tests to verify that when skipMicCheck is true, the start call button is enabled regardless of the microphone permission state or available microphones.
let disableStartCallButton = (!microphonePermissionGranted || microphones?.length === 0) && !skipMicCheck;

packages/react-composites/src/composites/CallWithChatComposite/CallWithChatComposite.tsx:548

  • Ensure that tests cover the scenario where skipMicCheck is provided so that its propagation through composite options is validated.
spotlight: props.spotlight,

packages/react-composites/src/composites/CallComposite/CallComposite.tsx:564

  • Add tests to cover the new skipMicCheck option in composite configurations to ensure that it correctly influences call behavior.
skipMicCheck={props.options?.skipMicCheck}
Copy link
Contributor

Copy link
Contributor

Copy link
Contributor

CallWithChat bundle size is not changed.

  • Current size: 12401112
  • Base size: 12401112
  • Diff size: 0

Copy link
Contributor

Calling bundle size is not changed.

  • Current size: 12401100
  • Base size: 12401100
  • Diff size: 0

Copy link
Contributor

Chat bundle size is not changed.

  • Current size: 1777281
  • Base size: 1777281
  • Diff size: 0

Copy link
Contributor

@carocao-msft carocao-msft marked this pull request as draft February 28, 2025 21:54
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.

3 participants