mirror of
https://github.com/vector-im/element-call.git
synced 2026-08-29 21:15:19 +00:00
@@ -139,11 +139,11 @@ export function useLiveKit(
|
|||||||
const participant = room.localParticipant;
|
const participant = room.localParticipant;
|
||||||
|
|
||||||
const syncMuteStateAudio = () => {
|
const syncMuteStateAudio = () => {
|
||||||
if (participant.isCameraEnabled !== muteStates.video.enabled) {
|
if (participant.isMicrophoneEnabled !== muteStates.audio.enabled) {
|
||||||
participant
|
participant
|
||||||
.setCameraEnabled(muteStates.video.enabled)
|
.setMicrophoneEnabled(muteStates.audio.enabled)
|
||||||
.catch((e) =>
|
.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
|
// Run the check again after the change is done. Because the user
|
||||||
// can update the state (presses mute button) while the device is enabling
|
// can update the state (presses mute button) while the device is enabling
|
||||||
@@ -154,11 +154,11 @@ export function useLiveKit(
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
const syncMuteStateVideo = () => {
|
const syncMuteStateVideo = () => {
|
||||||
if (participant.isMicrophoneEnabled !== muteStates.audio.enabled) {
|
if (participant.isCameraEnabled !== muteStates.video.enabled) {
|
||||||
participant
|
participant
|
||||||
.setMicrophoneEnabled(muteStates.audio.enabled)
|
.setCameraEnabled(muteStates.video.enabled)
|
||||||
.catch((e) =>
|
.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
|
// see above
|
||||||
.then(() => syncMuteStateVideo());
|
.then(() => syncMuteStateVideo());
|
||||||
|
|||||||
Reference in New Issue
Block a user