Skip to content

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

Merged
JamesBurnside merged 8 commits intomainfrom
carocao/micAPI
Mar 11, 2025
Merged

Add composite option to allow join the call without microphone#5671
JamesBurnside merged 8 commits intomainfrom
carocao/micAPI

Conversation

@carocao-msft
Copy link
Copy Markdown
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.

@github-actions
Copy link
Copy Markdown
Contributor

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Feb 26, 2025

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

Lines Statements Functions Branches
Base 28083 / 44693
62.83%
28083 / 44693
62.83%
786 / 1436
54.73%
2355 / 3725
63.22%
Current 28084 / 44693
62.83%
28084 / 44693
62.83%
786 / 1436
54.73%
2369 / 3738
63.37%
Diff 1 / 0
0%
1 / 0
0%
0 / 0
0%
14 / 13
0.15%

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Feb 26, 2025

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

Lines Statements Functions Branches
Base 58283 / 94275
61.82%
58283 / 94275
61.82%
1178 / 2693
43.74%
3525 / 5821
60.55%
Current 58329 / 94330
61.83%
58329 / 94330
61.83%
1178 / 2693
43.74%
3570 / 5844
61.08%
Diff 46 / 55
0.01%
46 / 55
0.01%
0 / 0
0%
45 / 23
0.53%

spotlight?: {
hideSpotlightButtons?: boolean;
};
skipMicCheck?: boolean;
Copy link
Copy Markdown
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
Copy Markdown
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

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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}

@github-actions
Copy link
Copy Markdown
Contributor

@github-actions
Copy link
Copy Markdown
Contributor

@github-actions
Copy link
Copy Markdown
Contributor

@carocao-msft carocao-msft marked this pull request as draft February 28, 2025 21:54
@JamesBurnside JamesBurnside marked this pull request as ready for review March 11, 2025 20:05
@JamesBurnside JamesBurnside enabled auto-merge (squash) March 11, 2025 20:08
@github-actions
Copy link
Copy Markdown
Contributor

CallWithChat bundle size is not changed.

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

@github-actions
Copy link
Copy Markdown
Contributor

Chat bundle size is not changed.

  • Current size: 1777648
  • Base size: 1777648
  • Diff size: 0

@github-actions
Copy link
Copy Markdown
Contributor

Calling bundle size is not changed.

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

@github-actions
Copy link
Copy Markdown
Contributor

@JamesBurnside JamesBurnside merged commit 001a883 into main Mar 11, 2025
@JamesBurnside JamesBurnside deleted the carocao/micAPI branch March 11, 2025 20:20
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.

4 participants