diff --git a/custom/fitness-demo/components/Call/PeopleAside.js b/custom/fitness-demo/components/Call/PeopleAside.js index bc18053..be9385f 100644 --- a/custom/fitness-demo/components/Call/PeopleAside.js +++ b/custom/fitness-demo/components/Call/PeopleAside.js @@ -101,6 +101,22 @@ export const PeopleAside = () => { return null; } + async function muteAll(deviceType) { + let updatedParticipantList = {}; + // Accommodate muting mics and cameras + const newSetting = + deviceType === 'video' ? { setVideo: false } : { setAudio: false }; + for (let id in callObject.participants()) { + // Do not update the local participant's device (aka the instructor) + if (id === 'local') continue; + + updatedParticipantList[id] = newSetting; + } + + // Update all participants at once + callObject.updateParticipants(updatedParticipantList); + } + return (