how react-native-webrtc consume stream in one RTCView render?

I use react-native-webrtc and mediacoup3 to develop a video conference system. There is a problem that bothers me.
Mediasoup sends video stream and audio stream separately, but RTCView of react-native-webrtc can only consume one stream. I had to use two RTCView for both video and audio. It seems strange. Can someone tell me what best practices are?
thanks!

<View style={styles.videortcview}>
          <RTCView style={styles.rtc}
          mirror={true}
          objectFit='cover'
          zOrder={200}
          streamURL={videostream?videostream.toURL():""}
          />
       </View>
<View >
          <RTCView style={styles.audio}
          mirror={false}
          objectFit='cover'
          zOrder={0}
          streamURL={audiostream?audiostream.toURL():""}
          />
</View>

Please learn the difference between MediaStream and MediaStreamTrack.

3 Likes

Great. Thank you so much. It works! :smiley:

rc.on(RoomClient.EVENTS.audioStreamChange, () => {
      let stream = rc.getRemoteAudioStream();
      console.log("audiostream: "+stream.toURL())
      //setAudiostream(stream)
      setLargestream(largestream.addTrack(stream.getTrackById(stream.getAudioTracks()[0].id)))
    })