react-native-webrtc 106.0.5 → 106.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.clang-format +11 -0
- package/LICENSE +2 -1
- package/android/src/main/java/com/oney/WebRTCModule/AbstractVideoCaptureController.java +0 -1
- package/android/src/main/java/com/oney/WebRTCModule/CameraCaptureController.java +7 -15
- package/android/src/main/java/com/oney/WebRTCModule/CameraEventsHandler.java +3 -12
- package/android/src/main/java/com/oney/WebRTCModule/DataChannelWrapper.java +12 -16
- package/android/src/main/java/com/oney/WebRTCModule/DisplayUtils.java +1 -1
- package/android/src/main/java/com/oney/WebRTCModule/EglUtils.java +1 -1
- package/android/src/main/java/com/oney/WebRTCModule/GetUserMediaImpl.java +29 -43
- package/android/src/main/java/com/oney/WebRTCModule/PeerConnectionObserver.java +123 -116
- package/android/src/main/java/com/oney/WebRTCModule/RTCVideoViewManager.java +60 -61
- package/android/src/main/java/com/oney/WebRTCModule/ReactBridgeUtil.java +1 -2
- package/android/src/main/java/com/oney/WebRTCModule/ScreenCaptureController.java +11 -13
- package/android/src/main/java/com/oney/WebRTCModule/SerializeUtils.java +116 -119
- package/android/src/main/java/com/oney/WebRTCModule/StringUtils.java +8 -14
- package/android/src/main/java/com/oney/WebRTCModule/ThreadUtils.java +1 -2
- package/android/src/main/java/com/oney/WebRTCModule/TrackCapturerEventsEmitter.java +3 -4
- package/android/src/main/java/com/oney/WebRTCModule/VideoTrackAdapter.java +5 -9
- package/android/src/main/java/com/oney/WebRTCModule/WebRTCModule.java +335 -350
- package/android/src/main/java/com/oney/WebRTCModule/WebRTCModulePackage.java +4 -10
- package/android/src/main/java/com/oney/WebRTCModule/WebRTCView.java +74 -98
- package/android/src/main/java/com/oney/WebRTCModule/videoEffects/ProcessorProvider.java +10 -9
- package/android/src/main/java/com/oney/WebRTCModule/videoEffects/VideoEffectProcessor.java +2 -6
- package/android/src/main/java/com/oney/WebRTCModule/videoEffects/VideoFrameProcessorFactoryInterface.java +4 -5
- package/ios/RCTWebRTC/CaptureController.h +2 -9
- package/ios/RCTWebRTC/CaptureController.m +0 -7
- package/ios/RCTWebRTC/DataChannelWrapper.h +9 -13
- package/ios/RCTWebRTC/DataChannelWrapper.m +4 -5
- package/ios/RCTWebRTC/RCTConvert+WebRTC.h +2 -2
- package/ios/RCTWebRTC/RCTConvert+WebRTC.m +166 -171
- package/ios/RCTWebRTC/RTCMediaStreamTrack+React.h +1 -1
- package/ios/RCTWebRTC/RTCMediaStreamTrack+React.m +1 -1
- package/ios/RCTWebRTC/RTCVideoViewManager.h +0 -8
- package/ios/RCTWebRTC/RTCVideoViewManager.m +205 -214
- package/ios/RCTWebRTC/ScreenCaptureController.h +2 -9
- package/ios/RCTWebRTC/ScreenCaptureController.m +10 -16
- package/ios/RCTWebRTC/ScreenCapturePickerViewManager.h +0 -7
- package/ios/RCTWebRTC/ScreenCapturePickerViewManager.m +26 -34
- package/ios/RCTWebRTC/ScreenCapturer.h +1 -8
- package/ios/RCTWebRTC/ScreenCapturer.m +56 -55
- package/ios/RCTWebRTC/SerializeUtils.h +16 -16
- package/ios/RCTWebRTC/SerializeUtils.m +98 -99
- package/ios/RCTWebRTC/SocketConnection.h +1 -8
- package/ios/RCTWebRTC/SocketConnection.m +31 -38
- package/ios/RCTWebRTC/TrackCapturerEventsEmitter.h +4 -4
- package/ios/RCTWebRTC/TrackCapturerEventsEmitter.m +5 -6
- package/ios/RCTWebRTC/VideoCaptureController.h +6 -7
- package/ios/RCTWebRTC/VideoCaptureController.m +54 -53
- package/ios/RCTWebRTC/WebRTCModule+Permissions.m +14 -13
- package/ios/RCTWebRTC/WebRTCModule+RTCDataChannel.h +3 -3
- package/ios/RCTWebRTC/WebRTCModule+RTCDataChannel.m +105 -100
- package/ios/RCTWebRTC/WebRTCModule+RTCMediaStream.h +3 -2
- package/ios/RCTWebRTC/WebRTCModule+RTCMediaStream.m +196 -226
- package/ios/RCTWebRTC/WebRTCModule+RTCPeerConnection.h +7 -14
- package/ios/RCTWebRTC/WebRTCModule+RTCPeerConnection.m +625 -603
- package/ios/RCTWebRTC/WebRTCModule+Transceivers.m +128 -139
- package/ios/RCTWebRTC/WebRTCModule+VideoTrackAdapter.h +4 -5
- package/ios/RCTWebRTC/WebRTCModule+VideoTrackAdapter.m +26 -35
- package/ios/RCTWebRTC/WebRTCModule.h +13 -20
- package/ios/RCTWebRTC/WebRTCModule.m +69 -84
- package/ios/RCTWebRTC.xcworkspace/xcuserdata/saghul.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
- package/lib/commonjs/RTCPeerConnection.js +79 -56
- package/lib/commonjs/RTCPeerConnection.js.map +1 -1
- package/lib/commonjs/RTCRtpEncodingParameters.js +12 -3
- package/lib/commonjs/RTCRtpEncodingParameters.js.map +1 -1
- package/lib/commonjs/RTCRtpTransceiver.js +1 -1
- package/lib/commonjs/RTCRtpTransceiver.js.map +1 -1
- package/lib/module/RTCPeerConnection.js +79 -56
- package/lib/module/RTCPeerConnection.js.map +1 -1
- package/lib/module/RTCRtpEncodingParameters.js +12 -3
- package/lib/module/RTCRtpEncodingParameters.js.map +1 -1
- package/lib/module/RTCRtpTransceiver.js +1 -1
- package/lib/module/RTCRtpTransceiver.js.map +1 -1
- package/lib/typescript/RTCPeerConnection.d.ts +4 -4
- package/package.json +3 -2
- package/src/RTCPeerConnection.ts +70 -63
- package/src/RTCRtpEncodingParameters.ts +12 -3
- package/src/RTCRtpTransceiver.ts +1 -1
- package/ios/RCTWebRTC.xcodeproj/project.xcworkspace/contents.xcworkspacedata +0 -7
- package/ios/RCTWebRTC.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +0 -8
- package/ios/RCTWebRTC.xcodeproj/project.xcworkspace/xcuserdata/saghul.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
|
@@ -1,210 +1,205 @@
|
|
|
1
|
-
#import "RCTConvert+WebRTC.h"
|
|
2
1
|
#import <React/RCTLog.h>
|
|
3
2
|
#import <WebRTC/RTCDataChannelConfiguration.h>
|
|
4
3
|
#import <WebRTC/RTCIceServer.h>
|
|
5
4
|
#import <WebRTC/RTCSessionDescription.h>
|
|
5
|
+
#import "RCTConvert+WebRTC.h"
|
|
6
6
|
|
|
7
7
|
@implementation RCTConvert (WebRTC)
|
|
8
8
|
|
|
9
|
-
+ (RTCSessionDescription *)RTCSessionDescription:(id)json
|
|
10
|
-
{
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
}
|
|
9
|
+
+ (RTCSessionDescription *)RTCSessionDescription:(id)json {
|
|
10
|
+
if (!json) {
|
|
11
|
+
return nil;
|
|
12
|
+
}
|
|
14
13
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
14
|
+
if (![json isKindOfClass:[NSDictionary class]]) {
|
|
15
|
+
RCTLogConvertError(json, @"must be an object");
|
|
16
|
+
return nil;
|
|
17
|
+
}
|
|
19
18
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
19
|
+
if (json[@"sdp"] == nil) {
|
|
20
|
+
RCTLogConvertError(json, @".sdp must not be null");
|
|
21
|
+
return nil;
|
|
22
|
+
}
|
|
24
23
|
|
|
25
|
-
|
|
26
|
-
|
|
24
|
+
NSString *sdp = json[@"sdp"];
|
|
25
|
+
RTCSdpType sdpType = [RTCSessionDescription typeForString:json[@"type"]];
|
|
27
26
|
|
|
28
|
-
|
|
27
|
+
return [[RTCSessionDescription alloc] initWithType:sdpType sdp:sdp];
|
|
29
28
|
}
|
|
30
29
|
|
|
31
|
-
+ (RTCIceCandidate *)RTCIceCandidate:(id)json
|
|
32
|
-
{
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
}
|
|
30
|
+
+ (RTCIceCandidate *)RTCIceCandidate:(id)json {
|
|
31
|
+
if (!json) {
|
|
32
|
+
RCTLogConvertError(json, @"must not be null");
|
|
33
|
+
return nil;
|
|
34
|
+
}
|
|
37
35
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
36
|
+
if (![json isKindOfClass:[NSDictionary class]]) {
|
|
37
|
+
RCTLogConvertError(json, @"must be an object");
|
|
38
|
+
return nil;
|
|
39
|
+
}
|
|
42
40
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
if (json[@"sdpMid"] == nil) {
|
|
49
|
-
RCTLogConvertError(json, @".sdpMid must not be null");
|
|
50
|
-
return nil;
|
|
51
|
-
}
|
|
41
|
+
if (json[@"candidate"] == nil) {
|
|
42
|
+
RCTLogConvertError(json, @".candidate must not be null");
|
|
43
|
+
return nil;
|
|
44
|
+
}
|
|
52
45
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
46
|
+
if (json[@"sdpMid"] == nil) {
|
|
47
|
+
RCTLogConvertError(json, @".sdpMid must not be null");
|
|
48
|
+
return nil;
|
|
49
|
+
}
|
|
57
50
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
51
|
+
if (json[@"sdpMLineIndex"] == nil) {
|
|
52
|
+
RCTLogConvertError(json, @".sdpMLineIndex must not be null");
|
|
53
|
+
return nil;
|
|
54
|
+
}
|
|
62
55
|
|
|
56
|
+
NSString *sdp = json[@"candidate"];
|
|
57
|
+
RCTLogTrace(@"%@ <- candidate", sdp);
|
|
58
|
+
int sdpMLineIndex = [RCTConvert int:json[@"sdpMLineIndex"]];
|
|
59
|
+
NSString *sdpMid = json[@"sdpMid"];
|
|
63
60
|
|
|
64
|
-
|
|
61
|
+
return [[RTCIceCandidate alloc] initWithSdp:sdp sdpMLineIndex:sdpMLineIndex sdpMid:sdpMid];
|
|
65
62
|
}
|
|
66
63
|
|
|
67
|
-
+ (RTCIceServer *)RTCIceServer:(id)json
|
|
68
|
-
{
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
}
|
|
64
|
+
+ (RTCIceServer *)RTCIceServer:(id)json {
|
|
65
|
+
if (!json) {
|
|
66
|
+
RCTLogConvertError(json, @"a valid iceServer value");
|
|
67
|
+
return nil;
|
|
68
|
+
}
|
|
73
69
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
return [[RTCIceServer alloc] initWithURLStrings:urls];
|
|
70
|
+
if (![json isKindOfClass:[NSDictionary class]]) {
|
|
71
|
+
RCTLogConvertError(json, @"must be an object");
|
|
72
|
+
return nil;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
NSArray<NSString *> *urls;
|
|
76
|
+
if ([json[@"urls"] isKindOfClass:[NSString class]]) {
|
|
77
|
+
urls = @[ json[@"urls"] ];
|
|
78
|
+
} else {
|
|
79
|
+
urls = [RCTConvert NSArray:json[@"urls"]];
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
if (json[@"username"] != nil || json[@"credential"] != nil) {
|
|
83
|
+
return [[RTCIceServer alloc] initWithURLStrings:urls username:json[@"username"] credential:json[@"credential"]];
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
return [[RTCIceServer alloc] initWithURLStrings:urls];
|
|
93
87
|
}
|
|
94
88
|
|
|
95
|
-
+ (nonnull RTCConfiguration *)RTCConfiguration:(id)json
|
|
96
|
-
|
|
97
|
-
RTCConfiguration *config = [[RTCConfiguration alloc] init];
|
|
89
|
+
+ (nonnull RTCConfiguration *)RTCConfiguration:(id)json {
|
|
90
|
+
RTCConfiguration *config = [[RTCConfiguration alloc] init];
|
|
98
91
|
|
|
99
|
-
|
|
100
|
-
|
|
92
|
+
// Required for perfect negotiation.
|
|
93
|
+
config.enableImplicitRollback = YES;
|
|
101
94
|
|
|
102
|
-
|
|
95
|
+
config.sdpSemantics = RTCSdpSemanticsUnifiedPlan;
|
|
103
96
|
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
97
|
+
if (!json) {
|
|
98
|
+
return config;
|
|
99
|
+
}
|
|
107
100
|
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
if (json[@"audioJitterBufferMaxPackets"] != nil && [json[@"audioJitterBufferMaxPackets"] isKindOfClass:[NSNumber class]]) {
|
|
114
|
-
config.audioJitterBufferMaxPackets = [RCTConvert int:json[@"audioJitterBufferMaxPackets"]];
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
if (json[@"bundlePolicy"] != nil && [json[@"bundlePolicy"] isKindOfClass:[NSString class]]) {
|
|
118
|
-
NSString *bundlePolicy = json[@"bundlePolicy"];
|
|
119
|
-
if ([bundlePolicy isEqualToString:@"balanced"]) {
|
|
120
|
-
config.bundlePolicy = RTCBundlePolicyBalanced;
|
|
121
|
-
} else if ([bundlePolicy isEqualToString:@"max-compat"]) {
|
|
122
|
-
config.bundlePolicy = RTCBundlePolicyMaxCompat;
|
|
123
|
-
} else if ([bundlePolicy isEqualToString:@"max-bundle"]) {
|
|
124
|
-
config.bundlePolicy = RTCBundlePolicyMaxBundle;
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
if (json[@"iceBackupCandidatePairPingInterval"] != nil && [json[@"iceBackupCandidatePairPingInterval"] isKindOfClass:[NSNumber class]]) {
|
|
129
|
-
config.iceBackupCandidatePairPingInterval = [RCTConvert int:json[@"iceBackupCandidatePairPingInterval"]];
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
if (json[@"iceConnectionReceivingTimeout"] != nil && [json[@"iceConnectionReceivingTimeout"] isKindOfClass:[NSNumber class]]) {
|
|
133
|
-
config.iceConnectionReceivingTimeout = [RCTConvert int:json[@"iceConnectionReceivingTimeout"]];
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
if (json[@"iceServers"] != nil && [json[@"iceServers"] isKindOfClass:[NSArray class]]) {
|
|
137
|
-
NSMutableArray<RTCIceServer *> *iceServers = [NSMutableArray new];
|
|
138
|
-
for (id server in json[@"iceServers"]) {
|
|
139
|
-
RTCIceServer *convert = [RCTConvert RTCIceServer:server];
|
|
140
|
-
if (convert != nil) {
|
|
141
|
-
[iceServers addObject:convert];
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
config.iceServers = iceServers;
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
if (json[@"iceTransportPolicy"] != nil && [json[@"iceTransportPolicy"] isKindOfClass:[NSString class]]) {
|
|
148
|
-
NSString *iceTransportPolicy = json[@"iceTransportPolicy"];
|
|
149
|
-
if ([iceTransportPolicy isEqualToString:@"all"]) {
|
|
150
|
-
config.iceTransportPolicy = RTCIceTransportPolicyAll;
|
|
151
|
-
} else if ([iceTransportPolicy isEqualToString:@"none"]) {
|
|
152
|
-
config.iceTransportPolicy = RTCIceTransportPolicyNone;
|
|
153
|
-
} else if ([iceTransportPolicy isEqualToString:@"nohost"]) {
|
|
154
|
-
config.iceTransportPolicy = RTCIceTransportPolicyNoHost;
|
|
155
|
-
} else if ([iceTransportPolicy isEqualToString:@"relay"]) {
|
|
156
|
-
config.iceTransportPolicy = RTCIceTransportPolicyRelay;
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
if (json[@"rtcpMuxPolicy"] != nil && [json[@"rtcpMuxPolicy"] isKindOfClass:[NSString class]]) {
|
|
161
|
-
NSString *rtcpMuxPolicy = json[@"rtcpMuxPolicy"];
|
|
162
|
-
if ([rtcpMuxPolicy isEqualToString:@"negotiate"]) {
|
|
163
|
-
config.rtcpMuxPolicy = RTCRtcpMuxPolicyNegotiate;
|
|
164
|
-
} else if ([rtcpMuxPolicy isEqualToString:@"require"]) {
|
|
165
|
-
config.rtcpMuxPolicy = RTCRtcpMuxPolicyRequire;
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
if (json[@"tcpCandidatePolicy"] != nil && [json[@"tcpCandidatePolicy"] isKindOfClass:[NSString class]]) {
|
|
170
|
-
NSString *tcpCandidatePolicy = json[@"tcpCandidatePolicy"];
|
|
171
|
-
if ([tcpCandidatePolicy isEqualToString:@"enabled"]) {
|
|
172
|
-
config.tcpCandidatePolicy = RTCTcpCandidatePolicyEnabled;
|
|
173
|
-
} else if ([tcpCandidatePolicy isEqualToString:@"disabled"]) {
|
|
174
|
-
config.tcpCandidatePolicy = RTCTcpCandidatePolicyDisabled;
|
|
175
|
-
}
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
return config;
|
|
179
|
-
}
|
|
101
|
+
if (![json isKindOfClass:[NSDictionary class]]) {
|
|
102
|
+
RCTLogConvertError(json, @"must be an object");
|
|
103
|
+
return config;
|
|
104
|
+
}
|
|
180
105
|
|
|
181
|
-
|
|
182
|
-
{
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
106
|
+
if (json[@"audioJitterBufferMaxPackets"] != nil &&
|
|
107
|
+
[json[@"audioJitterBufferMaxPackets"] isKindOfClass:[NSNumber class]]) {
|
|
108
|
+
config.audioJitterBufferMaxPackets = [RCTConvert int:json[@"audioJitterBufferMaxPackets"]];
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
if (json[@"bundlePolicy"] != nil && [json[@"bundlePolicy"] isKindOfClass:[NSString class]]) {
|
|
112
|
+
NSString *bundlePolicy = json[@"bundlePolicy"];
|
|
113
|
+
if ([bundlePolicy isEqualToString:@"balanced"]) {
|
|
114
|
+
config.bundlePolicy = RTCBundlePolicyBalanced;
|
|
115
|
+
} else if ([bundlePolicy isEqualToString:@"max-compat"]) {
|
|
116
|
+
config.bundlePolicy = RTCBundlePolicyMaxCompat;
|
|
117
|
+
} else if ([bundlePolicy isEqualToString:@"max-bundle"]) {
|
|
118
|
+
config.bundlePolicy = RTCBundlePolicyMaxBundle;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
188
121
|
|
|
189
|
-
if (json[@"
|
|
190
|
-
|
|
122
|
+
if (json[@"iceBackupCandidatePairPingInterval"] != nil &&
|
|
123
|
+
[json[@"iceBackupCandidatePairPingInterval"] isKindOfClass:[NSNumber class]]) {
|
|
124
|
+
config.iceBackupCandidatePairPingInterval = [RCTConvert int:json[@"iceBackupCandidatePairPingInterval"]];
|
|
191
125
|
}
|
|
192
126
|
|
|
193
|
-
if (json[@"
|
|
194
|
-
|
|
127
|
+
if (json[@"iceConnectionReceivingTimeout"] != nil &&
|
|
128
|
+
[json[@"iceConnectionReceivingTimeout"] isKindOfClass:[NSNumber class]]) {
|
|
129
|
+
config.iceConnectionReceivingTimeout = [RCTConvert int:json[@"iceConnectionReceivingTimeout"]];
|
|
195
130
|
}
|
|
196
|
-
|
|
197
|
-
|
|
131
|
+
|
|
132
|
+
if (json[@"iceServers"] != nil && [json[@"iceServers"] isKindOfClass:[NSArray class]]) {
|
|
133
|
+
NSMutableArray<RTCIceServer *> *iceServers = [NSMutableArray new];
|
|
134
|
+
for (id server in json[@"iceServers"]) {
|
|
135
|
+
RTCIceServer *convert = [RCTConvert RTCIceServer:server];
|
|
136
|
+
if (convert != nil) {
|
|
137
|
+
[iceServers addObject:convert];
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
config.iceServers = iceServers;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
if (json[@"iceTransportPolicy"] != nil && [json[@"iceTransportPolicy"] isKindOfClass:[NSString class]]) {
|
|
144
|
+
NSString *iceTransportPolicy = json[@"iceTransportPolicy"];
|
|
145
|
+
if ([iceTransportPolicy isEqualToString:@"all"]) {
|
|
146
|
+
config.iceTransportPolicy = RTCIceTransportPolicyAll;
|
|
147
|
+
} else if ([iceTransportPolicy isEqualToString:@"none"]) {
|
|
148
|
+
config.iceTransportPolicy = RTCIceTransportPolicyNone;
|
|
149
|
+
} else if ([iceTransportPolicy isEqualToString:@"nohost"]) {
|
|
150
|
+
config.iceTransportPolicy = RTCIceTransportPolicyNoHost;
|
|
151
|
+
} else if ([iceTransportPolicy isEqualToString:@"relay"]) {
|
|
152
|
+
config.iceTransportPolicy = RTCIceTransportPolicyRelay;
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
if (json[@"rtcpMuxPolicy"] != nil && [json[@"rtcpMuxPolicy"] isKindOfClass:[NSString class]]) {
|
|
157
|
+
NSString *rtcpMuxPolicy = json[@"rtcpMuxPolicy"];
|
|
158
|
+
if ([rtcpMuxPolicy isEqualToString:@"negotiate"]) {
|
|
159
|
+
config.rtcpMuxPolicy = RTCRtcpMuxPolicyNegotiate;
|
|
160
|
+
} else if ([rtcpMuxPolicy isEqualToString:@"require"]) {
|
|
161
|
+
config.rtcpMuxPolicy = RTCRtcpMuxPolicyRequire;
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
if (json[@"tcpCandidatePolicy"] != nil && [json[@"tcpCandidatePolicy"] isKindOfClass:[NSString class]]) {
|
|
166
|
+
NSString *tcpCandidatePolicy = json[@"tcpCandidatePolicy"];
|
|
167
|
+
if ([tcpCandidatePolicy isEqualToString:@"enabled"]) {
|
|
168
|
+
config.tcpCandidatePolicy = RTCTcpCandidatePolicyEnabled;
|
|
169
|
+
} else if ([tcpCandidatePolicy isEqualToString:@"disabled"]) {
|
|
170
|
+
config.tcpCandidatePolicy = RTCTcpCandidatePolicyDisabled;
|
|
171
|
+
}
|
|
198
172
|
}
|
|
199
|
-
|
|
200
|
-
|
|
173
|
+
|
|
174
|
+
return config;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
+ (RTCDataChannelConfiguration *)RTCDataChannelConfiguration:(id)json {
|
|
178
|
+
if (!json) {
|
|
179
|
+
return nil;
|
|
201
180
|
}
|
|
202
|
-
if (json[
|
|
203
|
-
|
|
181
|
+
if ([json isKindOfClass:[NSDictionary class]]) {
|
|
182
|
+
RTCDataChannelConfiguration *init = [RTCDataChannelConfiguration new];
|
|
183
|
+
|
|
184
|
+
if (json[@"id"]) {
|
|
185
|
+
[init setChannelId:[RCTConvert int:json[@"id"]]];
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
if (json[@"ordered"]) {
|
|
189
|
+
init.isOrdered = [RCTConvert BOOL:json[@"ordered"]];
|
|
190
|
+
}
|
|
191
|
+
if (json[@"maxRetransmits"]) {
|
|
192
|
+
init.maxRetransmits = [RCTConvert int:json[@"maxRetransmits"]];
|
|
193
|
+
}
|
|
194
|
+
if (json[@"negotiated"]) {
|
|
195
|
+
init.isNegotiated = [RCTConvert NSInteger:json[@"negotiated"]];
|
|
196
|
+
}
|
|
197
|
+
if (json[@"protocol"]) {
|
|
198
|
+
init.protocol = [RCTConvert NSString:json[@"protocol"]];
|
|
199
|
+
}
|
|
200
|
+
return init;
|
|
204
201
|
}
|
|
205
|
-
return
|
|
206
|
-
}
|
|
207
|
-
return nil;
|
|
202
|
+
return nil;
|
|
208
203
|
}
|
|
209
204
|
|
|
210
205
|
@end
|