From 76aa82b675901ade0909ba350a69d4e7c9f95891 Mon Sep 17 00:00:00 2001 From: davidliu Date: Mon, 29 May 2023 23:18:01 +0900 Subject: [PATCH 01/21] feat: switch to livekit m104 webrtc --- android/build.gradle | 2 +- ...brtc.podspec => livekit-react-native-webrtc.podspec | 10 +++++----- package-lock.json | 8 ++++---- package.json | 10 +++++----- 4 files changed, 15 insertions(+), 15 deletions(-) rename react-native-webrtc.podspec => livekit-react-native-webrtc.podspec (60%) diff --git a/android/build.gradle b/android/build.gradle index 803c19d87..5683021d8 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -25,5 +25,5 @@ android { dependencies { implementation 'com.facebook.react:react-native:+' - api 'org.jitsi:webrtc:111.+' + api 'io.github.webrtc-sdk:android:104.5112.09' } diff --git a/react-native-webrtc.podspec b/livekit-react-native-webrtc.podspec similarity index 60% rename from react-native-webrtc.podspec rename to livekit-react-native-webrtc.podspec index 2a565e6a7..174ade2d8 100644 --- a/react-native-webrtc.podspec +++ b/livekit-react-native-webrtc.podspec @@ -3,13 +3,13 @@ require 'json' package = JSON.parse(File.read(File.join(__dir__, 'package.json'))) Pod::Spec.new do |s| - s.name = package['name'] + s.name = 'livekit-react-native-webrtc' s.version = package['version'] s.summary = package['description'] - s.homepage = 'https://github.com/react-native-webrtc/react-native-webrtc' + s.homepage = 'https://github.com/livekit/react-native-webrtc' s.license = package['license'] - s.author = 'https://github.com/react-native-webrtc/react-native-webrtc/graphs/contributors' - s.source = { :git => 'git@github.com:react-native-webrtc/react-native-webrtc.git', :tag => 'release #{s.version}' } + s.author = 'https://github.com/livekit/react-native-webrtc/graphs/contributors' + s.source = { :git => 'git@github.com:livekit/react-native-webrtc.git', :tag => 'release #{s.version}' } s.requires_arc = true s.platforms = { :ios => '12.0', :osx => '10.13' } @@ -19,5 +19,5 @@ Pod::Spec.new do |s| s.libraries = 'c', 'sqlite3', 'stdc++' s.framework = 'AudioToolbox','AVFoundation', 'CoreAudio', 'CoreGraphics', 'CoreVideo', 'GLKit', 'VideoToolbox' s.dependency 'React-Core' - s.dependency 'JitsiWebRTC', '~> 111.0.0' + s.dependency 'WebRTC-SDK', '=104.5112.17' end diff --git a/package-lock.json b/package-lock.json index 0794ea75e..e404ae9db 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { - "name": "react-native-webrtc", - "version": "111.0.1", + "name": "@livekit/react-native-webrtc", + "version": "104.0.0", "lockfileVersion": 2, "requires": true, "packages": { "": { - "name": "react-native-webrtc", - "version": "111.0.1", + "name": "@livekit/react-native-webrtc", + "version": "104.0.0", "license": "MIT", "dependencies": { "adm-zip": "0.5.9", diff --git a/package.json b/package.json index e597f3b0b..33c94ada7 100644 --- a/package.json +++ b/package.json @@ -1,13 +1,13 @@ { - "name": "react-native-webrtc", - "version": "111.0.1", + "name": "@livekit/react-native-webrtc", + "version": "104.0.0", "repository": { "type": "git", - "url": "git+https://github.com/react-native-webrtc/react-native-webrtc.git" + "url": "git+https://github.com/livekit/react-native-webrtc.git" }, "description": "WebRTC for React Native", "license": "MIT", - "homepage": "https://github.com/react-native-webrtc/react-native-webrtc", + "homepage": "https://github.com/livekit/react-native-webrtc", "keywords": [ "react-component", "react-native", @@ -35,7 +35,7 @@ "format": "tools/format.sh" }, "bugs": { - "url": "https://github.com/react-native-webrtc/react-native-webrtc/issues" + "url": "https://github.com/livekit/react-native-webrtc/issues" }, "devDependencies": { "@types/debug": "4.1.7", From 9dce71104e6672dd50498061672664def0e7a2c7 Mon Sep 17 00:00:00 2001 From: davidliu Date: Sat, 3 Jun 2023 02:37:24 +0900 Subject: [PATCH 02/21] android: remove setEnableVolumeLogger call --- android/src/main/java/com/oney/WebRTCModule/WebRTCModule.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/android/src/main/java/com/oney/WebRTCModule/WebRTCModule.java b/android/src/main/java/com/oney/WebRTCModule/WebRTCModule.java index 6ec91b0b9..48f643e1f 100644 --- a/android/src/main/java/com/oney/WebRTCModule/WebRTCModule.java +++ b/android/src/main/java/com/oney/WebRTCModule/WebRTCModule.java @@ -88,7 +88,7 @@ public WebRTCModule(ReactApplicationContext reactContext) { } if (adm == null) { - adm = JavaAudioDeviceModule.builder(reactContext).setEnableVolumeLogger(false).createAudioDeviceModule(); + adm = JavaAudioDeviceModule.builder(reactContext).createAudioDeviceModule(); } Log.d(TAG, "Using video encoder factory: " + encoderFactory.getClass().getCanonicalName()); From 2cdc7883482de5e9711fb7e7076817f45bdc5393 Mon Sep 17 00:00:00 2001 From: davidliu Date: Thu, 8 Jun 2023 21:12:36 +0900 Subject: [PATCH 03/21] ios, android: setCodecPreferences implementations (#2) * ios: setCodecPreferences * android: set codec preferences * chore: lint fixes * more lint fixes --- .../com/oney/WebRTCModule/SerializeUtils.java | 39 ++++++- .../com/oney/WebRTCModule/WebRTCModule.java | 101 +++++++++++++++--- ios/RCTWebRTC/SerializeUtils.h | 3 + ios/RCTWebRTC/SerializeUtils.m | 55 ++++++++-- ios/RCTWebRTC/WebRTCModule+Transceivers.m | 92 ++++++++++++++-- src/RTCRtpCapabilities.ts | 51 +-------- src/RTCRtpReceiver.ts | 12 +-- src/RTCRtpSender.ts | 12 +-- src/RTCRtpTransceiver.ts | 9 ++ 9 files changed, 266 insertions(+), 108 deletions(-) diff --git a/android/src/main/java/com/oney/WebRTCModule/SerializeUtils.java b/android/src/main/java/com/oney/WebRTCModule/SerializeUtils.java index 2886e4099..1bc93560f 100644 --- a/android/src/main/java/com/oney/WebRTCModule/SerializeUtils.java +++ b/android/src/main/java/com/oney/WebRTCModule/SerializeUtils.java @@ -170,11 +170,7 @@ public static ReadableMap serializeRtpParameters(RtpParameters params) { } // Serializing sdpFmptLine. if (!codec.parameters.isEmpty()) { - final String sdpFmptLineParams = codec.parameters.keySet() - .stream() - .map(key -> key + "=" + codec.parameters.get(key)) - .collect(Collectors.joining(";")); - codecMap.putString("sdpFmtpLine", sdpFmptLineParams); + codecMap.putString("sdpFmtpLine", serializeSdpParameters(codec.parameters)); } codecs.pushMap(codecMap); @@ -192,6 +188,39 @@ public static ReadableMap serializeRtpParameters(RtpParameters params) { return result; } + public static ReadableMap serializeRtpCapabilities(RtpCapabilities capabilities) { + WritableMap result = Arguments.createMap(); + WritableArray codecs = Arguments.createArray(); + + capabilities.codecs.forEach(codec -> codecs.pushMap(serializeRtpCapabilitiesCodec(codec))); + + result.putArray("codecs", codecs); + return result; + } + + public static ReadableMap serializeRtpCapabilitiesCodec(RtpCapabilities.CodecCapability codec) { + WritableMap codecMap = Arguments.createMap(); + codecMap.putInt("payloadType", codec.preferredPayloadType); + codecMap.putString("mimeType", codec.mimeType); + codecMap.putInt("clockRate", codec.clockRate); + if (codec.numChannels != null) { + codecMap.putInt("channels", codec.numChannels); + } + if (!codec.parameters.isEmpty()) { + codecMap.putString("sdpFmtpLine", serializeSdpParameters(codec.parameters)); + } + + return codecMap; + } + + // For serializing sdpFmptLine. + public static String serializeSdpParameters(Map parameters) { + return parameters.keySet() + .stream() + .map(key -> key + "=" + parameters.get(key)) + .collect(Collectors.joining(";")); + } + /** * Parsing APIs */ diff --git a/android/src/main/java/com/oney/WebRTCModule/WebRTCModule.java b/android/src/main/java/com/oney/WebRTCModule/WebRTCModule.java index 48f643e1f..d1f68af33 100644 --- a/android/src/main/java/com/oney/WebRTCModule/WebRTCModule.java +++ b/android/src/main/java/com/oney/WebRTCModule/WebRTCModule.java @@ -1,6 +1,7 @@ package com.oney.WebRTCModule; import android.util.Log; +import android.util.Pair; import android.util.SparseArray; import androidx.annotation.NonNull; @@ -695,6 +696,68 @@ public void transceiverSetDirection(int id, String senderId, String direction, P }); } + @ReactMethod(isBlockingSynchronousMethod = true) + public void transceiverSetCodecPreferences(int id, String senderId, ReadableArray codecPreferences) { + ThreadUtils.runOnExecutor(() -> { + WritableMap identifier = Arguments.createMap(); + WritableMap params = Arguments.createMap(); + identifier.putInt("peerConnectionId", id); + identifier.putString("transceiverId", senderId); + try { + PeerConnectionObserver pco = mPeerConnectionObservers.get(id); + if (pco == null) { + Log.d(TAG, "transceiverSetDirection() peerConnectionObserver is null"); + return; + } + RtpTransceiver transceiver = pco.getTransceiver(senderId); + if (transceiver == null) { + Log.d(TAG, "transceiverSetDirection() transceiver is null"); + return; + } + + // Convert JSON codec capabilities to the actual objects. + RtpTransceiver.RtpTransceiverDirection direction = transceiver.getDirection(); + List, RtpCapabilities.CodecCapability>> availableCodecs = new ArrayList<>(); + + if (direction.equals(RtpTransceiver.RtpTransceiverDirection.SEND_RECV) + || direction.equals(RtpTransceiver.RtpTransceiverDirection.SEND_ONLY)) { + RtpCapabilities capabilities = mFactory.getRtpSenderCapabilities(transceiver.getMediaType()); + for (RtpCapabilities.CodecCapability codec : capabilities.codecs) { + Map codecDict = SerializeUtils.serializeRtpCapabilitiesCodec(codec).toHashMap(); + availableCodecs.add(new Pair<>(codecDict, codec)); + } + } + + if (direction.equals(RtpTransceiver.RtpTransceiverDirection.SEND_RECV) + || direction.equals(RtpTransceiver.RtpTransceiverDirection.RECV_ONLY)) { + RtpCapabilities capabilities = mFactory.getRtpReceiverCapabilities(transceiver.getMediaType()); + for (RtpCapabilities.CodecCapability codec : capabilities.codecs) { + Map codecDict = SerializeUtils.serializeRtpCapabilitiesCodec(codec).toHashMap(); + availableCodecs.add(new Pair<>(codecDict, codec)); + } + } + + // Codec preferences is order sensitive. + List codecsToSet = new ArrayList<>(); + + for (int i = 0; i < codecPreferences.size(); i++) { + Map codecPref = codecPreferences.getMap(i).toHashMap(); + for (Pair, RtpCapabilities.CodecCapability> pair : availableCodecs) { + Map availableCodecDict = pair.first; + if (codecPref.equals(availableCodecDict)) { + codecsToSet.add(pair.second); + break; + } + } + } + + transceiver.setCodecPreferences(codecsToSet); + } catch (Exception e) { + Log.d(TAG, "transceiverSetCodecPreferences(): " + e.getMessage()); + } + }); + } + @ReactMethod public void getDisplayMedia(Promise promise) { ThreadUtils.runOnExecutor(() -> getUserMediaImpl.getDisplayMedia(promise)); @@ -1093,18 +1156,21 @@ public void onSetFailure(String s) { } @ReactMethod(isBlockingSynchronousMethod = true) - public WritableMap receiverGetCapabilities() { + public WritableMap receiverGetCapabilities(String kind) { try { return (WritableMap) ThreadUtils .submitToExecutor((Callable) () -> { - VideoCodecInfo[] videoCodecInfos = mVideoDecoderFactory.getSupportedCodecs(); - WritableMap params = Arguments.createMap(); - WritableArray codecs = Arguments.createArray(); - for (VideoCodecInfo codecInfo : videoCodecInfos) { - codecs.pushMap(SerializeUtils.serializeVideoCodecInfo(codecInfo)); + MediaStreamTrack.MediaType mediaType; + if (kind.equals("audio")) { + mediaType = MediaStreamTrack.MediaType.MEDIA_TYPE_AUDIO; + } else if (kind.equals("video")) { + mediaType = MediaStreamTrack.MediaType.MEDIA_TYPE_VIDEO; + } else { + return Arguments.createMap(); } - params.putArray("codecs", codecs); - return params; + + RtpCapabilities capabilities = mFactory.getRtpReceiverCapabilities(mediaType); + return SerializeUtils.serializeRtpCapabilities(capabilities); }) .get(); } catch (ExecutionException | InterruptedException e) { @@ -1114,18 +1180,21 @@ public WritableMap receiverGetCapabilities() { } @ReactMethod(isBlockingSynchronousMethod = true) - public WritableMap senderGetCapabilities() { + public WritableMap senderGetCapabilities(String kind) { try { return (WritableMap) ThreadUtils .submitToExecutor((Callable) () -> { - VideoCodecInfo[] videoCodecInfos = mVideoEncoderFactory.getSupportedCodecs(); - WritableMap params = Arguments.createMap(); - WritableArray codecs = Arguments.createArray(); - for (VideoCodecInfo codecInfo : videoCodecInfos) { - codecs.pushMap(SerializeUtils.serializeVideoCodecInfo(codecInfo)); + MediaStreamTrack.MediaType mediaType; + if (kind.equals("audio")) { + mediaType = MediaStreamTrack.MediaType.MEDIA_TYPE_AUDIO; + } else if (kind.equals("video")) { + mediaType = MediaStreamTrack.MediaType.MEDIA_TYPE_VIDEO; + } else { + return Arguments.createMap(); } - params.putArray("codecs", codecs); - return params; + + RtpCapabilities capabilities = mFactory.getRtpSenderCapabilities(mediaType); + return SerializeUtils.serializeRtpCapabilities(capabilities); }) .get(); } catch (ExecutionException | InterruptedException e) { diff --git a/ios/RCTWebRTC/SerializeUtils.h b/ios/RCTWebRTC/SerializeUtils.h index 62e53948a..412618061 100644 --- a/ios/RCTWebRTC/SerializeUtils.h +++ b/ios/RCTWebRTC/SerializeUtils.h @@ -1,4 +1,5 @@ #import +#import #import #import #import @@ -13,6 +14,8 @@ receiver:(RTCRtpReceiver *_Nonnull)receiver; + (NSDictionary *_Nonnull)trackToJSONWithPeerConnectionId:(nonnull NSNumber *)id track:(RTCMediaStreamTrack *_Nonnull)track; ++ (NSDictionary *_Nonnull)capabilitiesToJSON:(RTCRtpCapabilities *_Nonnull)capabilities; ++ (NSDictionary *_Nonnull)codecCapabilityToJSON:(RTCRtpCodecCapability *)codec; + (NSString *_Nonnull)serializeDirection:(RTCRtpTransceiverDirection)direction; + (RTCRtpTransceiverDirection)parseDirection:(NSString *_Nonnull)direction; + (RTCRtpTransceiverInit *_Nonnull)parseTransceiverOptions:(NSDictionary *_Nonnull)parameters; diff --git a/ios/RCTWebRTC/SerializeUtils.m b/ios/RCTWebRTC/SerializeUtils.m index f75631c56..3895830ea 100644 --- a/ios/RCTWebRTC/SerializeUtils.m +++ b/ios/RCTWebRTC/SerializeUtils.m @@ -128,13 +128,7 @@ + (NSDictionary *)parametersToJSON:(RTCRtpParameters *)params { } if (codec.parameters.count) { - NSMutableArray *parts = [NSMutableArray arrayWithCapacity:codec.parameters.count]; - [codec.parameters - enumerateKeysAndObjectsUsingBlock:^(id _Nonnull key, id _Nonnull value, BOOL *_Nonnull stop) { - [parts addObject:[NSString stringWithFormat:@"%@=%@", key, value]]; - }]; - - codecDictionary[@"sdpFmtpLine"] = [parts componentsJoinedByString:@";"]; + codecDictionary[@"sdpFmtpLine"] = [self serializeSdpParameters:codec.parameters]; } [codecs addObject:codecDictionary]; @@ -174,6 +168,53 @@ + (NSDictionary *)trackToJSONWithPeerConnectionId:(NSNumber *)id track:(RTCMedia }; } ++ (NSDictionary *)capabilitiesToJSON:(RTCRtpCapabilities *)capabilities { + + NSMutableArray *codecs = [NSMutableArray new]; + + for (RTCRtpCodecCapability *codec in capabilities.codecs) { + [codecs addObject:[self codecCapabilityToJSON:codec]]; + } + + return @{ + @"codecs" : codecs + }; +} + ++ (NSDictionary *)codecCapabilityToJSON:(RTCRtpCodecCapability *)codec { + + NSMutableDictionary *codecDictionary = [NSMutableDictionary new]; + + codecDictionary[@"payloadType"] = codec.preferredPayloadType; + codecDictionary[@"mimeType"] = codec.mimeType; + codecDictionary[@"clockRate"] = codec.clockRate; + + if (codec.numChannels) { + codecDictionary[@"channels"] = codec.numChannels; + } + + if (codec.parameters.count) { + codecDictionary[@"sdpFmtpLine"] = [self serializeSdpParameters:codec.parameters]; + } + + return codecDictionary; +} + ++ (NSString *)serializeSdpParameters:(NSDictionary *)parameters { + + if(parameters == nil || parameters.count == 0) { + return nil; + } + + NSMutableArray *parts = [NSMutableArray arrayWithCapacity:parameters.count]; + [parameters + enumerateKeysAndObjectsUsingBlock:^(id _Nonnull key, id _Nonnull value, BOOL *_Nonnull stop) { + [parts addObject:[NSString stringWithFormat:@"%@=%@", key, value]]; + }]; + + return [parts componentsJoinedByString:@";"]; +} + + (NSString *)serializeDirection:(RTCRtpTransceiverDirection)direction { if (direction == RTCRtpTransceiverDirectionInactive) { return @"inactive"; diff --git a/ios/RCTWebRTC/WebRTCModule+Transceivers.m b/ios/RCTWebRTC/WebRTCModule+Transceivers.m index 3981d9b92..38ffe7f1c 100644 --- a/ios/RCTWebRTC/WebRTCModule+Transceivers.m +++ b/ios/RCTWebRTC/WebRTCModule+Transceivers.m @@ -5,37 +5,44 @@ #import #import +#import #import "SerializeUtils.h" #import "WebRTCModule.h" @implementation WebRTCModule (Transceivers) -RCT_EXPORT_BLOCKING_SYNCHRONOUS_METHOD(senderGetCapabilities) { +RCT_EXPORT_BLOCKING_SYNCHRONOUS_METHOD(senderGetCapabilities:(NSString *)kind) { __block id params; dispatch_sync(self.workerQueue, ^{ - NSMutableArray *videoCodecs = [NSMutableArray new]; - for (RTCVideoCodecInfo *videoCodecInfo in [self.encoderFactory supportedCodecs]) { - [videoCodecs addObject:@{@"mimeType" : [NSString stringWithFormat:@"video/%@", videoCodecInfo.name]}]; + RTCRtpMediaType mediaType = RTCRtpMediaTypeUnsupported; + if ([kind isEqual:@"audio"]) { + mediaType = RTCRtpMediaTypeAudio; + } else if ([kind isEqual:@"video"]) { + mediaType = RTCRtpMediaTypeVideo; } - params = @{@"codecs" : videoCodecs}; + RTCRtpCapabilities *capabilities = [self.peerConnectionFactory rtpSenderCapabilitiesFor:mediaType]; + params = [SerializeUtils capabilitiesToJSON: capabilities]; }); return params; } -RCT_EXPORT_BLOCKING_SYNCHRONOUS_METHOD(receiverGetCapabilities) { +RCT_EXPORT_BLOCKING_SYNCHRONOUS_METHOD(receiverGetCapabilities:(NSString *)kind) { __block id params; dispatch_sync(self.workerQueue, ^{ - NSMutableArray *videoCodecs = [NSMutableArray new]; - for (RTCVideoCodecInfo *videoCodecInfo in [self.decoderFactory supportedCodecs]) { - [videoCodecs addObject:@{@"mimeType" : [NSString stringWithFormat:@"video/%@", videoCodecInfo.name]}]; + RTCRtpMediaType mediaType = RTCRtpMediaTypeUnsupported; + if ([kind isEqual:@"audio"]) { + mediaType = RTCRtpMediaTypeAudio; + } else if ([kind isEqual:@"video"]) { + mediaType = RTCRtpMediaTypeVideo; } - params = @{@"codecs" : videoCodecs}; + RTCRtpCapabilities *capabilities = [self.peerConnectionFactory rtpSenderCapabilitiesFor:mediaType]; + params = [SerializeUtils capabilitiesToJSON: capabilities]; }); return params; @@ -178,6 +185,71 @@ @implementation WebRTCModule (Transceivers) resolve(@true); } +RCT_EXPORT_BLOCKING_SYNCHRONOUS_METHOD(transceiverSetCodecPreferences + : (nonnull NSNumber *)objectID senderId + : (NSString *)senderId codecPreferences + : (NSArray *)codecPreferences) { + RTCPeerConnection *peerConnection = self.peerConnections[objectID]; + + if (peerConnection == nil) { + RCTLogWarn(@"PeerConnection %@ not found in transceiverSetCodecPreferences()", objectID); + return nil; + } + + RTCRtpTransceiver *transceiver = nil; + for (RTCRtpTransceiver *t in peerConnection.transceivers) { + if ([senderId isEqual:t.sender.senderId]) { + transceiver = t; + break; + } + } + + if (transceiver == nil) { + RCTLogWarn(@"senderSetParameters() transceiver is null"); + return nil; + } + + // Convert JSON codec capabilities to the actual objects. + RTCRtpTransceiverDirection direction = transceiver.direction; + NSMutableArray *availableCodecs = [NSMutableArray new]; + if (direction == RTCRtpTransceiverDirectionSendRecv || direction == RTCRtpTransceiverDirectionSendOnly) { + RTCRtpCapabilities *capabilities = [self.peerConnectionFactory rtpSenderCapabilitiesFor:transceiver.mediaType]; + for(RTCRtpCodecCapability *codec in capabilities.codecs) { + NSDictionary *codecDict = [SerializeUtils codecCapabilityToJSON:codec]; + [availableCodecs addObject:@{ + @"dict": codecDict, + @"codec": codec, + }]; + } + } + if (direction == RTCRtpTransceiverDirectionSendRecv || direction == RTCRtpTransceiverDirectionRecvOnly) { + RTCRtpCapabilities *capabilities = [self.peerConnectionFactory rtpReceiverCapabilitiesFor:transceiver.mediaType]; + for(RTCRtpCodecCapability *codec in capabilities.codecs) { + NSDictionary *codecDict = [SerializeUtils codecCapabilityToJSON:codec]; + [availableCodecs addObject:@{ + @"dict": codecDict, + @"codec": codec, + }]; + } + } + + // Codec preferences is order sensitive. + NSMutableArray *codecsToSet = [NSMutableArray new]; + + for (NSDictionary *codecDict in codecPreferences) { + for (NSDictionary *entry in availableCodecs) { + NSDictionary *availableCodecDict = [entry objectForKey:@"dict"]; + if ([codecDict isEqualToDictionary:availableCodecDict]) { + [codecsToSet addObject:[entry objectForKey:@"codec"]]; + break; + } + } + } + + transceiver.codecPreferences = codecsToSet; + return nil; +} + - (RTCRtpParameters *)updateParametersWithOptions:(NSDictionary *)options params:(RTCRtpParameters *)params { NSArray *encodingsArray = options[@"encodings"]; NSArray *encodings = params.encodings; diff --git a/src/RTCRtpCapabilities.ts b/src/RTCRtpCapabilities.ts index 7f422595c..1d0fbc7b7 100644 --- a/src/RTCRtpCapabilities.ts +++ b/src/RTCRtpCapabilities.ts @@ -1,12 +1,7 @@ -import { NativeModules } from 'react-native'; - import RTCRtpCodecCapability from './RTCRtpCodecCapability'; -const { WebRTCModule } = NativeModules; /** - * @brief represents codec capabilities for senders and receivers. Currently - * this only supports codec names and does not have other - * fields like clockRate and numChannels and such. + * @brief represents codec capabilities for senders and receivers. */ export default class RTCRtpCapabilities { _codecs: RTCRtpCodecCapability[] = []; @@ -19,47 +14,3 @@ export default class RTCRtpCapabilities { return this._codecs; } } - - -function getCapabilities(endpoint: 'sender' | 'receiver'): RTCRtpCapabilities | null { - switch (endpoint) { - case 'sender': { - const capabilities = WebRTCModule.senderGetCapabilities(); - - if (!capabilities) { - return null; - } - - return new RTCRtpCapabilities(capabilities.codecs); - } - - case 'receiver': { - const capabilities = WebRTCModule.receiverGetCapabilities(); - - if (!capabilities) { - return null; - } - - return new RTCRtpCapabilities(capabilities.codecs); - } - - default: - throw new TypeError('Invalid endpoint: ' + endpoint); - } -} - - -/** - * Hardcoded audio capabilities based on the WebRTC native documentation: - * https://webrtc.github.io/webrtc-org/faq/. The mime type is specified in - * https://www.iana.org/assignments/rtp-parameters/rtp-parameters.xhtml#rtp-parameters-2. - */ -export const DEFAULT_AUDIO_CAPABILITIES = new RTCRtpCapabilities([ - new RTCRtpCodecCapability({ mimeType: 'audio/G722' }), - new RTCRtpCodecCapability({ mimeType: 'audio/iLBC' }), -]); - -// Initialize capabilities on module import -export const senderCapabilities = getCapabilities('sender'); -export const receiverCapabilities = getCapabilities('receiver'); - diff --git a/src/RTCRtpReceiver.ts b/src/RTCRtpReceiver.ts index e63d36fb3..228fce008 100644 --- a/src/RTCRtpReceiver.ts +++ b/src/RTCRtpReceiver.ts @@ -1,7 +1,7 @@ import { NativeModules } from 'react-native'; import MediaStreamTrack from './MediaStreamTrack'; -import RTCRtpCapabilities, { DEFAULT_AUDIO_CAPABILITIES, receiverCapabilities } from './RTCRtpCapabilities'; +import RTCRtpCapabilities from './RTCRtpCapabilities'; import { RTCRtpParametersInit } from './RTCRtpParameters'; import RTCRtpReceiveParameters from './RTCRtpReceiveParameters'; @@ -29,15 +29,7 @@ export default class RTCRtpReceiver { } static getCapabilities(kind: 'audio' | 'video'): RTCRtpCapabilities { - if (kind === 'audio') { - return DEFAULT_AUDIO_CAPABILITIES; - } - - if (!receiverCapabilities) { - throw new Error('Receiver Capabilities is null'); - } - - return receiverCapabilities; + return WebRTCModule.receiverGetCapabilities(kind); } getStats() { diff --git a/src/RTCRtpSender.ts b/src/RTCRtpSender.ts index 7a53d6331..4366b32fd 100644 --- a/src/RTCRtpSender.ts +++ b/src/RTCRtpSender.ts @@ -1,7 +1,7 @@ import { NativeModules } from 'react-native'; import MediaStreamTrack from './MediaStreamTrack'; -import RTCRtpCapabilities, { senderCapabilities, DEFAULT_AUDIO_CAPABILITIES } from './RTCRtpCapabilities'; +import RTCRtpCapabilities from './RTCRtpCapabilities'; import RTCRtpSendParameters, { RTCRtpSendParametersInit } from './RTCRtpSendParameters'; const { WebRTCModule } = NativeModules; @@ -39,15 +39,7 @@ export default class RTCRtpSender { } static getCapabilities(kind: 'audio' | 'video'): RTCRtpCapabilities { - if (kind === 'audio') { - return DEFAULT_AUDIO_CAPABILITIES; - } - - if (!senderCapabilities) { - throw new Error('sender Capabilities are null'); - } - - return senderCapabilities; + return WebRTCModule.senderGetCapabilities(kind); } getParameters(): RTCRtpSendParameters { diff --git a/src/RTCRtpTransceiver.ts b/src/RTCRtpTransceiver.ts index df0433046..3e1de43d5 100644 --- a/src/RTCRtpTransceiver.ts +++ b/src/RTCRtpTransceiver.ts @@ -1,5 +1,6 @@ import { NativeModules } from 'react-native'; +import RTCRtpCodecCapability from './RTCRtpCodecCapability'; import RTCRtpReceiver from './RTCRtpReceiver'; import RTCRtpSender from './RTCRtpSender'; @@ -89,6 +90,14 @@ export default class RTCRtpTransceiver { .then(() => this._setStopped()); } + setCodecPreferences(codecs: RTCRtpCodecCapability[]) { + WebRTCModule.transceiverSetCodecPreferences( + this._peerConnectionId, + this.sender.id, + codecs + ); + } + _setStopped() { this._stopped = true; this._direction = 'stopped'; From 63b85661511e06122d665e347305e57ebae1ada6 Mon Sep 17 00:00:00 2001 From: davidliu Date: Thu, 8 Jun 2023 21:35:41 +0900 Subject: [PATCH 04/21] android: update webrtc to 104.5112.10 (#3) --- android/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/android/build.gradle b/android/build.gradle index 5683021d8..c5684e8e1 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -25,5 +25,5 @@ android { dependencies { implementation 'com.facebook.react:react-native:+' - api 'io.github.webrtc-sdk:android:104.5112.09' + api 'io.github.webrtc-sdk:android:104.5112.10' } From 77839a34703eb619491747fbf079ab7036836c6b Mon Sep 17 00:00:00 2001 From: Santhosh Vaiyapuri Date: Wed, 16 Aug 2023 10:23:42 +0200 Subject: [PATCH 05/21] chore: change namespace for release --- livekit-react-native-webrtc.podspec | 8 ++++---- package-lock.json | 4 ++-- package.json | 8 ++++---- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/livekit-react-native-webrtc.podspec b/livekit-react-native-webrtc.podspec index 174ade2d8..323f0373a 100644 --- a/livekit-react-native-webrtc.podspec +++ b/livekit-react-native-webrtc.podspec @@ -3,13 +3,13 @@ require 'json' package = JSON.parse(File.read(File.join(__dir__, 'package.json'))) Pod::Spec.new do |s| - s.name = 'livekit-react-native-webrtc' + s.name = 'stream-react-native-webrtc' s.version = package['version'] s.summary = package['description'] - s.homepage = 'https://github.com/livekit/react-native-webrtc' + s.homepage = 'https://github.com/GetStream/react-native-webrtc' s.license = package['license'] - s.author = 'https://github.com/livekit/react-native-webrtc/graphs/contributors' - s.source = { :git => 'git@github.com:livekit/react-native-webrtc.git', :tag => 'release #{s.version}' } + s.author = 'https://github.com/lGetStreamivekit/react-native-webrtc/graphs/contributors' + s.source = { :git => 'git@github.com:GetStream/react-native-webrtc.git', :tag => 'release #{s.version}' } s.requires_arc = true s.platforms = { :ios => '12.0', :osx => '10.13' } diff --git a/package-lock.json b/package-lock.json index e404ae9db..b72de0b95 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,11 +1,11 @@ { - "name": "@livekit/react-native-webrtc", + "name": "@stream-io/react-native-webrtc", "version": "104.0.0", "lockfileVersion": 2, "requires": true, "packages": { "": { - "name": "@livekit/react-native-webrtc", + "name": "@stream-io/react-native-webrtc", "version": "104.0.0", "license": "MIT", "dependencies": { diff --git a/package.json b/package.json index 33c94ada7..7532593bc 100644 --- a/package.json +++ b/package.json @@ -1,13 +1,13 @@ { - "name": "@livekit/react-native-webrtc", + "name": "@stream-io/react-native-webrtc", "version": "104.0.0", "repository": { "type": "git", - "url": "git+https://github.com/livekit/react-native-webrtc.git" + "url": "git+https://github.com/GetStream/react-native-webrtc.git" }, "description": "WebRTC for React Native", "license": "MIT", - "homepage": "https://github.com/livekit/react-native-webrtc", + "homepage": "https://github.com/GetStream/react-native-webrtc", "keywords": [ "react-component", "react-native", @@ -35,7 +35,7 @@ "format": "tools/format.sh" }, "bugs": { - "url": "https://github.com/livekit/react-native-webrtc/issues" + "url": "https://github.com/GetStream/react-native-webrtc/issues" }, "devDependencies": { "@types/debug": "4.1.7", From 33b8ae0c3929263bf09584968ec64ae675e14e2b Mon Sep 17 00:00:00 2001 From: Santhosh Vaiyapuri Date: Wed, 16 Aug 2023 11:09:40 +0200 Subject: [PATCH 06/21] chore: rename podspec file --- ...ct-native-webrtc.podspec => stream-react-native-webrtc.podspec | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename livekit-react-native-webrtc.podspec => stream-react-native-webrtc.podspec (100%) diff --git a/livekit-react-native-webrtc.podspec b/stream-react-native-webrtc.podspec similarity index 100% rename from livekit-react-native-webrtc.podspec rename to stream-react-native-webrtc.podspec From cd41718726fee68d8b6c2491b13c45bcb5b03b0f Mon Sep 17 00:00:00 2001 From: Santhosh Vaiyapuri Date: Wed, 16 Aug 2023 11:12:24 +0200 Subject: [PATCH 07/21] 104.0.1 --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index b72de0b95..3714d6992 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@stream-io/react-native-webrtc", - "version": "104.0.0", + "version": "104.0.1", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@stream-io/react-native-webrtc", - "version": "104.0.0", + "version": "104.0.1", "license": "MIT", "dependencies": { "adm-zip": "0.5.9", diff --git a/package.json b/package.json index 7532593bc..bb2c2f6f2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@stream-io/react-native-webrtc", - "version": "104.0.0", + "version": "104.0.1", "repository": { "type": "git", "url": "git+https://github.com/GetStream/react-native-webrtc.git" From fa7b37ed89c083dbe5c2cb86c84fccef70da05af Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 17 Oct 2023 19:29:59 +0000 Subject: [PATCH 08/21] build(deps-dev): bump @babel/traverse from 7.17.3 to 7.23.2 Bumps [@babel/traverse](https://github.com/babel/babel/tree/HEAD/packages/babel-traverse) from 7.17.3 to 7.23.2. - [Release notes](https://github.com/babel/babel/releases) - [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md) - [Commits](https://github.com/babel/babel/commits/v7.23.2/packages/babel-traverse) --- updated-dependencies: - dependency-name: "@babel/traverse" dependency-type: indirect ... Signed-off-by: dependabot[bot] --- package-lock.json | 403 ++++++++++++++++++++++++---------------------- 1 file changed, 210 insertions(+), 193 deletions(-) diff --git a/package-lock.json b/package-lock.json index ea6189c92..6827cf68d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -44,12 +44,13 @@ } }, "node_modules/@babel/code-frame": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.16.7.tgz", - "integrity": "sha512-iAXqUn8IIeBTNd72xsFlgaXHkMBMt6y4HJp1tIaK465CWLT/fG1aqB7ykr95gHHmlBdGbFeWWfyB4NJJ0nmeIg==", + "version": "7.22.13", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.22.13.tgz", + "integrity": "sha512-XktuhWlJ5g+3TJXc5upd9Ks1HutSArik6jf2eAjYFyIOf4ej3RN+184cZbzDvbPnuTJIUhPKKJE3cIsYTiAT3w==", "dev": true, "dependencies": { - "@babel/highlight": "^7.16.7" + "@babel/highlight": "^7.22.13", + "chalk": "^2.4.2" }, "engines": { "node": ">=6.9.0" @@ -95,14 +96,15 @@ } }, "node_modules/@babel/generator": { - "version": "7.17.7", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.17.7.tgz", - "integrity": "sha512-oLcVCTeIFadUoArDTwpluncplrYBmTCCZZgXCbgNGvOBBiSDDK3eWO4b/+eOTli5tKv1lg+a5/NAXg+nTcei1w==", + "version": "7.23.0", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.23.0.tgz", + "integrity": "sha512-lN85QRR+5IbYrMWM6Y4pE/noaQtg4pNiqeNGX60eqOfo6gtEj6uw/JagelB8vVztSd7R6M5n1+PQkDbHbBRU4g==", "dev": true, "dependencies": { - "@babel/types": "^7.17.0", - "jsesc": "^2.5.1", - "source-map": "^0.5.0" + "@babel/types": "^7.23.0", + "@jridgewell/gen-mapping": "^0.3.2", + "@jridgewell/trace-mapping": "^0.3.17", + "jsesc": "^2.5.1" }, "engines": { "node": ">=6.9.0" @@ -208,13 +210,10 @@ } }, "node_modules/@babel/helper-environment-visitor": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.16.7.tgz", - "integrity": "sha512-SLLb0AAn6PkUeAfKJCCOl9e1R53pQlGAfc4y4XuMRZfqeMYLE0dM1LMhqbGAlGQY0lfw5/ohoYWAe9V1yibRag==", + "version": "7.22.20", + "resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.22.20.tgz", + "integrity": "sha512-zfedSIzFhat/gFhWfHtgWvlec0nqB9YEIVrpuwjruLlXfUSnA8cJB0miHKwqDnQ7d32aKo2xt88/xZptwxbfhA==", "dev": true, - "dependencies": { - "@babel/types": "^7.16.7" - }, "engines": { "node": ">=6.9.0" } @@ -232,38 +231,25 @@ } }, "node_modules/@babel/helper-function-name": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.16.7.tgz", - "integrity": "sha512-QfDfEnIUyyBSR3HtrtGECuZ6DAyCkYFp7GHl75vFtTnn6pjKeK0T1DB5lLkFvBea8MdaiUABx3osbgLyInoejA==", - "dev": true, - "dependencies": { - "@babel/helper-get-function-arity": "^7.16.7", - "@babel/template": "^7.16.7", - "@babel/types": "^7.16.7" - }, - "engines": { - "node": ">=6.9.0" - } - }, - "node_modules/@babel/helper-get-function-arity": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.16.7.tgz", - "integrity": "sha512-flc+RLSOBXzNzVhcLu6ujeHUrD6tANAOU5ojrRx/as+tbzf8+stUCj7+IfRRoAbEZqj/ahXEMsjhOhgeZsrnTw==", + "version": "7.23.0", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.23.0.tgz", + "integrity": "sha512-OErEqsrxjZTJciZ4Oo+eoZqeW9UIiOcuYKRJA4ZAgV9myA+pOXhhmpfNCKjEH/auVfEYVFJ6y1Tc4r0eIApqiw==", "dev": true, "dependencies": { - "@babel/types": "^7.16.7" + "@babel/template": "^7.22.15", + "@babel/types": "^7.23.0" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-hoist-variables": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.16.7.tgz", - "integrity": "sha512-m04d/0Op34H5v7pbZw6pSKP7weA6lsMvfiIAMeIvkY/R4xQtBSMFEigu9QTZ2qB/9l22vsxtM8a+Q8CzD255fg==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.22.5.tgz", + "integrity": "sha512-wGjk9QZVzvknA6yKIUURb8zY3grXCcOZt+/7Wcy8O2uctxhplmUPkOdlgoNhmdVee2c92JXbf1xpMtVNbfoxRw==", "dev": true, "dependencies": { - "@babel/types": "^7.16.7" + "@babel/types": "^7.22.5" }, "engines": { "node": ">=6.9.0" @@ -388,21 +374,30 @@ } }, "node_modules/@babel/helper-split-export-declaration": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.16.7.tgz", - "integrity": "sha512-xbWoy/PFoxSWazIToT9Sif+jJTlrMcndIsaOKvTA6u7QEo7ilkRZpjew18/W3c7nm8fXdUDXh02VXTbZ0pGDNw==", + "version": "7.22.6", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.22.6.tgz", + "integrity": "sha512-AsUnxuLhRYsisFiaJwvp1QF+I3KjD5FOxut14q/GzovUe6orHLesW2C7d754kRm53h5gqrz6sFl6sxc4BVtE/g==", "dev": true, "dependencies": { - "@babel/types": "^7.16.7" + "@babel/types": "^7.22.5" }, "engines": { "node": ">=6.9.0" } }, + "node_modules/@babel/helper-string-parser": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.22.5.tgz", + "integrity": "sha512-mM4COjgZox8U+JcXQwPijIZLElkgEpO5rsERVDJTc2qfCDfERyob6k5WegS14SX18IIjv+XD+GrqNumY5JRCDw==", + "dev": true, + "engines": { + "node": ">=6.9.0" + } + }, "node_modules/@babel/helper-validator-identifier": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.16.7.tgz", - "integrity": "sha512-hsEnFemeiW4D08A5gUAZxLBTXpZ39P+a+DGDsHw1yxqyQ/jzFEnxf5uTEGp+3bzAbNOxU1paTgYS4ECU/IgfDw==", + "version": "7.22.20", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.20.tgz", + "integrity": "sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A==", "dev": true, "engines": { "node": ">=6.9.0" @@ -447,13 +442,13 @@ } }, "node_modules/@babel/highlight": { - "version": "7.16.10", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.16.10.tgz", - "integrity": "sha512-5FnTQLSLswEj6IkgVw5KusNUUFY9ZGqe/TRFnP/BKYHYgfh7tc+C7mwiy95/yNP7Dh9x580Vv8r7u7ZfTBFxdw==", + "version": "7.22.20", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.22.20.tgz", + "integrity": "sha512-dkdMCN3py0+ksCgYmGG8jKeGA/8Tk+gJwSYYlFGxG5lmhfKNoAy004YpLxpS1W2J8m/EK2Ew+yOs9pVRwO89mg==", "dev": true, "dependencies": { - "@babel/helper-validator-identifier": "^7.16.7", - "chalk": "^2.0.0", + "@babel/helper-validator-identifier": "^7.22.20", + "chalk": "^2.4.2", "js-tokens": "^4.0.0" }, "engines": { @@ -461,9 +456,9 @@ } }, "node_modules/@babel/parser": { - "version": "7.17.7", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.17.7.tgz", - "integrity": "sha512-bm3AQf45vR4gKggRfvJdYJ0gFLoCbsPxiFLSH6hTVYABptNHY6l9NrhnucVjQ/X+SPtLANT9lc0fFhikj+VBRA==", + "version": "7.23.0", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.23.0.tgz", + "integrity": "sha512-vvPKKdMemU85V9WE/l5wZEmImpCtLqbnTvqDS2U1fJ96KrxoW7KrXhNsNCblQlg8Ck4b85yxdTyelsMUgFUXiw==", "dev": true, "bin": { "parser": "bin/babel-parser.js" @@ -1749,33 +1744,33 @@ } }, "node_modules/@babel/template": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.16.7.tgz", - "integrity": "sha512-I8j/x8kHUrbYRTUxXrrMbfCa7jxkE7tZre39x3kjr9hvI82cK1FfqLygotcWN5kdPGWcLdWMHpSBavse5tWw3w==", + "version": "7.22.15", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.22.15.tgz", + "integrity": "sha512-QPErUVm4uyJa60rkI73qneDacvdvzxshT3kksGqlGWYdOTIUOwJ7RDUL8sGqslY1uXWSL6xMFKEXDS3ox2uF0w==", "dev": true, "dependencies": { - "@babel/code-frame": "^7.16.7", - "@babel/parser": "^7.16.7", - "@babel/types": "^7.16.7" + "@babel/code-frame": "^7.22.13", + "@babel/parser": "^7.22.15", + "@babel/types": "^7.22.15" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/traverse": { - "version": "7.17.3", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.17.3.tgz", - "integrity": "sha512-5irClVky7TxRWIRtxlh2WPUUOLhcPN06AGgaQSB8AEwuyEBgJVuJ5imdHm5zxk8w0QS5T+tDfnDxAlhWjpb7cw==", - "dev": true, - "dependencies": { - "@babel/code-frame": "^7.16.7", - "@babel/generator": "^7.17.3", - "@babel/helper-environment-visitor": "^7.16.7", - "@babel/helper-function-name": "^7.16.7", - "@babel/helper-hoist-variables": "^7.16.7", - "@babel/helper-split-export-declaration": "^7.16.7", - "@babel/parser": "^7.17.3", - "@babel/types": "^7.17.0", + "version": "7.23.2", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.23.2.tgz", + "integrity": "sha512-azpe59SQ48qG6nu2CzcMLbxUudtN+dOM9kDbUqGq3HXUJRlo7i8fvPoxQUzYgLZ4cMVmuZgm8vvBpNeRhd6XSw==", + "dev": true, + "dependencies": { + "@babel/code-frame": "^7.22.13", + "@babel/generator": "^7.23.0", + "@babel/helper-environment-visitor": "^7.22.20", + "@babel/helper-function-name": "^7.23.0", + "@babel/helper-hoist-variables": "^7.22.5", + "@babel/helper-split-export-declaration": "^7.22.6", + "@babel/parser": "^7.23.0", + "@babel/types": "^7.23.0", "debug": "^4.1.0", "globals": "^11.1.0" }, @@ -1784,12 +1779,13 @@ } }, "node_modules/@babel/types": { - "version": "7.17.0", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.17.0.tgz", - "integrity": "sha512-TmKSNO4D5rzhL5bjWFcVHHLETzfQ/AmbKpKPOSjlP0WoHZ6L911fgoOKY4Alp/emzG4cHJdyN49zpgkbXFEHHw==", + "version": "7.23.0", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.23.0.tgz", + "integrity": "sha512-0oIyUfKoI3mSqMvsxBdclDwxXKXAUA8v/apZbc+iSyARYou1o8ZGDxbUYyLFoW2arqS2jDGqJuZvv1d/io1axg==", "dev": true, "dependencies": { - "@babel/helper-validator-identifier": "^7.16.7", + "@babel/helper-string-parser": "^7.22.5", + "@babel/helper-validator-identifier": "^7.22.20", "to-fast-properties": "^2.0.0" }, "engines": { @@ -1889,29 +1885,52 @@ "integrity": "sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==", "dev": true }, + "node_modules/@jridgewell/gen-mapping": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.3.tgz", + "integrity": "sha512-HLhSWOLRi875zjjMG/r+Nv0oCW8umGb0BgEhyX3dDX3egwZtB8PqLnjz3yedt8R5StBrzcg4aBpnh8UA9D1BoQ==", + "dev": true, + "dependencies": { + "@jridgewell/set-array": "^1.0.1", + "@jridgewell/sourcemap-codec": "^1.4.10", + "@jridgewell/trace-mapping": "^0.3.9" + }, + "engines": { + "node": ">=6.0.0" + } + }, "node_modules/@jridgewell/resolve-uri": { - "version": "3.0.5", - "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.0.5.tgz", - "integrity": "sha512-VPeQ7+wH0itvQxnG+lIzWgkysKIr3L9sslimFW55rHMdGu/qCQ5z5h9zq4gI8uBtqkpHhsF4Z/OwExufUCThew==", + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.1.tgz", + "integrity": "sha512-dSYZh7HhCDtCKm4QakX0xFpsRDqjjtZf/kjI/v3T3Nwt5r8/qz/M19F9ySyOqU94SXBmeG9ttTul+YnR4LOxFA==", + "dev": true, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/set-array": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.1.2.tgz", + "integrity": "sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw==", "dev": true, "engines": { "node": ">=6.0.0" } }, "node_modules/@jridgewell/sourcemap-codec": { - "version": "1.4.11", - "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.11.tgz", - "integrity": "sha512-Fg32GrJo61m+VqYSdRSjRXMjQ06j8YIYfcTqndLYVAaHmroZHLJZCydsWBOTDqXS2v+mjxohBWEMfg97GXmYQg==", + "version": "1.4.15", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz", + "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==", "dev": true }, "node_modules/@jridgewell/trace-mapping": { - "version": "0.3.4", - "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.4.tgz", - "integrity": "sha512-vFv9ttIedivx0ux3QSjhgtCVjPZd5l46ZOMDSCwnH1yUO2e964gO8LZGyv2QkqcgR6TnBU1v+1IFqmeoG+0UJQ==", + "version": "0.3.19", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.19.tgz", + "integrity": "sha512-kf37QtfW+Hwx/buWGMPcR60iF9ziHa6r/CZJIHbmcm4+0qrXiVdxegAH0F6yddEVQ7zdkjcGCgCzUu+BcbhQxw==", "dev": true, "dependencies": { - "@jridgewell/resolve-uri": "^3.0.3", - "@jridgewell/sourcemap-codec": "^1.4.10" + "@jridgewell/resolve-uri": "^3.1.0", + "@jridgewell/sourcemap-codec": "^1.4.14" } }, "node_modules/@nodelib/fs.scandir": { @@ -2560,7 +2579,7 @@ "node_modules/chalk/node_modules/has-flag": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", "dev": true, "engines": { "node": ">=4" @@ -2638,7 +2657,7 @@ "node_modules/color-name": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", "dev": true }, "node_modules/colorette": { @@ -2938,7 +2957,7 @@ "node_modules/escape-string-regexp": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", "dev": true, "engines": { "node": ">=0.8.0" @@ -5421,15 +5440,6 @@ "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true }, - "node_modules/source-map": { - "version": "0.5.7", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", - "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/string-argv": { "version": "0.3.1", "resolved": "https://registry.npmjs.org/string-argv/-/string-argv-0.3.1.tgz", @@ -5932,12 +5942,13 @@ } }, "@babel/code-frame": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.16.7.tgz", - "integrity": "sha512-iAXqUn8IIeBTNd72xsFlgaXHkMBMt6y4HJp1tIaK465CWLT/fG1aqB7ykr95gHHmlBdGbFeWWfyB4NJJ0nmeIg==", + "version": "7.22.13", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.22.13.tgz", + "integrity": "sha512-XktuhWlJ5g+3TJXc5upd9Ks1HutSArik6jf2eAjYFyIOf4ej3RN+184cZbzDvbPnuTJIUhPKKJE3cIsYTiAT3w==", "dev": true, "requires": { - "@babel/highlight": "^7.16.7" + "@babel/highlight": "^7.22.13", + "chalk": "^2.4.2" } }, "@babel/compat-data": { @@ -5970,14 +5981,15 @@ } }, "@babel/generator": { - "version": "7.17.7", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.17.7.tgz", - "integrity": "sha512-oLcVCTeIFadUoArDTwpluncplrYBmTCCZZgXCbgNGvOBBiSDDK3eWO4b/+eOTli5tKv1lg+a5/NAXg+nTcei1w==", + "version": "7.23.0", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.23.0.tgz", + "integrity": "sha512-lN85QRR+5IbYrMWM6Y4pE/noaQtg4pNiqeNGX60eqOfo6gtEj6uw/JagelB8vVztSd7R6M5n1+PQkDbHbBRU4g==", "dev": true, "requires": { - "@babel/types": "^7.17.0", - "jsesc": "^2.5.1", - "source-map": "^0.5.0" + "@babel/types": "^7.23.0", + "@jridgewell/gen-mapping": "^0.3.2", + "@jridgewell/trace-mapping": "^0.3.17", + "jsesc": "^2.5.1" } }, "@babel/helper-annotate-as-pure": { @@ -6053,13 +6065,10 @@ } }, "@babel/helper-environment-visitor": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.16.7.tgz", - "integrity": "sha512-SLLb0AAn6PkUeAfKJCCOl9e1R53pQlGAfc4y4XuMRZfqeMYLE0dM1LMhqbGAlGQY0lfw5/ohoYWAe9V1yibRag==", - "dev": true, - "requires": { - "@babel/types": "^7.16.7" - } + "version": "7.22.20", + "resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.22.20.tgz", + "integrity": "sha512-zfedSIzFhat/gFhWfHtgWvlec0nqB9YEIVrpuwjruLlXfUSnA8cJB0miHKwqDnQ7d32aKo2xt88/xZptwxbfhA==", + "dev": true }, "@babel/helper-explode-assignable-expression": { "version": "7.16.7", @@ -6071,32 +6080,22 @@ } }, "@babel/helper-function-name": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.16.7.tgz", - "integrity": "sha512-QfDfEnIUyyBSR3HtrtGECuZ6DAyCkYFp7GHl75vFtTnn6pjKeK0T1DB5lLkFvBea8MdaiUABx3osbgLyInoejA==", - "dev": true, - "requires": { - "@babel/helper-get-function-arity": "^7.16.7", - "@babel/template": "^7.16.7", - "@babel/types": "^7.16.7" - } - }, - "@babel/helper-get-function-arity": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.16.7.tgz", - "integrity": "sha512-flc+RLSOBXzNzVhcLu6ujeHUrD6tANAOU5ojrRx/as+tbzf8+stUCj7+IfRRoAbEZqj/ahXEMsjhOhgeZsrnTw==", + "version": "7.23.0", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.23.0.tgz", + "integrity": "sha512-OErEqsrxjZTJciZ4Oo+eoZqeW9UIiOcuYKRJA4ZAgV9myA+pOXhhmpfNCKjEH/auVfEYVFJ6y1Tc4r0eIApqiw==", "dev": true, "requires": { - "@babel/types": "^7.16.7" + "@babel/template": "^7.22.15", + "@babel/types": "^7.23.0" } }, "@babel/helper-hoist-variables": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.16.7.tgz", - "integrity": "sha512-m04d/0Op34H5v7pbZw6pSKP7weA6lsMvfiIAMeIvkY/R4xQtBSMFEigu9QTZ2qB/9l22vsxtM8a+Q8CzD255fg==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.22.5.tgz", + "integrity": "sha512-wGjk9QZVzvknA6yKIUURb8zY3grXCcOZt+/7Wcy8O2uctxhplmUPkOdlgoNhmdVee2c92JXbf1xpMtVNbfoxRw==", "dev": true, "requires": { - "@babel/types": "^7.16.7" + "@babel/types": "^7.22.5" } }, "@babel/helper-member-expression-to-functions": { @@ -6191,18 +6190,24 @@ } }, "@babel/helper-split-export-declaration": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.16.7.tgz", - "integrity": "sha512-xbWoy/PFoxSWazIToT9Sif+jJTlrMcndIsaOKvTA6u7QEo7ilkRZpjew18/W3c7nm8fXdUDXh02VXTbZ0pGDNw==", + "version": "7.22.6", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.22.6.tgz", + "integrity": "sha512-AsUnxuLhRYsisFiaJwvp1QF+I3KjD5FOxut14q/GzovUe6orHLesW2C7d754kRm53h5gqrz6sFl6sxc4BVtE/g==", "dev": true, "requires": { - "@babel/types": "^7.16.7" + "@babel/types": "^7.22.5" } }, + "@babel/helper-string-parser": { + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.22.5.tgz", + "integrity": "sha512-mM4COjgZox8U+JcXQwPijIZLElkgEpO5rsERVDJTc2qfCDfERyob6k5WegS14SX18IIjv+XD+GrqNumY5JRCDw==", + "dev": true + }, "@babel/helper-validator-identifier": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.16.7.tgz", - "integrity": "sha512-hsEnFemeiW4D08A5gUAZxLBTXpZ39P+a+DGDsHw1yxqyQ/jzFEnxf5uTEGp+3bzAbNOxU1paTgYS4ECU/IgfDw==", + "version": "7.22.20", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.20.tgz", + "integrity": "sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A==", "dev": true }, "@babel/helper-validator-option": { @@ -6235,20 +6240,20 @@ } }, "@babel/highlight": { - "version": "7.16.10", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.16.10.tgz", - "integrity": "sha512-5FnTQLSLswEj6IkgVw5KusNUUFY9ZGqe/TRFnP/BKYHYgfh7tc+C7mwiy95/yNP7Dh9x580Vv8r7u7ZfTBFxdw==", + "version": "7.22.20", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.22.20.tgz", + "integrity": "sha512-dkdMCN3py0+ksCgYmGG8jKeGA/8Tk+gJwSYYlFGxG5lmhfKNoAy004YpLxpS1W2J8m/EK2Ew+yOs9pVRwO89mg==", "dev": true, "requires": { - "@babel/helper-validator-identifier": "^7.16.7", - "chalk": "^2.0.0", + "@babel/helper-validator-identifier": "^7.22.20", + "chalk": "^2.4.2", "js-tokens": "^4.0.0" } }, "@babel/parser": { - "version": "7.17.7", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.17.7.tgz", - "integrity": "sha512-bm3AQf45vR4gKggRfvJdYJ0gFLoCbsPxiFLSH6hTVYABptNHY6l9NrhnucVjQ/X+SPtLANT9lc0fFhikj+VBRA==", + "version": "7.23.0", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.23.0.tgz", + "integrity": "sha512-vvPKKdMemU85V9WE/l5wZEmImpCtLqbnTvqDS2U1fJ96KrxoW7KrXhNsNCblQlg8Ck4b85yxdTyelsMUgFUXiw==", "dev": true }, "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression": { @@ -7099,41 +7104,42 @@ } }, "@babel/template": { - "version": "7.16.7", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.16.7.tgz", - "integrity": "sha512-I8j/x8kHUrbYRTUxXrrMbfCa7jxkE7tZre39x3kjr9hvI82cK1FfqLygotcWN5kdPGWcLdWMHpSBavse5tWw3w==", + "version": "7.22.15", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.22.15.tgz", + "integrity": "sha512-QPErUVm4uyJa60rkI73qneDacvdvzxshT3kksGqlGWYdOTIUOwJ7RDUL8sGqslY1uXWSL6xMFKEXDS3ox2uF0w==", "dev": true, "requires": { - "@babel/code-frame": "^7.16.7", - "@babel/parser": "^7.16.7", - "@babel/types": "^7.16.7" + "@babel/code-frame": "^7.22.13", + "@babel/parser": "^7.22.15", + "@babel/types": "^7.22.15" } }, "@babel/traverse": { - "version": "7.17.3", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.17.3.tgz", - "integrity": "sha512-5irClVky7TxRWIRtxlh2WPUUOLhcPN06AGgaQSB8AEwuyEBgJVuJ5imdHm5zxk8w0QS5T+tDfnDxAlhWjpb7cw==", - "dev": true, - "requires": { - "@babel/code-frame": "^7.16.7", - "@babel/generator": "^7.17.3", - "@babel/helper-environment-visitor": "^7.16.7", - "@babel/helper-function-name": "^7.16.7", - "@babel/helper-hoist-variables": "^7.16.7", - "@babel/helper-split-export-declaration": "^7.16.7", - "@babel/parser": "^7.17.3", - "@babel/types": "^7.17.0", + "version": "7.23.2", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.23.2.tgz", + "integrity": "sha512-azpe59SQ48qG6nu2CzcMLbxUudtN+dOM9kDbUqGq3HXUJRlo7i8fvPoxQUzYgLZ4cMVmuZgm8vvBpNeRhd6XSw==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.22.13", + "@babel/generator": "^7.23.0", + "@babel/helper-environment-visitor": "^7.22.20", + "@babel/helper-function-name": "^7.23.0", + "@babel/helper-hoist-variables": "^7.22.5", + "@babel/helper-split-export-declaration": "^7.22.6", + "@babel/parser": "^7.23.0", + "@babel/types": "^7.23.0", "debug": "^4.1.0", "globals": "^11.1.0" } }, "@babel/types": { - "version": "7.17.0", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.17.0.tgz", - "integrity": "sha512-TmKSNO4D5rzhL5bjWFcVHHLETzfQ/AmbKpKPOSjlP0WoHZ6L911fgoOKY4Alp/emzG4cHJdyN49zpgkbXFEHHw==", + "version": "7.23.0", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.23.0.tgz", + "integrity": "sha512-0oIyUfKoI3mSqMvsxBdclDwxXKXAUA8v/apZbc+iSyARYou1o8ZGDxbUYyLFoW2arqS2jDGqJuZvv1d/io1axg==", "dev": true, "requires": { - "@babel/helper-validator-identifier": "^7.16.7", + "@babel/helper-string-parser": "^7.22.5", + "@babel/helper-validator-identifier": "^7.22.20", "to-fast-properties": "^2.0.0" } }, @@ -7200,26 +7206,43 @@ "integrity": "sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==", "dev": true }, + "@jridgewell/gen-mapping": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.3.tgz", + "integrity": "sha512-HLhSWOLRi875zjjMG/r+Nv0oCW8umGb0BgEhyX3dDX3egwZtB8PqLnjz3yedt8R5StBrzcg4aBpnh8UA9D1BoQ==", + "dev": true, + "requires": { + "@jridgewell/set-array": "^1.0.1", + "@jridgewell/sourcemap-codec": "^1.4.10", + "@jridgewell/trace-mapping": "^0.3.9" + } + }, "@jridgewell/resolve-uri": { - "version": "3.0.5", - "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.0.5.tgz", - "integrity": "sha512-VPeQ7+wH0itvQxnG+lIzWgkysKIr3L9sslimFW55rHMdGu/qCQ5z5h9zq4gI8uBtqkpHhsF4Z/OwExufUCThew==", + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.1.tgz", + "integrity": "sha512-dSYZh7HhCDtCKm4QakX0xFpsRDqjjtZf/kjI/v3T3Nwt5r8/qz/M19F9ySyOqU94SXBmeG9ttTul+YnR4LOxFA==", + "dev": true + }, + "@jridgewell/set-array": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.1.2.tgz", + "integrity": "sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw==", "dev": true }, "@jridgewell/sourcemap-codec": { - "version": "1.4.11", - "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.11.tgz", - "integrity": "sha512-Fg32GrJo61m+VqYSdRSjRXMjQ06j8YIYfcTqndLYVAaHmroZHLJZCydsWBOTDqXS2v+mjxohBWEMfg97GXmYQg==", + "version": "1.4.15", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz", + "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==", "dev": true }, "@jridgewell/trace-mapping": { - "version": "0.3.4", - "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.4.tgz", - "integrity": "sha512-vFv9ttIedivx0ux3QSjhgtCVjPZd5l46ZOMDSCwnH1yUO2e964gO8LZGyv2QkqcgR6TnBU1v+1IFqmeoG+0UJQ==", + "version": "0.3.19", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.19.tgz", + "integrity": "sha512-kf37QtfW+Hwx/buWGMPcR60iF9ziHa6r/CZJIHbmcm4+0qrXiVdxegAH0F6yddEVQ7zdkjcGCgCzUu+BcbhQxw==", "dev": true, "requires": { - "@jridgewell/resolve-uri": "^3.0.3", - "@jridgewell/sourcemap-codec": "^1.4.10" + "@jridgewell/resolve-uri": "^3.1.0", + "@jridgewell/sourcemap-codec": "^1.4.14" } }, "@nodelib/fs.scandir": { @@ -7661,7 +7684,7 @@ "has-flag": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", "dev": true }, "supports-color": { @@ -7723,7 +7746,7 @@ "color-name": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", "dev": true }, "colorette": { @@ -7965,7 +7988,7 @@ "escape-string-regexp": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", "dev": true }, "eslint": { @@ -9774,12 +9797,6 @@ } } }, - "source-map": { - "version": "0.5.7", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", - "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", - "dev": true - }, "string-argv": { "version": "0.3.1", "resolved": "https://registry.npmjs.org/string-argv/-/string-argv-0.3.1.tgz", From 94add9be9f8d2223ec3cd342ce695bc04abedf23 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sa=C3=BAl=20Ibarra=20Corretg=C3=A9?= Date: Tue, 17 Oct 2023 21:59:20 +0200 Subject: [PATCH 09/21] ios,android: update WebRTC to M118 --- android/build.gradle | 2 +- package-lock.json | 4 ++-- package.json | 2 +- react-native-webrtc.podspec | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/android/build.gradle b/android/build.gradle index 803c19d87..337b397c2 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -25,5 +25,5 @@ android { dependencies { implementation 'com.facebook.react:react-native:+' - api 'org.jitsi:webrtc:111.+' + api 'org.jitsi:webrtc:118.+' } diff --git a/package-lock.json b/package-lock.json index 6827cf68d..72551652b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "react-native-webrtc", - "version": "111.0.6", + "version": "118.0.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "react-native-webrtc", - "version": "111.0.6", + "version": "118.0.0", "license": "MIT", "dependencies": { "base64-js": "1.5.1", diff --git a/package.json b/package.json index f7ed17ccc..af586f8f3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-native-webrtc", - "version": "111.0.6", + "version": "118.0.0", "repository": { "type": "git", "url": "git+https://github.com/react-native-webrtc/react-native-webrtc.git" diff --git a/react-native-webrtc.podspec b/react-native-webrtc.podspec index 83a7e3edc..79a266705 100644 --- a/react-native-webrtc.podspec +++ b/react-native-webrtc.podspec @@ -19,5 +19,5 @@ Pod::Spec.new do |s| s.libraries = 'c', 'sqlite3', 'stdc++' s.framework = 'AudioToolbox','AVFoundation', 'CoreAudio', 'CoreGraphics', 'CoreVideo', 'GLKit', 'VideoToolbox' s.dependency 'React-Core' - s.dependency 'JitsiWebRTC', '~> 111.0.0' + s.dependency 'JitsiWebRTC', '~> 118.0.0' end From 914c6363de2fbc7141a8b0bc35a5cff11d936e37 Mon Sep 17 00:00:00 2001 From: davidliu Date: Thu, 8 Jun 2023 01:09:36 +0900 Subject: [PATCH 10/21] ios,android: setCodecPreferences and getCapabilities --- .../com/oney/WebRTCModule/SerializeUtils.java | 39 ++++++- .../com/oney/WebRTCModule/WebRTCModule.java | 101 +++++++++++++++--- ios/RCTWebRTC/SerializeUtils.h | 3 + ios/RCTWebRTC/SerializeUtils.m | 49 +++++++-- ios/RCTWebRTC/WebRTCModule+Transceivers.m | 93 ++++++++++++++-- src/RTCRtpCapabilities.ts | 51 +-------- src/RTCRtpReceiver.ts | 12 +-- src/RTCRtpSender.ts | 12 +-- src/RTCRtpTransceiver.ts | 9 ++ 9 files changed, 261 insertions(+), 108 deletions(-) diff --git a/android/src/main/java/com/oney/WebRTCModule/SerializeUtils.java b/android/src/main/java/com/oney/WebRTCModule/SerializeUtils.java index 749a3a5ba..bf1ec2872 100644 --- a/android/src/main/java/com/oney/WebRTCModule/SerializeUtils.java +++ b/android/src/main/java/com/oney/WebRTCModule/SerializeUtils.java @@ -170,11 +170,7 @@ public static ReadableMap serializeRtpParameters(RtpParameters params) { } // Serializing sdpFmptLine. if (!codec.parameters.isEmpty()) { - final String sdpFmptLineParams = codec.parameters.keySet() - .stream() - .map(key -> key + "=" + codec.parameters.get(key)) - .collect(Collectors.joining(";")); - codecMap.putString("sdpFmtpLine", sdpFmptLineParams); + codecMap.putString("sdpFmtpLine", serializeSdpParameters(codec.parameters)); } codecs.pushMap(codecMap); @@ -192,6 +188,39 @@ public static ReadableMap serializeRtpParameters(RtpParameters params) { return result; } + public static ReadableMap serializeRtpCapabilities(RtpCapabilities capabilities) { + WritableMap result = Arguments.createMap(); + WritableArray codecs = Arguments.createArray(); + + capabilities.codecs.forEach(codec -> codecs.pushMap(serializeRtpCapabilitiesCodec(codec))); + + result.putArray("codecs", codecs); + return result; + } + + public static ReadableMap serializeRtpCapabilitiesCodec(RtpCapabilities.CodecCapability codec) { + WritableMap codecMap = Arguments.createMap(); + codecMap.putInt("payloadType", codec.preferredPayloadType); + codecMap.putString("mimeType", codec.mimeType); + codecMap.putInt("clockRate", codec.clockRate); + if (codec.numChannels != null) { + codecMap.putInt("channels", codec.numChannels); + } + if (!codec.parameters.isEmpty()) { + codecMap.putString("sdpFmtpLine", serializeSdpParameters(codec.parameters)); + } + + return codecMap; + } + + // For serializing sdpFmptLine. + public static String serializeSdpParameters(Map parameters) { + return parameters.keySet() + .stream() + .map(key -> key + "=" + parameters.get(key)) + .collect(Collectors.joining(";")); + } + /** * Parsing APIs */ diff --git a/android/src/main/java/com/oney/WebRTCModule/WebRTCModule.java b/android/src/main/java/com/oney/WebRTCModule/WebRTCModule.java index ca72005d1..3f9dd15a3 100644 --- a/android/src/main/java/com/oney/WebRTCModule/WebRTCModule.java +++ b/android/src/main/java/com/oney/WebRTCModule/WebRTCModule.java @@ -1,6 +1,7 @@ package com.oney.WebRTCModule; import android.util.Log; +import android.util.Pair; import android.util.SparseArray; import androidx.annotation.NonNull; @@ -709,6 +710,68 @@ public void transceiverSetDirection(int id, String senderId, String direction, P }); } + @ReactMethod(isBlockingSynchronousMethod = true) + public void transceiverSetCodecPreferences(int id, String senderId, ReadableArray codecPreferences) { + ThreadUtils.runOnExecutor(() -> { + WritableMap identifier = Arguments.createMap(); + WritableMap params = Arguments.createMap(); + identifier.putInt("peerConnectionId", id); + identifier.putString("transceiverId", senderId); + try { + PeerConnectionObserver pco = mPeerConnectionObservers.get(id); + if (pco == null) { + Log.d(TAG, "transceiverSetDirection() peerConnectionObserver is null"); + return; + } + RtpTransceiver transceiver = pco.getTransceiver(senderId); + if (transceiver == null) { + Log.d(TAG, "transceiverSetDirection() transceiver is null"); + return; + } + + // Convert JSON codec capabilities to the actual objects. + RtpTransceiver.RtpTransceiverDirection direction = transceiver.getDirection(); + List, RtpCapabilities.CodecCapability>> availableCodecs = new ArrayList<>(); + + if (direction.equals(RtpTransceiver.RtpTransceiverDirection.SEND_RECV) + || direction.equals(RtpTransceiver.RtpTransceiverDirection.SEND_ONLY)) { + RtpCapabilities capabilities = mFactory.getRtpSenderCapabilities(transceiver.getMediaType()); + for (RtpCapabilities.CodecCapability codec : capabilities.codecs) { + Map codecDict = SerializeUtils.serializeRtpCapabilitiesCodec(codec).toHashMap(); + availableCodecs.add(new Pair<>(codecDict, codec)); + } + } + + if (direction.equals(RtpTransceiver.RtpTransceiverDirection.SEND_RECV) + || direction.equals(RtpTransceiver.RtpTransceiverDirection.RECV_ONLY)) { + RtpCapabilities capabilities = mFactory.getRtpReceiverCapabilities(transceiver.getMediaType()); + for (RtpCapabilities.CodecCapability codec : capabilities.codecs) { + Map codecDict = SerializeUtils.serializeRtpCapabilitiesCodec(codec).toHashMap(); + availableCodecs.add(new Pair<>(codecDict, codec)); + } + } + + // Codec preferences is order sensitive. + List codecsToSet = new ArrayList<>(); + + for (int i = 0; i < codecPreferences.size(); i++) { + Map codecPref = codecPreferences.getMap(i).toHashMap(); + for (Pair, RtpCapabilities.CodecCapability> pair : availableCodecs) { + Map availableCodecDict = pair.first; + if (codecPref.equals(availableCodecDict)) { + codecsToSet.add(pair.second); + break; + } + } + } + + transceiver.setCodecPreferences(codecsToSet); + } catch (Exception e) { + Log.d(TAG, "transceiverSetCodecPreferences(): " + e.getMessage()); + } + }); + } + @ReactMethod public void getDisplayMedia(Promise promise) { ThreadUtils.runOnExecutor(() -> getUserMediaImpl.getDisplayMedia(promise)); @@ -1129,18 +1192,21 @@ public void onSetFailure(String s) { } @ReactMethod(isBlockingSynchronousMethod = true) - public WritableMap receiverGetCapabilities() { + public WritableMap receiverGetCapabilities(String kind) { try { return (WritableMap) ThreadUtils .submitToExecutor((Callable) () -> { - VideoCodecInfo[] videoCodecInfos = mVideoDecoderFactory.getSupportedCodecs(); - WritableMap params = Arguments.createMap(); - WritableArray codecs = Arguments.createArray(); - for (VideoCodecInfo codecInfo : videoCodecInfos) { - codecs.pushMap(SerializeUtils.serializeVideoCodecInfo(codecInfo)); + MediaStreamTrack.MediaType mediaType; + if (kind.equals("audio")) { + mediaType = MediaStreamTrack.MediaType.MEDIA_TYPE_AUDIO; + } else if (kind.equals("video")) { + mediaType = MediaStreamTrack.MediaType.MEDIA_TYPE_VIDEO; + } else { + return Arguments.createMap(); } - params.putArray("codecs", codecs); - return params; + + RtpCapabilities capabilities = mFactory.getRtpReceiverCapabilities(mediaType); + return SerializeUtils.serializeRtpCapabilities(capabilities); }) .get(); } catch (ExecutionException | InterruptedException e) { @@ -1150,18 +1216,21 @@ public WritableMap receiverGetCapabilities() { } @ReactMethod(isBlockingSynchronousMethod = true) - public WritableMap senderGetCapabilities() { + public WritableMap senderGetCapabilities(String kind) { try { return (WritableMap) ThreadUtils .submitToExecutor((Callable) () -> { - VideoCodecInfo[] videoCodecInfos = mVideoEncoderFactory.getSupportedCodecs(); - WritableMap params = Arguments.createMap(); - WritableArray codecs = Arguments.createArray(); - for (VideoCodecInfo codecInfo : videoCodecInfos) { - codecs.pushMap(SerializeUtils.serializeVideoCodecInfo(codecInfo)); + MediaStreamTrack.MediaType mediaType; + if (kind.equals("audio")) { + mediaType = MediaStreamTrack.MediaType.MEDIA_TYPE_AUDIO; + } else if (kind.equals("video")) { + mediaType = MediaStreamTrack.MediaType.MEDIA_TYPE_VIDEO; + } else { + return Arguments.createMap(); } - params.putArray("codecs", codecs); - return params; + + RtpCapabilities capabilities = mFactory.getRtpSenderCapabilities(mediaType); + return SerializeUtils.serializeRtpCapabilities(capabilities); }) .get(); } catch (ExecutionException | InterruptedException e) { diff --git a/ios/RCTWebRTC/SerializeUtils.h b/ios/RCTWebRTC/SerializeUtils.h index 62e53948a..412618061 100644 --- a/ios/RCTWebRTC/SerializeUtils.h +++ b/ios/RCTWebRTC/SerializeUtils.h @@ -1,4 +1,5 @@ #import +#import #import #import #import @@ -13,6 +14,8 @@ receiver:(RTCRtpReceiver *_Nonnull)receiver; + (NSDictionary *_Nonnull)trackToJSONWithPeerConnectionId:(nonnull NSNumber *)id track:(RTCMediaStreamTrack *_Nonnull)track; ++ (NSDictionary *_Nonnull)capabilitiesToJSON:(RTCRtpCapabilities *_Nonnull)capabilities; ++ (NSDictionary *_Nonnull)codecCapabilityToJSON:(RTCRtpCodecCapability *)codec; + (NSString *_Nonnull)serializeDirection:(RTCRtpTransceiverDirection)direction; + (RTCRtpTransceiverDirection)parseDirection:(NSString *_Nonnull)direction; + (RTCRtpTransceiverInit *_Nonnull)parseTransceiverOptions:(NSDictionary *_Nonnull)parameters; diff --git a/ios/RCTWebRTC/SerializeUtils.m b/ios/RCTWebRTC/SerializeUtils.m index 08e31148d..c4deef1b0 100644 --- a/ios/RCTWebRTC/SerializeUtils.m +++ b/ios/RCTWebRTC/SerializeUtils.m @@ -130,13 +130,7 @@ + (NSDictionary *)parametersToJSON:(RTCRtpParameters *)params { } if (codec.parameters.count) { - NSMutableArray *parts = [NSMutableArray arrayWithCapacity:codec.parameters.count]; - [codec.parameters - enumerateKeysAndObjectsUsingBlock:^(id _Nonnull key, id _Nonnull value, BOOL *_Nonnull stop) { - [parts addObject:[NSString stringWithFormat:@"%@=%@", key, value]]; - }]; - - codecDictionary[@"sdpFmtpLine"] = [parts componentsJoinedByString:@";"]; + codecDictionary[@"sdpFmtpLine"] = [self serializeSdpParameters:codec.parameters]; } [codecs addObject:codecDictionary]; @@ -176,6 +170,47 @@ + (NSDictionary *)trackToJSONWithPeerConnectionId:(NSNumber *)id track:(RTCMedia }; } ++ (NSDictionary *)capabilitiesToJSON:(RTCRtpCapabilities *)capabilities { + NSMutableArray *codecs = [NSMutableArray new]; + + for (RTCRtpCodecCapability *codec in capabilities.codecs) { + [codecs addObject:[self codecCapabilityToJSON:codec]]; + } + + return @{@"codecs" : codecs}; +} + ++ (NSDictionary *)codecCapabilityToJSON:(RTCRtpCodecCapability *)codec { + NSMutableDictionary *codecDictionary = [NSMutableDictionary new]; + + codecDictionary[@"payloadType"] = codec.preferredPayloadType; + codecDictionary[@"mimeType"] = codec.mimeType; + codecDictionary[@"clockRate"] = codec.clockRate; + + if (codec.numChannels) { + codecDictionary[@"channels"] = codec.numChannels; + } + + if (codec.parameters.count) { + codecDictionary[@"sdpFmtpLine"] = [self serializeSdpParameters:codec.parameters]; + } + + return codecDictionary; +} + ++ (NSString *)serializeSdpParameters:(NSDictionary *)parameters { + if (parameters == nil || parameters.count == 0) { + return nil; + } + + NSMutableArray *parts = [NSMutableArray arrayWithCapacity:parameters.count]; + [parameters enumerateKeysAndObjectsUsingBlock:^(id _Nonnull key, id _Nonnull value, BOOL *_Nonnull stop) { + [parts addObject:[NSString stringWithFormat:@"%@=%@", key, value]]; + }]; + + return [parts componentsJoinedByString:@";"]; +} + + (NSString *)serializeDirection:(RTCRtpTransceiverDirection)direction { if (direction == RTCRtpTransceiverDirectionInactive) { return @"inactive"; diff --git a/ios/RCTWebRTC/WebRTCModule+Transceivers.m b/ios/RCTWebRTC/WebRTCModule+Transceivers.m index 3981d9b92..5b7c3ee53 100644 --- a/ios/RCTWebRTC/WebRTCModule+Transceivers.m +++ b/ios/RCTWebRTC/WebRTCModule+Transceivers.m @@ -3,6 +3,7 @@ #import #import +#import #import #import @@ -11,31 +12,37 @@ @implementation WebRTCModule (Transceivers) -RCT_EXPORT_BLOCKING_SYNCHRONOUS_METHOD(senderGetCapabilities) { +RCT_EXPORT_BLOCKING_SYNCHRONOUS_METHOD(senderGetCapabilities : (NSString *)kind) { __block id params; dispatch_sync(self.workerQueue, ^{ - NSMutableArray *videoCodecs = [NSMutableArray new]; - for (RTCVideoCodecInfo *videoCodecInfo in [self.encoderFactory supportedCodecs]) { - [videoCodecs addObject:@{@"mimeType" : [NSString stringWithFormat:@"video/%@", videoCodecInfo.name]}]; + RTCRtpMediaType mediaType = RTCRtpMediaTypeUnsupported; + if ([kind isEqual:@"audio"]) { + mediaType = RTCRtpMediaTypeAudio; + } else if ([kind isEqual:@"video"]) { + mediaType = RTCRtpMediaTypeVideo; } - params = @{@"codecs" : videoCodecs}; + RTCRtpCapabilities *capabilities = [self.peerConnectionFactory rtpSenderCapabilitiesFor:mediaType]; + params = [SerializeUtils capabilitiesToJSON:capabilities]; }); return params; } -RCT_EXPORT_BLOCKING_SYNCHRONOUS_METHOD(receiverGetCapabilities) { +RCT_EXPORT_BLOCKING_SYNCHRONOUS_METHOD(receiverGetCapabilities : (NSString *)kind) { __block id params; dispatch_sync(self.workerQueue, ^{ - NSMutableArray *videoCodecs = [NSMutableArray new]; - for (RTCVideoCodecInfo *videoCodecInfo in [self.decoderFactory supportedCodecs]) { - [videoCodecs addObject:@{@"mimeType" : [NSString stringWithFormat:@"video/%@", videoCodecInfo.name]}]; + RTCRtpMediaType mediaType = RTCRtpMediaTypeUnsupported; + if ([kind isEqual:@"audio"]) { + mediaType = RTCRtpMediaTypeAudio; + } else if ([kind isEqual:@"video"]) { + mediaType = RTCRtpMediaTypeVideo; } - params = @{@"codecs" : videoCodecs}; + RTCRtpCapabilities *capabilities = [self.peerConnectionFactory rtpSenderCapabilitiesFor:mediaType]; + params = [SerializeUtils capabilitiesToJSON:capabilities]; }); return params; @@ -178,6 +185,72 @@ @implementation WebRTCModule (Transceivers) resolve(@true); } +RCT_EXPORT_BLOCKING_SYNCHRONOUS_METHOD(transceiverSetCodecPreferences + : (nonnull NSNumber *)objectID senderId + : (NSString *)senderId codecPreferences + : (NSArray *)codecPreferences) { + RTCPeerConnection *peerConnection = self.peerConnections[objectID]; + + if (peerConnection == nil) { + RCTLogWarn(@"PeerConnection %@ not found in transceiverSetCodecPreferences()", objectID); + return nil; + } + + RTCRtpTransceiver *transceiver = nil; + for (RTCRtpTransceiver *t in peerConnection.transceivers) { + if ([senderId isEqual:t.sender.senderId]) { + transceiver = t; + break; + } + } + + if (transceiver == nil) { + RCTLogWarn(@"senderSetParameters() transceiver is null"); + return nil; + } + + // Convert JSON codec capabilities to the actual objects. + RTCRtpTransceiverDirection direction = transceiver.direction; + NSMutableArray *availableCodecs = [NSMutableArray new]; + if (direction == RTCRtpTransceiverDirectionSendRecv || direction == RTCRtpTransceiverDirectionSendOnly) { + RTCRtpCapabilities *capabilities = [self.peerConnectionFactory rtpSenderCapabilitiesFor:transceiver.mediaType]; + for (RTCRtpCodecCapability *codec in capabilities.codecs) { + NSDictionary *codecDict = [SerializeUtils codecCapabilityToJSON:codec]; + [availableCodecs addObject:@{ + @"dict" : codecDict, + @"codec" : codec, + }]; + } + } + if (direction == RTCRtpTransceiverDirectionSendRecv || direction == RTCRtpTransceiverDirectionRecvOnly) { + RTCRtpCapabilities *capabilities = + [self.peerConnectionFactory rtpReceiverCapabilitiesFor:transceiver.mediaType]; + for (RTCRtpCodecCapability *codec in capabilities.codecs) { + NSDictionary *codecDict = [SerializeUtils codecCapabilityToJSON:codec]; + [availableCodecs addObject:@{ + @"dict" : codecDict, + @"codec" : codec, + }]; + } + } + + // Codec preferences is order sensitive. + NSMutableArray *codecsToSet = [NSMutableArray new]; + + for (NSDictionary *codecDict in codecPreferences) { + for (NSDictionary *entry in availableCodecs) { + NSDictionary *availableCodecDict = [entry objectForKey:@"dict"]; + if ([codecDict isEqualToDictionary:availableCodecDict]) { + [codecsToSet addObject:[entry objectForKey:@"codec"]]; + break; + } + } + } + + transceiver.codecPreferences = codecsToSet; + return nil; +} + - (RTCRtpParameters *)updateParametersWithOptions:(NSDictionary *)options params:(RTCRtpParameters *)params { NSArray *encodingsArray = options[@"encodings"]; NSArray *encodings = params.encodings; diff --git a/src/RTCRtpCapabilities.ts b/src/RTCRtpCapabilities.ts index 7f422595c..1d0fbc7b7 100644 --- a/src/RTCRtpCapabilities.ts +++ b/src/RTCRtpCapabilities.ts @@ -1,12 +1,7 @@ -import { NativeModules } from 'react-native'; - import RTCRtpCodecCapability from './RTCRtpCodecCapability'; -const { WebRTCModule } = NativeModules; /** - * @brief represents codec capabilities for senders and receivers. Currently - * this only supports codec names and does not have other - * fields like clockRate and numChannels and such. + * @brief represents codec capabilities for senders and receivers. */ export default class RTCRtpCapabilities { _codecs: RTCRtpCodecCapability[] = []; @@ -19,47 +14,3 @@ export default class RTCRtpCapabilities { return this._codecs; } } - - -function getCapabilities(endpoint: 'sender' | 'receiver'): RTCRtpCapabilities | null { - switch (endpoint) { - case 'sender': { - const capabilities = WebRTCModule.senderGetCapabilities(); - - if (!capabilities) { - return null; - } - - return new RTCRtpCapabilities(capabilities.codecs); - } - - case 'receiver': { - const capabilities = WebRTCModule.receiverGetCapabilities(); - - if (!capabilities) { - return null; - } - - return new RTCRtpCapabilities(capabilities.codecs); - } - - default: - throw new TypeError('Invalid endpoint: ' + endpoint); - } -} - - -/** - * Hardcoded audio capabilities based on the WebRTC native documentation: - * https://webrtc.github.io/webrtc-org/faq/. The mime type is specified in - * https://www.iana.org/assignments/rtp-parameters/rtp-parameters.xhtml#rtp-parameters-2. - */ -export const DEFAULT_AUDIO_CAPABILITIES = new RTCRtpCapabilities([ - new RTCRtpCodecCapability({ mimeType: 'audio/G722' }), - new RTCRtpCodecCapability({ mimeType: 'audio/iLBC' }), -]); - -// Initialize capabilities on module import -export const senderCapabilities = getCapabilities('sender'); -export const receiverCapabilities = getCapabilities('receiver'); - diff --git a/src/RTCRtpReceiver.ts b/src/RTCRtpReceiver.ts index e63d36fb3..228fce008 100644 --- a/src/RTCRtpReceiver.ts +++ b/src/RTCRtpReceiver.ts @@ -1,7 +1,7 @@ import { NativeModules } from 'react-native'; import MediaStreamTrack from './MediaStreamTrack'; -import RTCRtpCapabilities, { DEFAULT_AUDIO_CAPABILITIES, receiverCapabilities } from './RTCRtpCapabilities'; +import RTCRtpCapabilities from './RTCRtpCapabilities'; import { RTCRtpParametersInit } from './RTCRtpParameters'; import RTCRtpReceiveParameters from './RTCRtpReceiveParameters'; @@ -29,15 +29,7 @@ export default class RTCRtpReceiver { } static getCapabilities(kind: 'audio' | 'video'): RTCRtpCapabilities { - if (kind === 'audio') { - return DEFAULT_AUDIO_CAPABILITIES; - } - - if (!receiverCapabilities) { - throw new Error('Receiver Capabilities is null'); - } - - return receiverCapabilities; + return WebRTCModule.receiverGetCapabilities(kind); } getStats() { diff --git a/src/RTCRtpSender.ts b/src/RTCRtpSender.ts index 7a53d6331..4366b32fd 100644 --- a/src/RTCRtpSender.ts +++ b/src/RTCRtpSender.ts @@ -1,7 +1,7 @@ import { NativeModules } from 'react-native'; import MediaStreamTrack from './MediaStreamTrack'; -import RTCRtpCapabilities, { senderCapabilities, DEFAULT_AUDIO_CAPABILITIES } from './RTCRtpCapabilities'; +import RTCRtpCapabilities from './RTCRtpCapabilities'; import RTCRtpSendParameters, { RTCRtpSendParametersInit } from './RTCRtpSendParameters'; const { WebRTCModule } = NativeModules; @@ -39,15 +39,7 @@ export default class RTCRtpSender { } static getCapabilities(kind: 'audio' | 'video'): RTCRtpCapabilities { - if (kind === 'audio') { - return DEFAULT_AUDIO_CAPABILITIES; - } - - if (!senderCapabilities) { - throw new Error('sender Capabilities are null'); - } - - return senderCapabilities; + return WebRTCModule.senderGetCapabilities(kind); } getParameters(): RTCRtpSendParameters { diff --git a/src/RTCRtpTransceiver.ts b/src/RTCRtpTransceiver.ts index ded126530..ad3d859f2 100644 --- a/src/RTCRtpTransceiver.ts +++ b/src/RTCRtpTransceiver.ts @@ -1,5 +1,6 @@ import { NativeModules } from 'react-native'; +import RTCRtpCodecCapability from './RTCRtpCodecCapability'; import RTCRtpReceiver from './RTCRtpReceiver'; import RTCRtpSender from './RTCRtpSender'; @@ -89,6 +90,14 @@ export default class RTCRtpTransceiver { .then(() => this._setStopped()); } + setCodecPreferences(codecs: RTCRtpCodecCapability[]) { + WebRTCModule.transceiverSetCodecPreferences( + this._peerConnectionId, + this.sender.id, + codecs + ); + } + _setStopped() { this._stopped = true; this._direction = 'stopped'; From eb2b0c482e934a6fc7aff571a6960ff57cee0841 Mon Sep 17 00:00:00 2001 From: Johnathon Weaver Date: Fri, 20 Oct 2023 10:58:44 +0800 Subject: [PATCH 11/21] ios build fix: missing type --- ios/RCTWebRTC/SerializeUtils.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ios/RCTWebRTC/SerializeUtils.h b/ios/RCTWebRTC/SerializeUtils.h index 412618061..1b7f1367f 100644 --- a/ios/RCTWebRTC/SerializeUtils.h +++ b/ios/RCTWebRTC/SerializeUtils.h @@ -15,7 +15,7 @@ + (NSDictionary *_Nonnull)trackToJSONWithPeerConnectionId:(nonnull NSNumber *)id track:(RTCMediaStreamTrack *_Nonnull)track; + (NSDictionary *_Nonnull)capabilitiesToJSON:(RTCRtpCapabilities *_Nonnull)capabilities; -+ (NSDictionary *_Nonnull)codecCapabilityToJSON:(RTCRtpCodecCapability *)codec; ++ (NSDictionary *_Nonnull)codecCapabilityToJSON:(RTCRtpCodecCapability *_Nonnull)codec; + (NSString *_Nonnull)serializeDirection:(RTCRtpTransceiverDirection)direction; + (RTCRtpTransceiverDirection)parseDirection:(NSString *_Nonnull)direction; + (RTCRtpTransceiverInit *_Nonnull)parseTransceiverOptions:(NSDictionary *_Nonnull)parameters; From 93bfe02101bac93490143130bf3bec545f281976 Mon Sep 17 00:00:00 2001 From: davidliu Date: Wed, 1 Nov 2023 15:21:25 +0900 Subject: [PATCH 12/21] ios: fix setCodecPreferences build error --- ios/RCTWebRTC/WebRTCModule+Transceivers.m | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/ios/RCTWebRTC/WebRTCModule+Transceivers.m b/ios/RCTWebRTC/WebRTCModule+Transceivers.m index 5b7c3ee53..09a874e08 100644 --- a/ios/RCTWebRTC/WebRTCModule+Transceivers.m +++ b/ios/RCTWebRTC/WebRTCModule+Transceivers.m @@ -205,11 +205,11 @@ @implementation WebRTCModule (Transceivers) } if (transceiver == nil) { - RCTLogWarn(@"senderSetParameters() transceiver is null"); + RCTLogWarn(@"transceiverSetCodecPreferences() transceiver is null"); return nil; } - // Convert JSON codec capabilities to the actual objects. + // Get the available codecs RTCRtpTransceiverDirection direction = transceiver.direction; NSMutableArray *availableCodecs = [NSMutableArray new]; if (direction == RTCRtpTransceiverDirectionSendRecv || direction == RTCRtpTransceiverDirectionSendOnly) { @@ -233,7 +233,8 @@ @implementation WebRTCModule (Transceivers) }]; } } - + + // Convert JSON codec capabilities to the actual objects. // Codec preferences is order sensitive. NSMutableArray *codecsToSet = [NSMutableArray new]; @@ -247,7 +248,7 @@ @implementation WebRTCModule (Transceivers) } } - transceiver.codecPreferences = codecsToSet; + [transceiver setCodecPreferences:codecsToSet]; return nil; } From 95984a3eb383788a29660956e033149ad5afab99 Mon Sep 17 00:00:00 2001 From: davidliu Date: Wed, 1 Nov 2023 15:37:34 +0900 Subject: [PATCH 13/21] ios: more setCodecPreferences fixes --- ios/RCTWebRTC/WebRTCModule+Transceivers.m | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ios/RCTWebRTC/WebRTCModule+Transceivers.m b/ios/RCTWebRTC/WebRTCModule+Transceivers.m index 09a874e08..7b9ae2bd1 100644 --- a/ios/RCTWebRTC/WebRTCModule+Transceivers.m +++ b/ios/RCTWebRTC/WebRTCModule+Transceivers.m @@ -248,7 +248,12 @@ @implementation WebRTCModule (Transceivers) } } - [transceiver setCodecPreferences:codecsToSet]; + NSError *error; + [transceiver setCodecPreferences:codecsToSet error:&error]; + + if (error) { + RTCLogError(@"transceiverSetCodecPreferences() Could not set preferences: %@", error); + } return nil; } From 9ca25c8153ac51d6bebbd297977e7bfd3987ccee Mon Sep 17 00:00:00 2001 From: Santhosh Vaiyapuri Date: Thu, 16 Nov 2023 10:57:27 +0100 Subject: [PATCH 14/21] 104.0.2 --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 3714d6992..66566f1e6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@stream-io/react-native-webrtc", - "version": "104.0.1", + "version": "104.0.2", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@stream-io/react-native-webrtc", - "version": "104.0.1", + "version": "104.0.2", "license": "MIT", "dependencies": { "adm-zip": "0.5.9", diff --git a/package.json b/package.json index 834678e24..4abbbde51 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@stream-io/react-native-webrtc", - "version": "104.0.1", + "version": "104.0.2", "repository": { "type": "git", "url": "git+https://github.com/GetStream/react-native-webrtc.git" From 6cee3a6263f2ebc40297d7192405bcab3513e3c0 Mon Sep 17 00:00:00 2001 From: Santhosh Vaiyapuri Date: Thu, 16 Nov 2023 15:37:21 +0100 Subject: [PATCH 15/21] chore: update lock file --- package-lock.json | 140 ++-------------------------------------------- 1 file changed, 5 insertions(+), 135 deletions(-) diff --git a/package-lock.json b/package-lock.json index 66566f1e6..d025dad67 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,11 +9,9 @@ "version": "104.0.2", "license": "MIT", "dependencies": { - "adm-zip": "0.5.9", "base64-js": "1.5.1", "debug": "4.3.4", - "event-target-shim": "6.0.2", - "tar": "6.1.11" + "event-target-shim": "6.0.2" }, "devDependencies": { "@types/debug": "4.1.7", @@ -2251,14 +2249,6 @@ "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" } }, - "node_modules/adm-zip": { - "version": "0.5.9", - "resolved": "https://registry.npmjs.org/adm-zip/-/adm-zip-0.5.9.tgz", - "integrity": "sha512-s+3fXLkeeLjZ2kLjCBwQufpI5fuN+kIGBxu6530nVQZGVol0d7Y/M88/xw9HGGUcJjKf8LutN3VPRUBq6N7Ajg==", - "engines": { - "node": ">=6.0" - } - }, "node_modules/aggregate-error": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.1.0.tgz", @@ -2588,14 +2578,6 @@ "node": ">=4" } }, - "node_modules/chownr": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/chownr/-/chownr-2.0.0.tgz", - "integrity": "sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==", - "engines": { - "node": ">=10" - } - }, "node_modules/clean-stack": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz", @@ -3528,17 +3510,6 @@ "node": ">=10" } }, - "node_modules/fs-minipass": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-2.1.0.tgz", - "integrity": "sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==", - "dependencies": { - "minipass": "^3.0.0" - }, - "engines": { - "node": ">= 8" - } - }, "node_modules/fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", @@ -4652,40 +4623,6 @@ "integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==", "dev": true }, - "node_modules/minipass": { - "version": "3.3.4", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.4.tgz", - "integrity": "sha512-I9WPbWHCGu8W+6k1ZiGpPu0GkoKBeorkfKNuAFBNS1HNFJvke82sxvI5bzcCNpWPorkOO5QQ+zomzzwRxejXiw==", - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/minizlib": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-2.1.2.tgz", - "integrity": "sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==", - "dependencies": { - "minipass": "^3.0.0", - "yallist": "^4.0.0" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/mkdirp": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", - "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", - "bin": { - "mkdirp": "bin/cmd.js" - }, - "engines": { - "node": ">=10" - } - }, "node_modules/ms": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", @@ -5627,22 +5564,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/tar": { - "version": "6.1.11", - "resolved": "https://registry.npmjs.org/tar/-/tar-6.1.11.tgz", - "integrity": "sha512-an/KZQzQUkZCkuoAA64hM92X0Urb6VpRhAFllDzz44U2mcD5scmT3zBc4VgVpkugF580+DQn8eAFSyoQt0tznA==", - "dependencies": { - "chownr": "^2.0.0", - "fs-minipass": "^2.0.0", - "minipass": "^3.0.0", - "minizlib": "^2.1.1", - "mkdirp": "^1.0.3", - "yallist": "^4.0.0" - }, - "engines": { - "node": ">= 10" - } - }, "node_modules/text-table": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", @@ -5948,7 +5869,8 @@ "node_modules/yallist": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true }, "node_modules/yaml": { "version": "1.10.2", @@ -7520,11 +7442,6 @@ "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", "dev": true }, - "adm-zip": { - "version": "0.5.9", - "resolved": "https://registry.npmjs.org/adm-zip/-/adm-zip-0.5.9.tgz", - "integrity": "sha512-s+3fXLkeeLjZ2kLjCBwQufpI5fuN+kIGBxu6530nVQZGVol0d7Y/M88/xw9HGGUcJjKf8LutN3VPRUBq6N7Ajg==" - }, "aggregate-error": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.1.0.tgz", @@ -7758,11 +7675,6 @@ } } }, - "chownr": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/chownr/-/chownr-2.0.0.tgz", - "integrity": "sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==" - }, "clean-stack": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz", @@ -8490,14 +8402,6 @@ "universalify": "^2.0.0" } }, - "fs-minipass": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-2.1.0.tgz", - "integrity": "sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==", - "requires": { - "minipass": "^3.0.0" - } - }, "fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", @@ -9295,28 +9199,6 @@ "integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==", "dev": true }, - "minipass": { - "version": "3.3.4", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.4.tgz", - "integrity": "sha512-I9WPbWHCGu8W+6k1ZiGpPu0GkoKBeorkfKNuAFBNS1HNFJvke82sxvI5bzcCNpWPorkOO5QQ+zomzzwRxejXiw==", - "requires": { - "yallist": "^4.0.0" - } - }, - "minizlib": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-2.1.2.tgz", - "integrity": "sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==", - "requires": { - "minipass": "^3.0.0", - "yallist": "^4.0.0" - } - }, - "mkdirp": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", - "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==" - }, "ms": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", @@ -9990,19 +9872,6 @@ "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", "dev": true }, - "tar": { - "version": "6.1.11", - "resolved": "https://registry.npmjs.org/tar/-/tar-6.1.11.tgz", - "integrity": "sha512-an/KZQzQUkZCkuoAA64hM92X0Urb6VpRhAFllDzz44U2mcD5scmT3zBc4VgVpkugF580+DQn8eAFSyoQt0tznA==", - "requires": { - "chownr": "^2.0.0", - "fs-minipass": "^2.0.0", - "minipass": "^3.0.0", - "minizlib": "^2.1.1", - "mkdirp": "^1.0.3", - "yallist": "^4.0.0" - } - }, "text-table": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", @@ -10230,7 +10099,8 @@ "yallist": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true }, "yaml": { "version": "1.10.2", From 6ea96eecda1b342eef4b34c427366e670d347bca Mon Sep 17 00:00:00 2001 From: Santhosh Vaiyapuri Date: Thu, 16 Nov 2023 15:37:37 +0100 Subject: [PATCH 16/21] 104.0.3-alpha.0 --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index d025dad67..9c9e4b5f4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@stream-io/react-native-webrtc", - "version": "104.0.2", + "version": "104.0.3-alpha.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@stream-io/react-native-webrtc", - "version": "104.0.2", + "version": "104.0.3-alpha.0", "license": "MIT", "dependencies": { "base64-js": "1.5.1", diff --git a/package.json b/package.json index 4abbbde51..3f903e2a8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@stream-io/react-native-webrtc", - "version": "104.0.2", + "version": "104.0.3-alpha.0", "repository": { "type": "git", "url": "git+https://github.com/GetStream/react-native-webrtc.git" From d06ab571331c801f773ea32610437964e8c07210 Mon Sep 17 00:00:00 2001 From: Santhosh Vaiyapuri Date: Thu, 16 Nov 2023 16:32:28 +0100 Subject: [PATCH 17/21] Revert "ios: add ability to customize RTCAudioDevice" This reverts commit 1587231bb2d66685335762934a65af5929a45825. --- ios/RCTWebRTC/WebRTCModule.m | 4 +--- ios/RCTWebRTC/WebRTCModuleOptions.h | 1 - ios/RCTWebRTC/WebRTCModuleOptions.m | 1 - 3 files changed, 1 insertion(+), 5 deletions(-) diff --git a/ios/RCTWebRTC/WebRTCModule.m b/ios/RCTWebRTC/WebRTCModule.m index 93ff75097..b1d61a4e1 100644 --- a/ios/RCTWebRTC/WebRTCModule.m +++ b/ios/RCTWebRTC/WebRTCModule.m @@ -40,7 +40,6 @@ - (instancetype)init { self = [super init]; if (self) { WebRTCModuleOptions *options = [WebRTCModuleOptions sharedInstance]; - id audioDevice = options.audioDevice; id decoderFactory = options.videoDecoderFactory; id encoderFactory = options.videoEncoderFactory; NSDictionary *fieldTrials = options.fieldTrials; @@ -70,8 +69,7 @@ - (instancetype)init { RCTLogInfo(@"Using video decoder factory: %@", NSStringFromClass([decoderFactory class])); _peerConnectionFactory = [[RTCPeerConnectionFactory alloc] initWithEncoderFactory:encoderFactory - decoderFactory:decoderFactory - audioDevice:audioDevice]; + decoderFactory:decoderFactory]; _peerConnections = [NSMutableDictionary new]; _localStreams = [NSMutableDictionary new]; diff --git a/ios/RCTWebRTC/WebRTCModuleOptions.h b/ios/RCTWebRTC/WebRTCModuleOptions.h index 7c91b36e8..f8e4cf098 100644 --- a/ios/RCTWebRTC/WebRTCModuleOptions.h +++ b/ios/RCTWebRTC/WebRTCModuleOptions.h @@ -7,7 +7,6 @@ NS_ASSUME_NONNULL_BEGIN @property(nonatomic, strong, nullable) id videoDecoderFactory; @property(nonatomic, strong, nullable) id videoEncoderFactory; -@property(nonatomic, strong, nullable) id audioDevice; @property(nonatomic, strong, nullable) NSDictionary *fieldTrials; @property(nonatomic, assign) RTCLoggingSeverity loggingSeverity; diff --git a/ios/RCTWebRTC/WebRTCModuleOptions.m b/ios/RCTWebRTC/WebRTCModuleOptions.m index ba108da6e..eccd8b1d6 100644 --- a/ios/RCTWebRTC/WebRTCModuleOptions.m +++ b/ios/RCTWebRTC/WebRTCModuleOptions.m @@ -17,7 +17,6 @@ + (instancetype)sharedInstance { - (instancetype)init { if (self = [super init]) { - self.audioDevice = nil; self.fieldTrials = nil; self.videoEncoderFactory = nil; self.videoDecoderFactory = nil; From 02f22702f874f41f4e90b4873be3826935d45768 Mon Sep 17 00:00:00 2001 From: Santhosh Vaiyapuri Date: Thu, 16 Nov 2023 16:38:37 +0100 Subject: [PATCH 18/21] 104.0.3-alpha.1 --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 9c9e4b5f4..9af36da73 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@stream-io/react-native-webrtc", - "version": "104.0.3-alpha.0", + "version": "104.0.3-alpha.1", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@stream-io/react-native-webrtc", - "version": "104.0.3-alpha.0", + "version": "104.0.3-alpha.1", "license": "MIT", "dependencies": { "base64-js": "1.5.1", diff --git a/package.json b/package.json index 3f903e2a8..7eb61e92f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@stream-io/react-native-webrtc", - "version": "104.0.3-alpha.0", + "version": "104.0.3-alpha.1", "repository": { "type": "git", "url": "git+https://github.com/GetStream/react-native-webrtc.git" From b0136e4fc33e35f4bc7b4acddec9979c0f6e6794 Mon Sep 17 00:00:00 2001 From: Santhosh Vaiyapuri Date: Thu, 16 Nov 2023 19:11:35 +0100 Subject: [PATCH 19/21] 104.0.3-alpha.2 --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 9af36da73..a984aa325 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@stream-io/react-native-webrtc", - "version": "104.0.3-alpha.1", + "version": "104.0.3-alpha.2", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@stream-io/react-native-webrtc", - "version": "104.0.3-alpha.1", + "version": "104.0.3-alpha.2", "license": "MIT", "dependencies": { "base64-js": "1.5.1", diff --git a/package.json b/package.json index 7eb61e92f..87bed4e87 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@stream-io/react-native-webrtc", - "version": "104.0.3-alpha.1", + "version": "104.0.3-alpha.2", "repository": { "type": "git", "url": "git+https://github.com/GetStream/react-native-webrtc.git" From d82e62cfe30f170049559d2ecc077028c070b3d6 Mon Sep 17 00:00:00 2001 From: Santhosh Vaiyapuri Date: Thu, 16 Nov 2023 19:45:46 +0100 Subject: [PATCH 20/21] fix: pod spec troubles --- stream-react-native-webrtc.podspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stream-react-native-webrtc.podspec b/stream-react-native-webrtc.podspec index 91ff2799f..0b827b4af 100644 --- a/stream-react-native-webrtc.podspec +++ b/stream-react-native-webrtc.podspec @@ -8,7 +8,7 @@ Pod::Spec.new do |s| s.summary = package['description'] s.homepage = 'https://github.com/GetStream/react-native-webrtc' s.license = package['license'] - s.author = 'https://github.com/lGetStreamivekit/react-native-webrtc/graphs/contributors' + s.author = 'https://github.com/GetStream/react-native-webrtc/graphs/contributors' s.source = { :git => 'git@github.com:GetStream/react-native-webrtc.git', :tag => 'release #{s.version}' } s.requires_arc = true From c704fe19de87fae3a7cbe12a585413b14abf1ed7 Mon Sep 17 00:00:00 2001 From: Santhosh Vaiyapuri Date: Fri, 17 Nov 2023 13:13:32 +0100 Subject: [PATCH 21/21] 104.0.3 --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index a984aa325..603799f51 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@stream-io/react-native-webrtc", - "version": "104.0.3-alpha.2", + "version": "104.0.3", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@stream-io/react-native-webrtc", - "version": "104.0.3-alpha.2", + "version": "104.0.3", "license": "MIT", "dependencies": { "base64-js": "1.5.1", diff --git a/package.json b/package.json index 87bed4e87..2a3e9d805 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@stream-io/react-native-webrtc", - "version": "104.0.3-alpha.2", + "version": "104.0.3", "repository": { "type": "git", "url": "git+https://github.com/GetStream/react-native-webrtc.git"