Add muteAudio function to load test JS. (#8802)
This commit is contained in:
parent
e1c5b1e626
commit
226581a81a
|
@ -39,6 +39,20 @@ window.APP = {
|
|||
},
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
|
|
Loading…
Reference in New Issue