Skip to content

Commit

Permalink
Merge pull request #892 from lautaroalvarez/master
Browse files Browse the repository at this point in the history
Set initial isAudioMuted value depending on stream tracks
  • Loading branch information
muaz-khan authored Apr 22, 2020
2 parents 97f1a10 + bb04791 commit 3ab6624
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion dev/RTCMultiConnection.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@
if (typeof StreamsHandler !== 'undefined') {
StreamsHandler.setHandlers(stream, true, connection);
}
var isAudioMuted = stream.getAudioTracks().filter(function(track) {
return track.enabled;
}).length === 0;

connection.streamEvents[stream.streamid] = {
stream: stream,
Expand All @@ -46,7 +49,7 @@
userid: connection.userid,
extra: connection.extra,
streamid: stream.streamid,
isAudioMuted: true
isAudioMuted: isAudioMuted
};

try {
Expand Down

0 comments on commit 3ab6624

Please sign in to comment.