diff --git a/src/room/GroupCallView.tsx b/src/room/GroupCallView.tsx index 9e8a389..098cbde 100644 --- a/src/room/GroupCallView.tsx +++ b/src/room/GroupCallView.tsx @@ -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) { diff --git a/src/room/InCallView.tsx b/src/room/InCallView.tsx index 6382cb8..c1414e2 100644 --- a/src/room/InCallView.tsx +++ b/src/room/InCallView.tsx @@ -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"); },