Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
carocao-msft committed Feb 28, 2025
1 parent 4ac087c commit 22114a2
Show file tree
Hide file tree
Showing 5 changed files with 63 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -797,7 +797,9 @@ export type CallCompositeOptions = {
spotlight?: {
hideSpotlightButtons?: boolean;
};
skipMicCheck?: boolean;
joinCallOptions?: {
microphoneCheck: 'blockOnAccess' | 'skip';
};
};

// @public
Expand Down Expand Up @@ -1638,7 +1640,9 @@ export type CallWithChatCompositeOptions = {
hideSpotlightButtons?: boolean;
};
richTextEditor?: boolean;
skipMicCheck?: boolean;
joinCallOptions?: {
microphoneCheck: 'blockOnAccess' | 'skip';
};
};

// @public
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -630,7 +630,9 @@ export type CallCompositeOptions = {
spotlight?: {
hideSpotlightButtons?: boolean;
};
skipMicCheck?: boolean;
joinCallOptions?: {
microphoneCheck: 'blockOnAccess' | 'skip';
};
};

// @public
Expand Down Expand Up @@ -1404,7 +1406,9 @@ export type CallWithChatCompositeOptions = {
spotlight?: {
hideSpotlightButtons?: boolean;
};
skipMicCheck?: boolean;
joinCallOptions?: {
microphoneCheck: 'blockOnAccess' | 'skip';
};
};

// @public
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down Expand Up @@ -561,7 +568,7 @@ const MainScreen = (props: MainScreenProps): JSX.Element => {
case 'configuration':
pageElement = (
<ConfigurationPage
skipMicCheck={props.options?.skipMicCheck}
joinCallOptions={props.options?.joinCallOptions}
mobileView={props.mobileView}
startCallHandler={(): void => {
if (callees) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
};
}

/**
Expand All @@ -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();
Expand Down Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down Expand Up @@ -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 => {
Expand Down Expand Up @@ -546,7 +564,7 @@ const CallWithChatScreen = (props: CallWithChatScreenProps): JSX.Element => {
backgroundImage: props.backgroundImage
},
spotlight: props.spotlight,
skipMicCheck: props.skipMicCheck
joinCallOptions: props.joinCallOptions
}),
[
props.callControls,
Expand All @@ -569,7 +587,7 @@ const CallWithChatScreen = (props: CallWithChatScreenProps): JSX.Element => {
props.logo,
props.backgroundImage,
props.spotlight,
props.skipMicCheck
props.joinCallOptions
]
);

Expand Down Expand Up @@ -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}
/>
</BaseProvider>
);
Expand Down

0 comments on commit 22114a2

Please sign in to comment.