1
Fork 0

Mute local audio when streaming video.

This commit is contained in:
Juliusz Chroboczek 2020-11-29 21:48:14 +01:00
parent 4c0fd01258
commit e2a79e24a1
1 changed files with 9 additions and 0 deletions

View File

@ -900,6 +900,15 @@ async function addFileMedia(file) {
c.stream = stream;
stream.onaddtrack = function(e) {
let t = e.track;
if(t.kind === 'audio') {
let presenting = !!findUpMedia('local');
let muted = getSettings().localMute;
if(presenting && !muted) {
setLocalMute(true);
updateSettings({localMute: true});
displayWarning('You have been muted');
}
}
c.pc.addTrack(t, stream);
c.labels[t.id] = t.kind;
c.onstats = gotUpStats;