feat add button to mute all audios
This commit is contained in:
parent
c7d1654eca
commit
2c1e3cb78e
|
@ -70,6 +70,8 @@
|
|||
<div style="display: none" id="room">
|
||||
<div class="container-fluid" id="video-container">
|
||||
</div>
|
||||
<button onclick="toggleMute()">Toggle all mute</button>
|
||||
Currently: <span id="muted-status">Unmuted</span>
|
||||
</div>
|
||||
|
||||
|
||||
|
@ -77,8 +79,6 @@
|
|||
Change audio output device
|
||||
<select id="audioOutputSelect" onchange="changeAudioOutput(this)"></select>
|
||||
</div>
|
||||
|
||||
|
||||
<video autoplay='autoplay' id="localVideo"></video>
|
||||
</body>
|
||||
</html>
|
||||
|
|
12
script.js
12
script.js
|
@ -20,6 +20,7 @@ const videoSize = {
|
|||
|
||||
let connection = null;
|
||||
let room = null;
|
||||
let muted = false;
|
||||
|
||||
// zu mappende namen.
|
||||
let remoteMappingName = new Array(9);
|
||||
|
@ -422,6 +423,17 @@ function leave() {
|
|||
}
|
||||
}
|
||||
|
||||
function toggleMute() {
|
||||
let audioElems = $("audio");
|
||||
muted = !muted;
|
||||
audioElems.prop("muted", muted)
|
||||
if(muted) {
|
||||
$('#muted-status').text("Muted")
|
||||
} else {
|
||||
$('#muted-status').text("Unmuted")
|
||||
}
|
||||
}
|
||||
|
||||
function updateParticipantList() {
|
||||
$('.available-users').text(room.getParticipants().map(p => p.getDisplayName() || 'Fellow Jitster').join(', '));
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue