Mute all functionality in aws chime javascript sdk

0

Hi we want the presenter who is presenting the meeting can mute all the other attendees in aws chime we are using aws chime sdk javascript for the client side we want this feature as is there functionality where we can get all the attendee's meeting session and we mute every attendees audio.

asked 4 years ago649 views
1 Answer
0

Yes I did it by myself you just have to use the function. The way I did it by passing the mute to all except to self and you can only show the mute button to admin basically who is the first joinee. And for the rest you don't show that. The messages that I recieved from AWS are this you can see that I am quoting it below:
"I believe Doug was explaining that you could use the data messages channel (https://aws.github.io/amazon-chime-sdk-js/modules/apioverview.html#9-send-and-receive-data-messages-optional) to inform the client (the front-end application) that they are to be muted. Based on the receipt of the message, the front end application would trigger the mute/unmute capability (https://aws.github.io/amazon-chime-sdk-js/modules/apioverview.html#6-mute-and-unmute-microphone-audio-with-the-real-time-api) on the client to control the mute state."
The way I did it, I created a topic named 'muteAll' which is like pub sub model working here then I have subsrcibed to it when I recieve the message which is the admin pressing the muteall button then on the basis of that I mute all the attendees basically every attendee is subsribed to this message it is the same way how the messages are working here for the people who are typing. So I am sharing the code below for that but if you want the full code with this functionality I can definetly share with you feel free to contact me himanshu.bhatt@oodlestechnologies.com.
dataMessageMuteAllHandler(dataMessage: DataMessage): void {
if (!dataMessage.throttled) {
const isSelf = dataMessage.senderAttendeeId === this.meetingSession.configuration.credentials.attendeeId;
if(isSelf)
{
console.log("self Not Mute");
}else
{
console.log("Other clients Muted")
this.meetingSession.audioVideo.realtimeMuteLocalAudio();
}

} else {  
  this.log('Message is throttled. Please resend');  
}  

}

const buttonMuteAll = document.getElementById('button-mute');
buttonMuteAll.addEventListener('mousedown', async _e => {
if (this.toggleButton('button-mute')) {
console.log('buttonMuteAll unmute');
this.audioVideo.realtimeSendDataMessage(DemoMeetingApp.DATA_MESSAGE_TOPIC_MUTE, "muteAll", DemoMeetingApp.DATA_MESSAGE_LIFETIME_MS);
this.dataMessageMuteAllHandler(new DataMessage(
Date.now(),
DemoMeetingApp.DATA_MESSAGE_TOPIC_MUTE,
new TextEncoder().encode("muteAll"),
this.meetingSession.configuration.credentials.attendeeId,
this.meetingSession.configuration.credentials.externalUserId
));
}
});

answered 3 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions