# Silence all remote media streams

**URL:** <https://react-native-webrtc.discourse.group/t/silence-all-remote-media-streams/1787>\
**Category:** General040642add70aa006ef56b5af5b5acae3\
**Created:** [July 3, 2023, 12:52pm UTC](https://react-native-webrtc.discourse.group/t/silence-all-remote-media-streams/1787 "2023-07-03T12:52:34Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![thedarkstrix](https://avatars.discourse-cdn.com/v4/letter/t/b4bc9f/32.png) [@thedarkstrix](https://react-native-webrtc.discourse.group/u/thedarkstrix)\
**Post date:** [July 3, 2023, 12:52pm UTC](https://react-native-webrtc.discourse.group/t/silence-all-remote-media-streams/1787/1 "2023-07-03T12:52:34Z")

</div>

Info: We are using react-native-webrtc with jitsi.

The functionality required , on trigger we are looking to silence all audio streams , once its silenced with the same trigger all the silenced streams should be active, we can think them as setting the volume to 0 and to set it back to 1 (0 being silenced & 1 being active).

We currently have initialised webRTC [React Native]

```auto
import {
  MediaStream,
  MediaStreamTrack,
  RTCSessionDescription,
  RTCIceCandidate,
  mediaDevices,
  permissions,
} from "react-native-webrtc";

import RTCPeerConnection from "./RTCPeerConnection";

((global) => {
  if (typeof global.MediaStream === "undefined") {
    global.MediaStream = MediaStream;
  }
  if (typeof global.MediaStreamTrack === "undefined") {
    global.MediaStreamTrack = MediaStreamTrack;
  }
  if (typeof global.RTCIceCandidate === "undefined") {
    global.RTCIceCandidate = RTCIceCandidate;
  }
  if (typeof global.RTCPeerConnection === "undefined") {
    global.RTCPeerConnection = RTCPeerConnection;
  }
  if (typeof global.RTCPeerConnection === "undefined") {
    global.webkitRTCPeerConnection = RTCPeerConnection;
  }
  if (typeof global.RTCSessionDescription === "undefined") {
    global.RTCSessionDescription = RTCSessionDescription;
  }

  const navigator = global.navigator;

  if (navigator) {
    if (typeof navigator.mediaDevices === "undefined") {
      navigator.mediaDevices = mediaDevices;
    }
    if (typeof navigator.permissions === "undefined") {
      navigator.permissions = permissions;
    }
  }
})(global || window || this);

```

What are the ways by which this can be accomplished ? Any help is greatly appreciated .

Also how to disable audio output and enable it again ?

Note: We are using react-native

CC: @saghul

---

<div class="post-metadata">

**Author:** ![8BallBomBom](https://yyz2.discourse-cdn.com/free1/user_avatar/react-native-webrtc.discourse.group/8ballbombom/32/710_2.png) [@8BallBomBom](https://react-native-webrtc.discourse.group/u/8BallBomBom)\
**Post date:** [July 7, 2023, 11:21am UTC](https://react-native-webrtc.discourse.group/t/silence-all-remote-media-streams/1787/2 "2023-07-07T11:21:28Z")

</div>

Answered over [here](https://github.com/react-native-webrtc/react-native-webrtc/issues/1417) on GitHub.
