Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
wants to merge 1 commit into from

Conversation

quanli168
Copy link

This PR attempts to fix #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
Copy link

snnz commented Jun 21, 2023

I think sendingRtpParameters should also be updated.

@Mirzahmet
Copy link

I think sendingRtpParameters should also be updated.

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

@snnz
Copy link

snnz commented Jun 22, 2023

sendingRtpParameters.mid of course.

@Mirzahmet
Copy link

sendingRtpParameters.mid of course.

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

@ibc
Copy link
Member

ibc commented Jun 23, 2023

Related issue reported in react-native-webrtc project: react-native-webrtc/react-native-webrtc#1404

@ibc
Copy link
Member

ibc commented Jun 23, 2023

Here something I personally hate:

  • A clear bug is discovered in react-native-webrtc.
  • Instead of reporting the issue in react-native-webrtc, we end with an issue + controversial workaround PR in mediasoup-client project. Why?

BTW I've reported the issue in react-native-webrtc project: react-native-webrtc/react-native-webrtc#1404

ibc added a commit that referenced this pull request Jun 23, 2023
…tc 111 on iOS (unset transceiver.mid)

- Fixes issue #263
- Replaces PR #264
- Issue in react-native-webrtc: react-native-webrtc/react-native-webrtc#1404

### Details

- `ReactNativeWithUnifiedPlan`: Read `transceiver.mid` after calling `pc.setRemoteDescription()` since it's set then (and not before, bug in react-native-webrtc).
- Problem of this approach is that we are generating the remote SDP without MID (since we don't know it yet). Not sure about the implications. I'm pretty sure that the new media section in the SDP **does** contain proper `a=mid` (it's just that `transceiver.mid` returns `null`), and in this PR we are calling `setRemoteDescription()` with a remote media section that doesn't contain `a=mid`.
@ibc
Copy link
Member

ibc commented Jun 23, 2023

Feedback given in this PR makes sense plus this PR fails at lint task. I'm doing another one here: #271

@ibc ibc closed this Jun 23, 2023
ibc added a commit that referenced this pull request Jun 23, 2023
…tc 111 on iOS (unset transceiver.mid) (#271)

- Fixes issue #263
- Replaces PR #264
- Issue in react-native-webrtc: react-native-webrtc/react-native-webrtc#1404

### Details

- `ReactNativeWithUnifiedPlan`: Read `transceiver.mid` after calling `pc.setRemoteDescription()` since it's set then (and not before, bug in react-native-webrtc).
- Problem of this approach is that we are generating the remote SDP without MID (since we don't know it yet). Not sure about the implications. I'm pretty sure that the new media section in the SDP **does** contain proper `a=mid` (it's just that `transceiver.mid` returns `null`), and in this PR we are calling `setRemoteDescription()` with a remote media section that doesn't contain `a=mid`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

React Native producer localId is null
4 participants