1
Fork 0
mirror of https://github.com/jech/galene.git synced 2024-11-26 02:25:58 +01:00

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

View file

@ -900,6 +900,15 @@ async function addFileMedia(file) {
c.stream = stream; c.stream = stream;
stream.onaddtrack = function(e) { stream.onaddtrack = function(e) {
let t = e.track; 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.pc.addTrack(t, stream);
c.labels[t.id] = t.kind; c.labels[t.id] = t.kind;
c.onstats = gotUpStats; c.onstats = gotUpStats;