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} matrixInfo={matrixInfo}
mediaDevices={lkState.mediaDevices} mediaDevices={lkState.mediaDevices}
livekitRoom={lkState.room} livekitRoom={lkState.room}
userChoices={{
videoMuted: lkState.localMedia.video.muted,
audioMuted: lkState.localMedia.audio.muted,
}}
/> />
); );
} else if (left) { } else if (left) {

View file

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