Skip to content
This repository was archived by the owner on Oct 25, 2024. It is now read-only.

Commit a797b58

Browse files
authored
Add Mute/Unmute option for remote audio. (#400)
1 parent f4e5248 commit a797b58

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

src/samples/p2p/js/peercall.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,11 @@ $(document).ready(function() {
5353
p2p.allowedRemoteIds = [getTargetId()];
5454
});
5555

56+
$('#mute-toggle').click(function () {
57+
document.getElementById('remoteVideo').muted = !document.getElementById('remoteVideo').muted;
58+
document.getElementById('screenVideo').muted = !document.getElementById('screenVideo').muted;
59+
});
60+
5661
$('#target-screen').click(function() {
5762
const config = {
5863
audio: {

src/samples/p2p/peercall.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,9 @@ <h2>P2P Sample</h2>
9090
<button id="target-video-unpublish">Stop Camera Sharing</button>
9191
<button id="target-peerconnection-stop">Stop Conversation</button>
9292
<button id="target-screen">Share Screen</button>
93+
<br>
94+
<br>
95+
<button id="mute-toggle">Mute/Unmute</button>
9396
</p>
9497
</div>
9598
<div id="sendreceive">

0 commit comments

Comments
 (0)