Add muteAudio function to load test JS. (#8802)

This commit is contained in:
Jonathan Lennox 2021-03-15 15:37:58 -04:00 committed by GitHub
parent e1c5b1e626
commit 226581a81a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 14 additions and 0 deletions

View File

@ -39,6 +39,20 @@ window.APP = {
}, },
getConnectionState() { getConnectionState() {
return room && room.getConnectionState(); return room && room.getConnectionState();
},
muteAudio(mute) {
// Note: will have no effect if !autoCreateLocalAudio
localAudio = mute;
for (let i = 0; i < localTracks.length; i++) {
if (localTracks[i].getType() === 'audio') {
if (mute) {
localTracks[i].mute();
}
else {
localTracks[i].unmute();
}
}
}
} }
}, },