i am using android and mediasoup client 3.2.11 . Local camera stream is being played using rtcview tag but remote stream cannot be played. it is showing black. No error in debug console. remotestream.toUrl() shows valid id which is feed to rtcview but its not playing. please refer for more detail of this issue https://mediasoup.discourse.group/t/consumer-no-video-in-react-native/345
_Originally posted by @ashishvista in https://github.com/react-native-webrtc/react-native-webrtc/issues/717#issuecomment-549003508_
In WebRTCModule.java a similar issue in #717 exists where the remote tracks are _not_ being added when addTrack is being called from a new MediaStream object.
Changing:
private void mediaStreamAddTrackAsync(String streamId, String trackId) {
MediaStream stream = localStreams.get(streamId);
MediaStreamTrack track = getLocalTrack(trackId);
to
private void mediaStreamAddTrackAsync(String streamId, String trackId) {
MediaStream stream = localStreams.get(streamId);
MediaStreamTrack track = getTrack(trackId);
Should fix the issue for android.
Remove track will also need the change:
private void mediaStreamRemoveTrackAsync(String streamId, String trackId) {
MediaStream stream = localStreams.get(streamId);
MediaStreamTrack track = getLocalTrack(trackId);
changed to:
private void mediaStreamRemoveTrackAsync(String streamId, String trackId) {
MediaStream stream = localStreams.get(streamId);
MediaStreamTrack track = getTrack(trackId);
@ltripoli it is working in android with above solution. Thanks a lot. Please make PR for this.
@saghul please publish this to npm
@ashishvista @ltripoli @saghul I am still facing the issue.
I am trying mediasoup-client based on my react-native app on Android device using the latest react-native-webrtc 1.75.3 and mediasoup-client 3.6.5.
The above mentioned fix is already there.
Even after getting URL for remote stream. feed to rtcview is not working. Plain blank screen.
Same here I'm having an issue in remoteStream it doesn't display anything even we already got the URL of the stream. Can someone help me please thank you :)
@Dilpesh Did you solve the problem? I'm facing the same issue, using the latest libraries.
Most helpful comment
Remove track will also need the change:
changed to: