question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Muting remote stream

See original GitHub issue

Hi,

I’m trying to mute stream when user gets phone call,

peer.getRemoteStreams()[0].getAudioTracks()[0].enabled = false

but still hear the stream.

any ideas ?


Also want to ask one question , I’ve tried to update webrtc to the last version and it works well, except for one fact, I get iceConnectionState = field almost immediately if it lost the network connection and I need to reconnect,

while using the current version of webRTC, I’m getting this state after 15 sec, it means, if I find the network before I get iceConnectionState = false, I stay connected with another peer and that certainly pleases me,

is this behaviour is intended ?

Platform information

Android 7, RN 0.43.4, RN webRTC 1.54.7

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:18 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
molnartimicommented, Jan 28, 2021

This was fixed some time ago, I forgot to close this issue. oney/react-native-webrtc@5b9e9f9

@saghul How to disable/mute remote audio track in Jitsi (android and iOS) since it use react-native-webrtc under the hood?

I succeeded to disable remote tracks in Jitsi this way: track.jitsiTrack.getTrack().enabled = false where track is a track from track list in Redux store.

1reaction
sebamaruccicommented, Jul 8, 2020

Hi, I have a workaround. Based on what @tombaki reported and @napanda 's fix, I update the function (RTCMediaStreamTrack*)trackForId:(NSString*)trackId on file WebRTCModule+RTCMediaStream.m. Now it look like this:

- (RTCMediaStreamTrack*)trackForId:(NSString*)trackId
{
  RTCMediaStreamTrack *track = self.localTracks[trackId];
  if (!track) {
      for(NSNumber *key in [self.peerConnections allKeys]) {
          RTCPeerConnection *peerConnection = self.peerConnections[key];
          if (peerConnection) {
              for(NSNumber *key2 in [peerConnection.remoteTracks allKeys]) {
                  RTCMediaStreamTrack *track1 = peerConnection.remoteTracks[key2];
                  if (track1 && [track1.trackId isEqualToString:trackId]) {
                      track = track1;
                      break;
                  }
              }
          }
      }
  }
  return track;
}

Now I’m able to mute/unmute the remote stream. if @saghul could check in this fix and publish a new version it would be great. Also, I think the Android version needs to get fixed.

Cheers

Read more comments on GitHub >

github_iconTop Results From Across the Web

how to mute the voice of the remote media stream?
The muting of local stream works fine, but this way doesn't work on the remote stream. 在 2012年10月30日星期二UTC+8上午8时19分03秒,Vikas写道:.
Read more >
Muting And Unmuting A Remote User In A Video Call Web App
In this tutorial, we will develop a web application that supports muting and unmuting the video and audio streams of remote users in...
Read more >
Muting And Unmuting A Remote User In A Video Call Web
Learn how to build a group video call web application with a service to mute or unmute remote users using the Agora Web...
Read more >
Mute Media | LiveSwitch Cloud Documentation
In this tutorial, you'll learn how to mute local media so that other participants don't see or hear you, and mute remote media...
Read more >
Marker Muting while Live Streaming - Swivl Help Center
Marker Muting while Live Streaming · Firmly double-click the red 'record' button on your Primary Marker. · All Markers will be muted ·...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found