respect mute state set in lobby for call (#1102)

Signed-off-by: Timo K <toger5@hotmail.de>
This commit is contained in:
Timo 2023-06-12 15:35:54 +02:00 committed by GitHub
parent e8a2421962
commit 4dcd1e176f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 2 deletions

View file

@ -183,6 +183,10 @@ export function GroupCallView({
matrixInfo={matrixInfo}
mediaDevices={lkState.mediaDevices}
livekitRoom={lkState.room}
userChoices={{
videoMuted: lkState.localMedia.video.muted,
audioMuted: lkState.localMedia.audio.muted,
}}
/>
);
} else if (left) {

View file

@ -81,6 +81,11 @@ const canScreenshare = "getDisplayMedia" in (navigator.mediaDevices ?? {});
// For now we can disable screensharing in Safari.
const isSafari = /^((?!chrome|android).)*safari/i.test(navigator.userAgent);
interface LocalUserChoices {
videoMuted: boolean;
audioMuted: boolean;
}
interface Props {
client: MatrixClient;
groupCall: GroupCall;
@ -92,6 +97,8 @@ interface Props {
matrixInfo: MatrixInfo;
mediaDevices: MediaDevicesState;
livekitRoom: Room;
userChoices: LocalUserChoices;
}
export function InCallView({
@ -104,6 +111,7 @@ export function InCallView({
matrixInfo,
mediaDevices,
livekitRoom,
userChoices,
}: Props) {
const { t } = useTranslation();
usePreventScroll();
@ -143,8 +151,8 @@ export function InCallView({
token,
serverUrl: Config.get().livekit.server_url,
room: livekitRoom,
audio: true,
video: true,
audio: !userChoices.audioMuted,
video: !userChoices.videoMuted,
onConnected: () => {
console.log("connected to LiveKit room");
},