From 22114a24a70d924171dc63a1ed4defebc5feebb5 Mon Sep 17 00:00:00 2001 From: carocao-msft <96077406+carocao-msft@users.noreply.github.com> Date: Fri, 28 Feb 2025 19:17:51 +0000 Subject: [PATCH] update --- .../review/beta/communication-react.api.md | 8 +++-- .../review/stable/communication-react.api.md | 8 +++-- .../CallComposite/CallComposite.tsx | 15 ++++++--- .../CallComposite/pages/ConfigurationPage.tsx | 18 +++++++++-- .../CallWithChatComposite.tsx | 32 +++++++++++++++---- 5 files changed, 63 insertions(+), 18 deletions(-) diff --git a/packages/communication-react/review/beta/communication-react.api.md b/packages/communication-react/review/beta/communication-react.api.md index 4c7167e8455..971ca13dc0d 100644 --- a/packages/communication-react/review/beta/communication-react.api.md +++ b/packages/communication-react/review/beta/communication-react.api.md @@ -797,7 +797,9 @@ export type CallCompositeOptions = { spotlight?: { hideSpotlightButtons?: boolean; }; - skipMicCheck?: boolean; + joinCallOptions?: { + microphoneCheck: 'blockOnAccess' | 'skip'; + }; }; // @public @@ -1638,7 +1640,9 @@ export type CallWithChatCompositeOptions = { hideSpotlightButtons?: boolean; }; richTextEditor?: boolean; - skipMicCheck?: boolean; + joinCallOptions?: { + microphoneCheck: 'blockOnAccess' | 'skip'; + }; }; // @public diff --git a/packages/communication-react/review/stable/communication-react.api.md b/packages/communication-react/review/stable/communication-react.api.md index d5779718264..71bb8348806 100644 --- a/packages/communication-react/review/stable/communication-react.api.md +++ b/packages/communication-react/review/stable/communication-react.api.md @@ -630,7 +630,9 @@ export type CallCompositeOptions = { spotlight?: { hideSpotlightButtons?: boolean; }; - skipMicCheck?: boolean; + joinCallOptions?: { + microphoneCheck: 'blockOnAccess' | 'skip'; + }; }; // @public @@ -1404,7 +1406,9 @@ export type CallWithChatCompositeOptions = { spotlight?: { hideSpotlightButtons?: boolean; }; - skipMicCheck?: boolean; + joinCallOptions?: { + microphoneCheck: 'blockOnAccess' | 'skip'; + }; }; // @public diff --git a/packages/react-composites/src/composites/CallComposite/CallComposite.tsx b/packages/react-composites/src/composites/CallComposite/CallComposite.tsx index ca3e32c2583..545d3e14a50 100644 --- a/packages/react-composites/src/composites/CallComposite/CallComposite.tsx +++ b/packages/react-composites/src/composites/CallComposite/CallComposite.tsx @@ -350,10 +350,17 @@ export type CallCompositeOptions = { hideSpotlightButtons?: boolean; }; /** - * Options to enable joining call without a microphone. - * @defaultValue false + * Options for settings related to joining a call. */ - skipMicCheck?: boolean; + joinCallOptions?: { + /** + * options for checking microphone permissions when joining a call. + * block on access will block the user from joining the call if the microphone permission is not granted. + * skip will allow the user to join the call without granting the microphone permission. + * @defaultValue 'blockOnAccess' + */ + microphoneCheck: 'blockOnAccess' | 'skip'; + }; }; type MainScreenProps = { @@ -561,7 +568,7 @@ const MainScreen = (props: MainScreenProps): JSX.Element => { case 'configuration': pageElement = ( { if (callees) { diff --git a/packages/react-composites/src/composites/CallComposite/pages/ConfigurationPage.tsx b/packages/react-composites/src/composites/CallComposite/pages/ConfigurationPage.tsx index beeff37f425..d393bdd3acb 100644 --- a/packages/react-composites/src/composites/CallComposite/pages/ConfigurationPage.tsx +++ b/packages/react-composites/src/composites/CallComposite/pages/ConfigurationPage.tsx @@ -103,7 +103,18 @@ export interface ConfigurationPageProps { backgroundImage?: { url: string; }; - skipMicCheck?: boolean; + /** + * Options for settings related to joining a call. + */ + joinCallOptions?: { + /** + * options for checking microphone permissions when joining a call. + * block on access will block the user from joining the call if the microphone permission is not granted. + * skip will allow the user to join the call without granting the microphone permission. + * @defaultValue 'blockOnAccess' + */ + microphoneCheck: 'blockOnAccess' | 'skip'; + }; } /** @@ -117,7 +128,7 @@ export const ConfigurationPage = (props: ConfigurationPageProps): JSX.Element => /* @conditional-compile-remove(call-readiness) */ deviceChecks, /* @conditional-compile-remove(call-readiness) */ onPermissionsTroubleshootingClick, /* @conditional-compile-remove(call-readiness) */ onNetworkingTroubleShootingClick, - skipMicCheck + joinCallOptions = { microphoneCheck: 'blockOnAccess' } } = props; const theme = useTheme(); @@ -146,7 +157,8 @@ export const ConfigurationPage = (props: ConfigurationPageProps): JSX.Element => const microphones = useSelector(getMicrophones); const environmentInfo = useSelector(getEnvironmentInfo); - let disableStartCallButton = (!microphonePermissionGranted || microphones?.length === 0) && !skipMicCheck; + let disableStartCallButton = + (!microphonePermissionGranted || microphones?.length === 0) && joinCallOptions.microphoneCheck === 'blockOnAccess'; const role = useSelector(getRole); const isCameraOn = useSelector(localVideoSelector).isAvailable; diff --git a/packages/react-composites/src/composites/CallWithChatComposite/CallWithChatComposite.tsx b/packages/react-composites/src/composites/CallWithChatComposite/CallWithChatComposite.tsx index 72c3c5e617e..ae70000bd97 100644 --- a/packages/react-composites/src/composites/CallWithChatComposite/CallWithChatComposite.tsx +++ b/packages/react-composites/src/composites/CallWithChatComposite/CallWithChatComposite.tsx @@ -282,10 +282,17 @@ export type CallWithChatCompositeOptions = { */ richTextEditor?: boolean; /** - * Options to enable joining call without a microphone. - * @defaultValue false + * Options for settings related to joining a call. */ - skipMicCheck?: boolean; + joinCallOptions?: { + /** + * options for checking microphone permissions when joining a call. + * block on access will block the user from joining the call if the microphone permission is not granted. + * skip will allow the user to join the call without granting the microphone permission. + * @defaultValue 'blockOnAccess' + */ + microphoneCheck: 'blockOnAccess' | 'skip'; + }; }; type CallWithChatScreenProps = { @@ -365,7 +372,18 @@ type CallWithChatScreenProps = { }; /* @conditional-compile-remove(rich-text-editor-composite-support) */ richTextEditor?: boolean; - skipMicCheck?: boolean; + /** + * Options for settings related to joining a call. + */ + joinCallOptions?: { + /** + * options for checking microphone permissions when joining a call. + * block on access will block the user from joining the call if the microphone permission is not granted. + * skip will allow the user to join the call without granting the microphone permission. + * @defaultValue 'blockOnAccess' + */ + microphoneCheck: 'blockOnAccess' | 'skip'; + }; }; const CallWithChatScreen = (props: CallWithChatScreenProps): JSX.Element => { @@ -546,7 +564,7 @@ const CallWithChatScreen = (props: CallWithChatScreenProps): JSX.Element => { backgroundImage: props.backgroundImage }, spotlight: props.spotlight, - skipMicCheck: props.skipMicCheck + joinCallOptions: props.joinCallOptions }), [ props.callControls, @@ -569,7 +587,7 @@ const CallWithChatScreen = (props: CallWithChatScreenProps): JSX.Element => { props.logo, props.backgroundImage, props.spotlight, - props.skipMicCheck + props.joinCallOptions ] ); @@ -741,7 +759,7 @@ export const CallWithChatComposite = (props: CallWithChatCompositeProps): JSX.El spotlight={options?.spotlight} /* @conditional-compile-remove(rich-text-editor-composite-support) */ richTextEditor={options?.richTextEditor} - skipMicCheck={options?.skipMicCheck} + joinCallOptions={options?.joinCallOptions} /> );