Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Audio: Disable all remote stream audio #1417

Closed
manoj-paramesh-learngram-ai opened this issue Jul 7, 2023 · 1 comment
Closed

Audio: Disable all remote stream audio #1417

manoj-paramesh-learngram-ai opened this issue Jul 7, 2023 · 1 comment

Comments

@manoj-paramesh-learngram-ai
Copy link

Using ReactNativeWebRTC with jitsi, as per my understanding, the audio in the streams are automatically played in the device as long the RTCPeerConnection is connected.

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); 

Expected Behavior:

Would want the ability to mute all incoming audio streams with a trigger and then enable it back again with the same trigger.

Observed Behavior:

Cannot control the audio in the remote stream

Steps to reproduce the issue:

NA

Platform Information

  • React Native Version: 0.63.3
  • WebRTC Module Version: 1.92.1
  • Platform OS + Version: Android / iOS

Please help out on to achieve this functionality

@saghul
Copy link
Member

saghul commented Jul 7, 2023

You can just set remoteTrack.enabled to false for every track and that's it, it won't be played back.

That is all that's necessary from the perspective of this library.

In order to make it work in jitsi meet you'll need to find where to get the tracks in order to disable them, but that is a question for the jitsi meet repo / community.

@saghul saghul closed this as not planned Won't fix, can't repro, duplicate, stale Jul 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants