Automatically mute the user, if there already are more than 8 participants
Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
This commit is contained in:
@@ -11,7 +11,7 @@ export type UserChoices = {
|
||||
};
|
||||
|
||||
export type DeviceChoices = {
|
||||
selectedId: string;
|
||||
selectedId?: string;
|
||||
enabled: boolean;
|
||||
};
|
||||
|
||||
|
||||
@@ -97,7 +97,20 @@ export interface ActiveCallProps extends Omit<InCallViewProps, "livekitRoom"> {
|
||||
|
||||
export function ActiveCall(props: ActiveCallProps) {
|
||||
const sfuConfig = useSFUConfig();
|
||||
const livekitRoom = useLiveKit(props.userChoices, sfuConfig);
|
||||
const livekitRoom = useLiveKit(
|
||||
{
|
||||
audio: {
|
||||
selectedId: props.userChoices.audio?.selectedId,
|
||||
enabled:
|
||||
(props.userChoices.audio?.enabled ?? false) &&
|
||||
// Automatically mute the user, if there is more than 8 participants
|
||||
// in the call
|
||||
props.groupCall.participants.size <= 8,
|
||||
},
|
||||
video: props.userChoices.video,
|
||||
},
|
||||
sfuConfig
|
||||
);
|
||||
|
||||
if (!livekitRoom) {
|
||||
return null;
|
||||
|
||||
Reference in New Issue
Block a user