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
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"type": "prerelease",
"area": "feature",
"workstream": "Allow join without mic",
"comment": "Add composite option to allow join without microphone access",
"packageName": "@azure/communication-react",
"email": "[email protected]",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
Expand Up @@ -799,6 +799,9 @@ export type CallCompositeOptions = {
spotlight?: {
hideSpotlightButtons?: boolean;
};
joinCallOptions?: {
microphoneCheck?: 'requireMicrophoneAvailable' | 'skip';
};
};

// @public
Expand Down Expand Up @@ -1641,6 +1644,9 @@ export type CallWithChatCompositeOptions = {
hideSpotlightButtons?: boolean;
};
richTextEditor?: boolean;
joinCallOptions?: {
microphoneCheck?: 'requireMicrophoneAvailable' | 'skip';
};
};

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

// @public
Expand Down Expand Up @@ -1407,6 +1410,9 @@ export type CallWithChatCompositeOptions = {
spotlight?: {
hideSpotlightButtons?: boolean;
};
joinCallOptions?: {
microphoneCheck?: 'requireMicrophoneAvailable' | 'skip';
};
};

// @public
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,18 @@ export type CallCompositeOptions = {
*/
hideSpotlightButtons?: 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 'requireMicrophoneAvailable'
*/
microphoneCheck?: 'requireMicrophoneAvailable' | 'skip';
};
};

type MainScreenProps = {
Expand Down Expand Up @@ -556,6 +568,7 @@ const MainScreen = (props: MainScreenProps): JSX.Element => {
case 'configuration':
pageElement = (
<ConfigurationPage
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,6 +103,18 @@ export interface ConfigurationPageProps {
backgroundImage?: {
url: string;
};
/**
* 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 'requireMicrophoneAvailable'
*/
microphoneCheck?: 'requireMicrophoneAvailable' | 'skip';
};
}

/**
Expand All @@ -115,7 +127,8 @@ export const ConfigurationPage = (props: ConfigurationPageProps): JSX.Element =>
modalLayerHostId,
/* @conditional-compile-remove(call-readiness) */ deviceChecks,
/* @conditional-compile-remove(call-readiness) */ onPermissionsTroubleshootingClick,
/* @conditional-compile-remove(call-readiness) */ onNetworkingTroubleShootingClick
/* @conditional-compile-remove(call-readiness) */ onNetworkingTroubleShootingClick,
joinCallOptions = { microphoneCheck: 'requireMicrophoneAvailable' }
} = props;

const theme = useTheme();
Expand Down Expand Up @@ -144,7 +157,9 @@ export const ConfigurationPage = (props: ConfigurationPageProps): JSX.Element =>
const microphones = useSelector(getMicrophones);
const environmentInfo = useSelector(getEnvironmentInfo);

let disableStartCallButton = !microphonePermissionGranted || microphones?.length === 0;
let disableStartCallButton =
(!microphonePermissionGranted || microphones?.length === 0) &&
joinCallOptions.microphoneCheck === 'requireMicrophoneAvailable';
const role = useSelector(getRole);

const isCameraOn = useSelector(localVideoSelector).isAvailable;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,18 @@ export type CallWithChatCompositeOptions = {
* @beta
*/
richTextEditor?: 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 'requireMicrophoneAvailable'
*/
microphoneCheck?: 'requireMicrophoneAvailable' | 'skip';
};
};

type CallWithChatScreenProps = {
Expand Down Expand Up @@ -360,6 +372,18 @@ type CallWithChatScreenProps = {
};
/* @conditional-compile-remove(rich-text-editor-composite-support) */
richTextEditor?: 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 'requireMicrophoneAvailable'
*/
microphoneCheck?: 'requireMicrophoneAvailable' | 'skip';
};
};

const CallWithChatScreen = (props: CallWithChatScreenProps): JSX.Element => {
Expand Down Expand Up @@ -539,7 +563,8 @@ const CallWithChatScreen = (props: CallWithChatScreenProps): JSX.Element => {
logo: props.logo,
backgroundImage: props.backgroundImage
},
spotlight: props.spotlight
spotlight: props.spotlight,
joinCallOptions: props.joinCallOptions
}),
[
props.callControls,
Expand All @@ -561,7 +586,8 @@ const CallWithChatScreen = (props: CallWithChatScreenProps): JSX.Element => {
surveyOptions,
props.logo,
props.backgroundImage,
props.spotlight
props.spotlight,
props.joinCallOptions
]
);

Expand Down Expand Up @@ -733,6 +759,7 @@ export const CallWithChatComposite = (props: CallWithChatCompositeProps): JSX.El
spotlight={options?.spotlight}
/* @conditional-compile-remove(rich-text-editor-composite-support) */
richTextEditor={options?.richTextEditor}
joinCallOptions={options?.joinCallOptions}
/>
</BaseProvider>
);
Expand Down