diff --git a/src/livekit/useLiveKit.ts b/src/livekit/useLiveKit.ts index d4b8a9bd..22edd9b5 100644 --- a/src/livekit/useLiveKit.ts +++ b/src/livekit/useLiveKit.ts @@ -139,11 +139,11 @@ export function useLiveKit( const participant = room.localParticipant; const syncMuteStateAudio = () => { - if (participant.isCameraEnabled !== muteStates.video.enabled) { + if (participant.isMicrophoneEnabled !== muteStates.audio.enabled) { participant - .setCameraEnabled(muteStates.video.enabled) + .setMicrophoneEnabled(muteStates.audio.enabled) .catch((e) => - logger.error("Failed to sync video mute state with LiveKit", e) + logger.error("Failed to sync audio mute state with LiveKit", e) ) // Run the check again after the change is done. Because the user // can update the state (presses mute button) while the device is enabling @@ -154,11 +154,11 @@ export function useLiveKit( } }; const syncMuteStateVideo = () => { - if (participant.isMicrophoneEnabled !== muteStates.audio.enabled) { + if (participant.isCameraEnabled !== muteStates.video.enabled) { participant - .setMicrophoneEnabled(muteStates.audio.enabled) + .setCameraEnabled(muteStates.video.enabled) .catch((e) => - logger.error("Failed to sync audio mute state with LiveKit", e) + logger.error("Failed to sync video mute state with LiveKit", e) ) // see above .then(() => syncMuteStateVideo());