mirror of
https://github.com/vector-im/element-call.git
synced 2026-04-03 07:10:26 +00:00
@@ -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());
|
||||
|
||||
Reference in New Issue
Block a user