As I understand this code should mute incoming audio:
var config = this.props.mixertest.webrtcStuff
if(config.remoteStream){
var pc = config.pc
var streams = pc._remoteStreams
streams[0].getTracks().forEach(track => track.enabled = !track.enabled)
}}}
It does change track.enabled value but audio doesn't get muted. What did I miss? Is there other way to mute incoming audio?
yes, you are right.
but I only test on local tracks not sure about if we can mute the remote stream that way.
it's obvious there are only 3 ways:
see how official webrtc app does is always a good direction to understand it's ability
so in your opinion it's impossible to do it locally?
everything is possible :)
I just didn't find any implementations does that yet.
my guess is:
if you can get AudioPlayer instance which created by webrtc, you might able to use AudioPlayer API to pause it.
by webrtc documents: https://www.w3.org/TR/webrtc/#hold-functionality
it shows how to implement "hold" functionality, but it seems like the same as my previous comments point 3.
This module did not implement RTCRtpTransceiver, RTCRtpReceiver, RTCRtpSender yet.
and I believe those are interfaces which control local/remote media streams' rendering.
@szymonzmyslony
I tried streams[0].getTracks().forEach(track => track.enabled = !track.enabled) . But nothing changed. Have you succeeded in muting remote audio??
no, I dont know how to it yet. Any comments would be appreciated.
@szymonzmyslony @atyenoria did you ever manage to find a workaround?
@zxcpoiu you seemed knowledgeable with the details :) .. do you know a good work-around to this issue?
Toggling enabled (and muted)-properties on local and remote stream audio tracks won't work.
Pretty sure this has been fixed now. Closing and if its still an issue for someone can you make a new issue?
Most helpful comment
@szymonzmyslony @atyenoria did you ever manage to find a workaround?
@zxcpoiu you seemed knowledgeable with the details :) .. do you know a good work-around to this issue?
Toggling enabled (and muted)-properties on local and remote stream audio tracks won't work.