I can make the webrtc call between 2 parties with video and audio stream together. Is there any way to give user to stop sharing only video or audio during the call?
Assume
A and B are in a webrtc call
during the Call A just stop his video channel so b can only listen the A's voice/audio not video. When A resume video again B can see A face again.
Can anyone help?
I have already solved it in a efficient way. I have hanlded the local stream audio and video to pasue and resume. See my below way
To pause a local video steam to connected partner: mediastream.getVideoTracks()[0].enabled = false;
To resume a local video steam to connected partner: mediastream.getVideoTracks()[0].enabled = true;
for audio: pasue: mediastream.getAudioTracks()[0].enabled = false;
resume: mediastream.getAudioTracks()[0].enabled = true;
It is working perfectly in my project.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With