Add debounce to mute/unmute button
This commit is contained in:
parent
419a5e46a8
commit
10969f2601
@ -1,5 +1,6 @@
|
||||
import Users from '/imports/api/users';
|
||||
import Auth from '/imports/ui/services/auth';
|
||||
import { debounce } from 'lodash';
|
||||
import AudioManager from '/imports/ui/services/audio-manager';
|
||||
import Meetings from '/imports/api/meetings';
|
||||
import { makeCall } from '/imports/ui/services/api';
|
||||
@ -39,7 +40,6 @@ const isVoiceUser = () => {
|
||||
{ fields: { joined: 1 } });
|
||||
return voiceUser ? voiceUser.joined : false;
|
||||
};
|
||||
|
||||
const toggleMuteMicrophone = () => {
|
||||
const user = VoiceUsers.findOne({
|
||||
meetingId: Auth.meetingID, intId: Auth.userID,
|
||||
@ -60,6 +60,7 @@ const toggleMuteMicrophone = () => {
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
export default {
|
||||
init,
|
||||
exitAudio: () => AudioManager.exitAudio(),
|
||||
@ -67,7 +68,7 @@ export default {
|
||||
joinListenOnly: () => AudioManager.joinListenOnly(),
|
||||
joinMicrophone: () => AudioManager.joinMicrophone(),
|
||||
joinEchoTest: () => AudioManager.joinEchoTest(),
|
||||
toggleMuteMicrophone,
|
||||
toggleMuteMicrophone: debounce(toggleMuteMicrophone, 500, { leading: true, trailing: false }),
|
||||
changeInputDevice: inputDeviceId => AudioManager.changeInputDevice(inputDeviceId),
|
||||
changeOutputDevice: outputDeviceId => AudioManager.changeOutputDevice(outputDeviceId),
|
||||
isConnected: () => AudioManager.isConnected,
|
||||
|
Loading…
Reference in New Issue
Block a user