Reputation: 28
0
Hi guys i'm trying to create a button that disables my microphone in ws-chime,but not working with me when turn isAudioOn to false nothing seems to happen,the other user keeps listening to my sound
import React from 'react';
import {
MeetingProvider,
useLocalAudioOutput
} from 'amazon-chime-sdk-component-library-react';
const App = () => (
<MeetingProvider>
<MyChild />
</MeetingProvider>
);
const MyChild = () => {
const { isAudioOn, toggleAudio } = useLocalAudioOutput();
return (
<div>
<div>
{isAudioOn
? 'Meeting audio output is on'
: 'Meeting audio output is off'}
</div>
<button onClick={toggleAudio}>Toggle Local Audio Output</button>
</div>
);
};
Upvotes: 2
Views: 718
Reputation: 216
If you're already using React, you can use the AudioInputControl Component
Upvotes: 0