Skip to content

Commit

Permalink
Add option for disable audio
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexxIT committed Apr 12, 2021
1 parent fd510de commit 46ed82e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion custom_components/webrtc/www/webrtc-camera.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ class WebRTCCamera extends HTMLElement {
// recvonly don't work with Firefox
// "Answer tried to set recv when offer did not set send"
pc.addTransceiver('video', {'direction': 'sendrecv'})
pc.addTransceiver('audio', {'direction': 'sendrecv'})
if (this.config.audio !== false) {
pc.addTransceiver('audio', {'direction': 'sendrecv'})
}

const pingChannel = pc.createDataChannel('foo');
pingChannel.onopen = () => {
Expand Down

0 comments on commit 46ed82e

Please sign in to comment.