AWS Chime useToggleLocalMute() does not working

477 Views Asked by At

Hi guys i'm trying to create a button that disables my microphone in ws-chime, i followed the documentation to the letter only that when i click on the button nothing seems to happen.

 const { muted, toggleMute } = useToggleLocalMute();
<button onClick={toggleMute}>
          {muted ? "Unmute myself" : "Mute myself"}
        </button>
1

There are 1 best solutions below

0
On

I could simulate that problem and searching on the internet I could find this post on github related to this problem.

I tried to implement what was suggested there but didn't work for me, so I decided to work with the const meetingManager = useMeetingManager();

By using that, I was able to mute/unmute by calling

await meetingManager.audioVideo?.realtimeUnmuteLocalAudio();

await meetingManager.audioVideo?.realtimeMuteLocalAudio();

I don't know if it's the best solution but that worked for me until they update their documentation as mentioned in the post on github.