versatica / mediasoup-client

mediasoup client side JavaScript library
https://mediasoup.org
ISC License
591 stars 237 forks source link

ReactNative: transceiver.mid is not available until setRemoteDescription is called #264

Closed quanli168 closed 1 year ago

quanli168 commented 1 year ago

This PR attempts to fix https://github.com/versatica/mediasoup-client/issues/263.

The issue is transciever.mid is not available after calling pc.setLocalDescription. Since mediasoup-client uses mid as the key to _mapMidTransceiver map, without a valid mid, future call to producer.close() finds wrong transceiver to turn off.

After enabling react-native-webrtc logs,I noticed that transeiver.mid is properly updated in pc.setRemoteDescription, therefore I added code to update the mid after the call.

snnz commented 1 year ago

I think sendingRtpParameters should also be updated.

Mirzahmet commented 1 year ago

I think sendingRtpParameters should also be updated.

and what exactly needs to be updated do not tell me?

snnz commented 1 year ago

sendingRtpParameters.mid of course.

Mirzahmet commented 1 year ago

sendingRtpParameters.mid of course.

you correctly noted. But will it work or should the following actions be rewritten too? it might say @ibc

ibc commented 1 year ago

Related issue reported in react-native-webrtc project: https://github.com/react-native-webrtc/react-native-webrtc/issues/1404

ibc commented 1 year ago

Here something I personally hate:

BTW I've reported the issue in react-native-webrtc project: https://github.com/react-native-webrtc/react-native-webrtc/issues/1404

ibc commented 1 year ago

Feedback given in this PR makes sense plus this PR fails at lint task. I'm doing another one here: https://github.com/versatica/mediasoup-client/pull/271