diff --git a/package.json b/package.json index 38f680f5..85176050 100644 --- a/package.json +++ b/package.json @@ -33,8 +33,8 @@ "author": "Miroslav Pejic", "license": "AGPL-3.0", "dependencies": { - "@sentry/integrations": "7.55.2", - "@sentry/node": "7.55.2", + "@sentry/integrations": "7.56.0", + "@sentry/node": "7.56.0", "axios": "^1.4.0", "body-parser": "1.20.2", "colors": "1.4.0", @@ -43,12 +43,12 @@ "crypto-js": "4.1.1", "express": "4.18.2", "httpolyglot": "0.1.2", - "mediasoup": "3.12.3", - "mediasoup-client": "3.6.87", + "mediasoup": "3.12.4", + "mediasoup-client": "3.6.89", "ngrok": "^4.3.3", "openai": "^3.3.0", "qs": "6.11.2", - "socket.io": "4.6.2", + "socket.io": "4.7.0", "swagger-ui-express": "4.6.3", "uuid": "9.0.0", "xss": "^1.0.14", diff --git a/public/sfu/MediasoupClient.js b/public/sfu/MediasoupClient.js index ce490f91..cf92e541 100644 --- a/public/sfu/MediasoupClient.js +++ b/public/sfu/MediasoupClient.js @@ -9089,7 +9089,7 @@ return this._pc.getStats(); } async send({ track, encodings, codecOptions, codec }) { - var _a; + var _a, _b; this.assertSendDirection(); logger.debug('send() [kind:%s, track.id:%s]', track.kind, track.id); if (encodings && encodings.length > 1) { @@ -9144,8 +9144,19 @@ logger.debug('send() | calling pc.setLocalDescription() [offer:%o]', offer); await this._pc.setLocalDescription(offer); // We can now get the transceiver.mid. - const localId = transceiver.mid; + // NOTE: We cannot read generated MID on iOS react-native-webrtc 111.0.0 + // because transceiver.mid is not available until setRemoteDescription() + // is called, so this is best effort. + // Issue: https://github.com/react-native-webrtc/react-native-webrtc/issues/1404 + // NOTE: So let's fill MID in sendingRtpParameters later. + let localId = (_b = transceiver.mid) !== null && _b !== void 0 ? _b : undefined; + if (!localId) { + logger.warn( + 'send() | missing transceiver.mid (bug in react-native-webrtc, using a workaround', + ); + } // Set MID. + // NOTE: As per above, it could be unset yet. sendingRtpParameters.mid = localId; localSdpObject = sdpTransform.parse(this._pc.localDescription.sdp); offerMediaObject = localSdpObject.media[mediaSectionIdx.idx]; @@ -9196,6 +9207,12 @@ const answer = { type: 'answer', sdp: this._remoteSdp.getSdp() }; logger.debug('send() | calling pc.setRemoteDescription() [answer:%o]', answer); await this._pc.setRemoteDescription(answer); + // Follow up of iOS react-native-webrtc 111.0.0 issue told above. Now yes, + // we can read generated MID (if not done above) and fill sendingRtpParameters. + if (!localId) { + localId = transceiver.mid; + sendingRtpParameters.mid = localId; + } // Store in the map. this._mapMidTransceiver.set(localId, transceiver); return { @@ -12624,7 +12641,7 @@ /** * Expose mediasoup-client version. */ - exports.version = '3.6.87'; + exports.version = '3.6.89'; /** * Expose parseScalabilityMode() function. */