react-native-webrtc 124.0.4 → 124.0.6
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/.nvmrc +1 -0
- package/android/build.gradle +3 -2
- package/android/consumer-rules.pro +2 -0
- package/android/src/main/java/com/oney/WebRTCModule/AbstractVideoCaptureController.java +30 -3
- package/android/src/main/java/com/oney/WebRTCModule/CameraCaptureController.java +180 -73
- package/android/src/main/java/com/oney/WebRTCModule/GetUserMediaImpl.java +53 -24
- package/android/src/main/java/com/oney/WebRTCModule/MediaProjectionNotification.java +11 -19
- package/android/src/main/java/com/oney/WebRTCModule/MediaProjectionService.java +0 -2
- package/android/src/main/java/com/oney/WebRTCModule/PeerConnectionObserver.java +4 -2
- package/android/src/main/java/com/oney/WebRTCModule/RTCVideoViewManager.java +25 -0
- package/android/src/main/java/com/oney/WebRTCModule/ScreenCaptureController.java +6 -4
- package/android/src/main/java/com/oney/WebRTCModule/WebRTCModule.java +20 -14
- package/android/src/main/java/com/oney/WebRTCModule/WebRTCView.java +37 -0
- package/android/src/main/java/com/oney/WebRTCModule/videoEffects/VideoEffectProcessor.java +15 -9
- package/android/src/main/java/org/webrtc/Camera1Helper.java +0 -1
- package/android/src/main/java/org/webrtc/Camera2Helper.java +4 -3
- package/ios/RCTWebRTC/CaptureController.h +3 -0
- package/ios/RCTWebRTC/CaptureController.m +12 -0
- package/ios/RCTWebRTC/I420Converter.h +22 -0
- package/ios/RCTWebRTC/I420Converter.m +164 -0
- package/ios/RCTWebRTC/PIPController.h +24 -0
- package/ios/RCTWebRTC/PIPController.m +234 -0
- package/ios/RCTWebRTC/RTCVideoViewManager.h +23 -0
- package/ios/RCTWebRTC/RTCVideoViewManager.m +131 -28
- package/ios/RCTWebRTC/SampleBufferVideoCallView.h +12 -0
- package/ios/RCTWebRTC/SampleBufferVideoCallView.m +178 -0
- package/ios/RCTWebRTC/ScreenCaptureController.m +4 -0
- package/ios/RCTWebRTC/VideoCaptureController.h +3 -0
- package/ios/RCTWebRTC/VideoCaptureController.m +95 -30
- package/ios/RCTWebRTC/WebRTCModule+Permissions.m +4 -8
- package/ios/RCTWebRTC/WebRTCModule+RTCAudioSession.m +20 -0
- package/ios/RCTWebRTC/WebRTCModule+RTCDataChannel.m +31 -40
- package/ios/RCTWebRTC/WebRTCModule+RTCMediaStream.h +5 -0
- package/ios/RCTWebRTC/WebRTCModule+RTCMediaStream.m +93 -28
- package/ios/RCTWebRTC/WebRTCModule+RTCPeerConnection.m +26 -55
- package/ios/RCTWebRTC/WebRTCModule+Transceivers.m +11 -28
- package/ios/RCTWebRTC/WebRTCModuleOptions.h +1 -0
- package/ios/RCTWebRTC/videoEffects/ProcessorProvider.h +9 -0
- package/ios/RCTWebRTC/videoEffects/ProcessorProvider.m +23 -0
- package/ios/RCTWebRTC/videoEffects/VideoEffectProcessor.h +13 -0
- package/ios/RCTWebRTC/videoEffects/VideoEffectProcessor.m +23 -0
- package/ios/RCTWebRTC/videoEffects/VideoFrameProcessor.h +8 -0
- package/ios/RCTWebRTC.xcodeproj/project.pbxproj +4 -0
- package/lib/commonjs/Constraints.js +2 -0
- package/lib/commonjs/Constraints.js.map +1 -0
- package/lib/commonjs/MediaDevices.js.map +1 -1
- package/lib/commonjs/MediaStreamTrack.js +31 -5
- package/lib/commonjs/MediaStreamTrack.js.map +1 -1
- package/lib/commonjs/RTCAudioSession.js +33 -0
- package/lib/commonjs/RTCAudioSession.js.map +1 -0
- package/lib/commonjs/RTCPIPView.js +38 -0
- package/lib/commonjs/RTCPIPView.js.map +1 -0
- package/lib/commonjs/RTCPeerConnection.js +2 -4
- package/lib/commonjs/RTCPeerConnection.js.map +1 -1
- package/lib/commonjs/RTCUtil.js +2 -3
- package/lib/commonjs/RTCUtil.js.map +1 -1
- package/lib/commonjs/RTCView.js.map +1 -1
- package/lib/commonjs/getUserMedia.js.map +1 -1
- package/lib/commonjs/index.js +28 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/module/Constraints.js +2 -0
- package/lib/module/Constraints.js.map +1 -0
- package/lib/module/MediaDevices.js.map +1 -1
- package/lib/module/MediaStreamTrack.js +32 -6
- package/lib/module/MediaStreamTrack.js.map +1 -1
- package/lib/module/RTCAudioSession.js +26 -0
- package/lib/module/RTCAudioSession.js.map +1 -0
- package/lib/module/RTCPIPView.js +26 -0
- package/lib/module/RTCPIPView.js.map +1 -0
- package/lib/module/RTCPeerConnection.js +2 -4
- package/lib/module/RTCPeerConnection.js.map +1 -1
- package/lib/module/RTCUtil.js +2 -3
- package/lib/module/RTCUtil.js.map +1 -1
- package/lib/module/RTCView.js.map +1 -1
- package/lib/module/getUserMedia.js.map +1 -1
- package/lib/module/index.js +3 -1
- package/lib/module/index.js.map +1 -1
- package/lib/typescript/Constraints.d.ts +19 -0
- package/lib/typescript/MediaDevices.d.ts +2 -1
- package/lib/typescript/MediaStreamTrack.d.ts +27 -5
- package/lib/typescript/RTCAudioSession.d.ts +10 -0
- package/lib/typescript/RTCPIPView.d.ts +15 -0
- package/lib/typescript/RTCPeerConnection.d.ts +2 -1
- package/lib/typescript/RTCUtil.d.ts +7 -1
- package/lib/typescript/RTCView.d.ts +58 -1
- package/lib/typescript/getUserMedia.d.ts +4 -4
- package/lib/typescript/index.d.ts +5 -3
- package/package.json +2 -1
- package/src/.eslintrc.cjs +1 -1
- package/src/Constraints.ts +21 -0
- package/src/MediaDevices.ts +2 -2
- package/src/MediaStreamTrack.ts +47 -9
- package/src/RTCAudioSession.ts +25 -0
- package/src/RTCPIPView.tsx +47 -0
- package/src/RTCPeerConnection.ts +4 -5
- package/src/RTCUtil.ts +10 -3
- package/src/RTCView.ts +60 -2
- package/src/getUserMedia.ts +4 -3
- package/src/index.ts +12 -3
- package/tools/release.sh +1 -1
- package/tsconfig.json +3 -1
- package/ios/RCTWebRTC.xcodeproj/xcuserdata/saghul.xcuserdatad/xcschemes/xcschememanagement.plist +0 -14
- package/ios/RCTWebRTC.xcworkspace/xcuserdata/saghul.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
- package/tools/build-webrtc.py +0 -344
|
@@ -8,7 +8,9 @@
|
|
|
8
8
|
#import "RTCMediaStreamTrack+React.h"
|
|
9
9
|
#import "WebRTCModule+RTCMediaStream.h"
|
|
10
10
|
#import "WebRTCModule+RTCPeerConnection.h"
|
|
11
|
+
#import "WebRTCModuleOptions.h"
|
|
11
12
|
|
|
13
|
+
#import "ProcessorProvider.h"
|
|
12
14
|
#import "ScreenCaptureController.h"
|
|
13
15
|
#import "ScreenCapturer.h"
|
|
14
16
|
#import "TrackCapturerEventsEmitter.h"
|
|
@@ -16,6 +18,15 @@
|
|
|
16
18
|
|
|
17
19
|
@implementation WebRTCModule (RTCMediaStream)
|
|
18
20
|
|
|
21
|
+
- (VideoEffectProcessor *)videoEffectProcessor {
|
|
22
|
+
return objc_getAssociatedObject(self, _cmd);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
- (void)setVideoEffectProcessor:(VideoEffectProcessor *)videoEffectProcessor {
|
|
26
|
+
objc_setAssociatedObject(
|
|
27
|
+
self, @selector(videoEffectProcessor), videoEffectProcessor, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
|
|
28
|
+
}
|
|
29
|
+
|
|
19
30
|
#pragma mark - getUserMedia
|
|
20
31
|
|
|
21
32
|
/**
|
|
@@ -77,12 +88,14 @@
|
|
|
77
88
|
NSDictionary *settings = @{};
|
|
78
89
|
if ([track.kind isEqualToString:@"video"]) {
|
|
79
90
|
RTCVideoTrack *videoTrack = (RTCVideoTrack *)track;
|
|
80
|
-
if ([videoTrack.captureController isKindOfClass:[
|
|
81
|
-
|
|
82
|
-
AVCaptureDeviceFormat *format = vcc.selectedFormat;
|
|
83
|
-
CMVideoDimensions dimensions = CMVideoFormatDescriptionGetDimensions(format.formatDescription);
|
|
84
|
-
settings = @{@"height" : @(dimensions.height), @"width" : @(dimensions.width), @"frameRate" : @(30)};
|
|
91
|
+
if ([videoTrack.captureController isKindOfClass:[CaptureController class]]) {
|
|
92
|
+
settings = [videoTrack.captureController getSettings];
|
|
85
93
|
}
|
|
94
|
+
} else if ([track.kind isEqualToString:@"audio"]) {
|
|
95
|
+
settings = @{
|
|
96
|
+
@"deviceId" : @"audio",
|
|
97
|
+
@"groupId" : @"",
|
|
98
|
+
};
|
|
86
99
|
}
|
|
87
100
|
|
|
88
101
|
[trackInfos addObject:@{
|
|
@@ -116,6 +129,8 @@
|
|
|
116
129
|
RTCCameraVideoCapturer *videoCapturer = [[RTCCameraVideoCapturer alloc] initWithDelegate:videoSource];
|
|
117
130
|
VideoCaptureController *videoCaptureController =
|
|
118
131
|
[[VideoCaptureController alloc] initWithCapturer:videoCapturer andConstraints:constraints[@"video"]];
|
|
132
|
+
videoCaptureController.enableMultitaskingCameraAccess =
|
|
133
|
+
[WebRTCModuleOptions sharedInstance].enableMultitaskingCameraAccess;
|
|
119
134
|
videoTrack.captureController = videoCaptureController;
|
|
120
135
|
[videoCaptureController startCapture];
|
|
121
136
|
#endif
|
|
@@ -186,10 +201,8 @@ RCT_EXPORT_METHOD(getDisplayMedia : (RCTPromiseResolveBlock)resolve rejecter : (
|
|
|
186
201
|
* if audio permission was not granted, there will be no "audio" key in
|
|
187
202
|
* the constraints dictionary.
|
|
188
203
|
*/
|
|
189
|
-
RCT_EXPORT_METHOD(getUserMedia
|
|
190
|
-
|
|
191
|
-
: (RCTResponseSenderBlock)successCallback errorCallback
|
|
192
|
-
: (RCTResponseSenderBlock)errorCallback) {
|
|
204
|
+
RCT_EXPORT_METHOD(getUserMedia : (NSDictionary *)constraints successCallback : (RCTResponseSenderBlock)
|
|
205
|
+
successCallback errorCallback : (RCTResponseSenderBlock)errorCallback) {
|
|
193
206
|
#if TARGET_OS_TV
|
|
194
207
|
errorCallback(@[ @"PlatformNotSupported", @"getUserMedia is not supported on tvOS." ]);
|
|
195
208
|
return;
|
|
@@ -234,10 +247,14 @@ RCT_EXPORT_METHOD(getUserMedia
|
|
|
234
247
|
NSDictionary *settings = @{};
|
|
235
248
|
if ([track.kind isEqualToString:@"video"]) {
|
|
236
249
|
RTCVideoTrack *videoTrack = (RTCVideoTrack *)track;
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
250
|
+
if ([videoTrack.captureController isKindOfClass:[CaptureController class]]) {
|
|
251
|
+
settings = [videoTrack.captureController getSettings];
|
|
252
|
+
}
|
|
253
|
+
} else if ([track.kind isEqualToString:@"audio"]) {
|
|
254
|
+
settings = @{
|
|
255
|
+
@"deviceId" : @"audio",
|
|
256
|
+
@"groupId" : @"",
|
|
257
|
+
};
|
|
241
258
|
}
|
|
242
259
|
|
|
243
260
|
[tracks addObject:@{
|
|
@@ -263,15 +280,22 @@ RCT_EXPORT_METHOD(enumerateDevices : (RCTResponseSenderBlock)callback) {
|
|
|
263
280
|
#else
|
|
264
281
|
NSMutableArray *devices = [NSMutableArray array];
|
|
265
282
|
NSMutableArray *deviceTypes = [NSMutableArray array];
|
|
266
|
-
[deviceTypes addObjectsFromArray:@[
|
|
283
|
+
[deviceTypes addObjectsFromArray:@[
|
|
284
|
+
AVCaptureDeviceTypeBuiltInWideAngleCamera,
|
|
285
|
+
AVCaptureDeviceTypeBuiltInUltraWideCamera,
|
|
286
|
+
AVCaptureDeviceTypeBuiltInTelephotoCamera,
|
|
287
|
+
AVCaptureDeviceTypeBuiltInDualCamera,
|
|
288
|
+
AVCaptureDeviceTypeBuiltInDualWideCamera,
|
|
289
|
+
AVCaptureDeviceTypeBuiltInTripleCamera
|
|
290
|
+
]];
|
|
267
291
|
if (@available(macos 14.0, ios 17.0, tvos 17.0, *)) {
|
|
268
292
|
[deviceTypes addObject:AVCaptureDeviceTypeExternal];
|
|
269
293
|
}
|
|
270
|
-
AVCaptureDeviceDiscoverySession *
|
|
294
|
+
AVCaptureDeviceDiscoverySession *videoDevicesSession =
|
|
271
295
|
[AVCaptureDeviceDiscoverySession discoverySessionWithDeviceTypes:deviceTypes
|
|
272
296
|
mediaType:AVMediaTypeVideo
|
|
273
297
|
position:AVCaptureDevicePositionUnspecified];
|
|
274
|
-
for (AVCaptureDevice *device in
|
|
298
|
+
for (AVCaptureDevice *device in videoDevicesSession.devices) {
|
|
275
299
|
NSString *position = @"unknown";
|
|
276
300
|
if (device.position == AVCaptureDevicePositionBack) {
|
|
277
301
|
position = @"environment";
|
|
@@ -282,7 +306,7 @@ RCT_EXPORT_METHOD(enumerateDevices : (RCTResponseSenderBlock)callback) {
|
|
|
282
306
|
if (device.localizedName != nil) {
|
|
283
307
|
label = device.localizedName;
|
|
284
308
|
}
|
|
285
|
-
|
|
309
|
+
|
|
286
310
|
[devices addObject:@{
|
|
287
311
|
@"facing" : position,
|
|
288
312
|
@"deviceId" : device.uniqueID,
|
|
@@ -316,10 +340,8 @@ RCT_EXPORT_METHOD(mediaStreamCreate : (nonnull NSString *)streamID) {
|
|
|
316
340
|
self.localStreams[streamID] = mediaStream;
|
|
317
341
|
}
|
|
318
342
|
|
|
319
|
-
RCT_EXPORT_METHOD(mediaStreamAddTrack
|
|
320
|
-
|
|
321
|
-
: (nonnull NSNumber *)pcId
|
|
322
|
-
: (nonnull NSString *)trackID) {
|
|
343
|
+
RCT_EXPORT_METHOD(mediaStreamAddTrack : (nonnull NSString *)streamID : (nonnull NSNumber *)pcId : (nonnull NSString *)
|
|
344
|
+
trackID) {
|
|
323
345
|
RTCMediaStream *mediaStream = self.localStreams[streamID];
|
|
324
346
|
if (mediaStream == nil) {
|
|
325
347
|
return;
|
|
@@ -337,10 +359,8 @@ RCT_EXPORT_METHOD(mediaStreamAddTrack
|
|
|
337
359
|
}
|
|
338
360
|
}
|
|
339
361
|
|
|
340
|
-
RCT_EXPORT_METHOD(mediaStreamRemoveTrack
|
|
341
|
-
|
|
342
|
-
: (nonnull NSNumber *)pcId
|
|
343
|
-
: (nonnull NSString *)trackID) {
|
|
362
|
+
RCT_EXPORT_METHOD(mediaStreamRemoveTrack : (nonnull NSString *)streamID : (nonnull NSNumber *)
|
|
363
|
+
pcId : (nonnull NSString *)trackID) {
|
|
344
364
|
RTCMediaStream *mediaStream = self.localStreams[streamID];
|
|
345
365
|
if (mediaStream == nil) {
|
|
346
366
|
return;
|
|
@@ -397,14 +417,33 @@ RCT_EXPORT_METHOD(mediaStreamTrackSetEnabled : (nonnull NSNumber *)pcId : (nonnu
|
|
|
397
417
|
#endif
|
|
398
418
|
}
|
|
399
419
|
|
|
400
|
-
RCT_EXPORT_METHOD(
|
|
420
|
+
RCT_EXPORT_METHOD(mediaStreamTrackApplyConstraints : (nonnull NSString *)trackID : (NSDictionary *)
|
|
421
|
+
constraints : (RCTPromiseResolveBlock)resolve : (RCTPromiseRejectBlock)reject) {
|
|
401
422
|
#if TARGET_OS_TV
|
|
423
|
+
reject(@"unsupported_platform", @"tvOS is not supported", nil);
|
|
402
424
|
return;
|
|
403
425
|
#else
|
|
404
426
|
RTCMediaStreamTrack *track = self.localTracks[trackID];
|
|
405
427
|
if (track) {
|
|
406
|
-
|
|
407
|
-
|
|
428
|
+
if ([track.kind isEqualToString:@"video"]) {
|
|
429
|
+
RTCVideoTrack *videoTrack = (RTCVideoTrack *)track;
|
|
430
|
+
if ([videoTrack.captureController isKindOfClass:[CaptureController class]]) {
|
|
431
|
+
CaptureController *vcc = (CaptureController *)videoTrack.captureController;
|
|
432
|
+
NSError *error = nil;
|
|
433
|
+
[vcc applyConstraints:constraints error:&error];
|
|
434
|
+
if (error) {
|
|
435
|
+
reject(@"E_INVALID", error.localizedDescription, error);
|
|
436
|
+
} else {
|
|
437
|
+
resolve([vcc getSettings]);
|
|
438
|
+
}
|
|
439
|
+
}
|
|
440
|
+
} else {
|
|
441
|
+
RCTLogWarn(@"mediaStreamTrackApplyConstraints() track is not video");
|
|
442
|
+
reject(@"E_INVALID", @"Can't apply constraints on audio tracks", nil);
|
|
443
|
+
}
|
|
444
|
+
} else {
|
|
445
|
+
RCTLogWarn(@"mediaStreamTrackApplyConstraints() track is null");
|
|
446
|
+
reject(@"E_INVALID", @"Could not get track", nil);
|
|
408
447
|
}
|
|
409
448
|
#endif
|
|
410
449
|
}
|
|
@@ -417,6 +456,32 @@ RCT_EXPORT_METHOD(mediaStreamTrackSetVolume : (nonnull NSNumber *)pcId : (nonnul
|
|
|
417
456
|
}
|
|
418
457
|
}
|
|
419
458
|
|
|
459
|
+
RCT_EXPORT_METHOD(mediaStreamTrackSetVideoEffects : (nonnull NSString *)trackID names : (nonnull NSArray<NSString *> *)
|
|
460
|
+
names) {
|
|
461
|
+
RTCMediaStreamTrack *track = self.localTracks[trackID];
|
|
462
|
+
if (track == nil) {
|
|
463
|
+
return;
|
|
464
|
+
}
|
|
465
|
+
|
|
466
|
+
RTCVideoTrack *videoTrack = (RTCVideoTrack *)track;
|
|
467
|
+
RTCVideoSource *videoSource = videoTrack.source;
|
|
468
|
+
|
|
469
|
+
NSMutableArray *processors = [[NSMutableArray alloc] init];
|
|
470
|
+
for (NSString *name in names) {
|
|
471
|
+
NSObject<VideoFrameProcessorDelegate> *processor = [ProcessorProvider getProcessor:name];
|
|
472
|
+
if (processor != nil) {
|
|
473
|
+
[processors addObject:processor];
|
|
474
|
+
}
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
self.videoEffectProcessor = [[VideoEffectProcessor alloc] initWithProcessors:processors videoSource:videoSource];
|
|
478
|
+
|
|
479
|
+
VideoCaptureController *vcc = (VideoCaptureController *)videoTrack.captureController;
|
|
480
|
+
RTCVideoCapturer *capturer = vcc.capturer;
|
|
481
|
+
|
|
482
|
+
capturer.delegate = self.videoEffectProcessor;
|
|
483
|
+
}
|
|
484
|
+
|
|
420
485
|
#pragma mark - Helpers
|
|
421
486
|
|
|
422
487
|
- (RTCMediaStreamTrack *)trackForId:(nonnull NSString *)trackId pcId:(nonnull NSNumber *)pcId {
|
|
@@ -73,9 +73,8 @@ int _transceiverNextId = 0;
|
|
|
73
73
|
* This method is synchronous and blocking. This is done so we can implement createDataChannel
|
|
74
74
|
* in the same way (synchronous) since the peer connection needs to exist before.
|
|
75
75
|
*/
|
|
76
|
-
RCT_EXPORT_BLOCKING_SYNCHRONOUS_METHOD(peerConnectionInit
|
|
77
|
-
|
|
78
|
-
: (nonnull NSNumber *)objectID) {
|
|
76
|
+
RCT_EXPORT_BLOCKING_SYNCHRONOUS_METHOD(peerConnectionInit : (RTCConfiguration *)
|
|
77
|
+
configuration objectID : (nonnull NSNumber *)objectID) {
|
|
79
78
|
__block BOOL ret = YES;
|
|
80
79
|
|
|
81
80
|
dispatch_sync(self.workerQueue, ^{
|
|
@@ -102,9 +101,8 @@ RCT_EXPORT_BLOCKING_SYNCHRONOUS_METHOD(peerConnectionInit
|
|
|
102
101
|
return @(ret);
|
|
103
102
|
}
|
|
104
103
|
|
|
105
|
-
RCT_EXPORT_METHOD(peerConnectionSetConfiguration
|
|
106
|
-
|
|
107
|
-
: (nonnull NSNumber *)objectID) {
|
|
104
|
+
RCT_EXPORT_METHOD(peerConnectionSetConfiguration : (RTCConfiguration *)configuration objectID : (nonnull NSNumber *)
|
|
105
|
+
objectID) {
|
|
108
106
|
RTCPeerConnection *peerConnection = self.peerConnections[objectID];
|
|
109
107
|
if (!peerConnection) {
|
|
110
108
|
return;
|
|
@@ -112,11 +110,8 @@ RCT_EXPORT_METHOD(peerConnectionSetConfiguration
|
|
|
112
110
|
[peerConnection setConfiguration:configuration];
|
|
113
111
|
}
|
|
114
112
|
|
|
115
|
-
RCT_EXPORT_METHOD(peerConnectionCreateOffer
|
|
116
|
-
|
|
117
|
-
: (NSDictionary *)options resolver
|
|
118
|
-
: (RCTPromiseResolveBlock)resolve rejecter
|
|
119
|
-
: (RCTPromiseRejectBlock)reject) {
|
|
113
|
+
RCT_EXPORT_METHOD(peerConnectionCreateOffer : (nonnull NSNumber *)objectID options : (NSDictionary *)
|
|
114
|
+
options resolver : (RCTPromiseResolveBlock)resolve rejecter : (RCTPromiseRejectBlock)reject) {
|
|
120
115
|
RTCPeerConnection *peerConnection = self.peerConnections[objectID];
|
|
121
116
|
if (!peerConnection) {
|
|
122
117
|
reject(@"E_INVALID", @"PeerConnection not found", nil);
|
|
@@ -160,11 +155,8 @@ RCT_EXPORT_METHOD(peerConnectionCreateOffer
|
|
|
160
155
|
[peerConnection offerForConstraints:constraints completionHandler:handler];
|
|
161
156
|
}
|
|
162
157
|
|
|
163
|
-
RCT_EXPORT_METHOD(peerConnectionCreateAnswer
|
|
164
|
-
|
|
165
|
-
: (NSDictionary *)options resolver
|
|
166
|
-
: (RCTPromiseResolveBlock)resolve rejecter
|
|
167
|
-
: (RCTPromiseRejectBlock)reject) {
|
|
158
|
+
RCT_EXPORT_METHOD(peerConnectionCreateAnswer : (nonnull NSNumber *)objectID options : (NSDictionary *)
|
|
159
|
+
options resolver : (RCTPromiseResolveBlock)resolve rejecter : (RCTPromiseRejectBlock)reject) {
|
|
168
160
|
RTCPeerConnection *peerConnection = self.peerConnections[objectID];
|
|
169
161
|
if (!peerConnection) {
|
|
170
162
|
reject(@"E_INVALID", @"PeerConnection not found", nil);
|
|
@@ -192,11 +184,8 @@ RCT_EXPORT_METHOD(peerConnectionCreateAnswer
|
|
|
192
184
|
[peerConnection answerForConstraints:constraints completionHandler:handler];
|
|
193
185
|
}
|
|
194
186
|
|
|
195
|
-
RCT_EXPORT_METHOD(peerConnectionSetLocalDescription
|
|
196
|
-
|
|
197
|
-
: (RTCSessionDescription *)desc resolver
|
|
198
|
-
: (RCTPromiseResolveBlock)resolve rejecter
|
|
199
|
-
: (RCTPromiseRejectBlock)reject) {
|
|
187
|
+
RCT_EXPORT_METHOD(peerConnectionSetLocalDescription : (nonnull NSNumber *)objectID desc : (RTCSessionDescription *)
|
|
188
|
+
desc resolver : (RCTPromiseResolveBlock)resolve rejecter : (RCTPromiseRejectBlock)reject) {
|
|
200
189
|
RTCPeerConnection *peerConnection = self.peerConnections[objectID];
|
|
201
190
|
if (!peerConnection) {
|
|
202
191
|
reject(@"E_INVALID", @"PeerConnection not found", nil);
|
|
@@ -231,11 +220,8 @@ RCT_EXPORT_METHOD(peerConnectionSetLocalDescription
|
|
|
231
220
|
}
|
|
232
221
|
}
|
|
233
222
|
|
|
234
|
-
RCT_EXPORT_METHOD(peerConnectionSetRemoteDescription
|
|
235
|
-
|
|
236
|
-
: (RTCSessionDescription *)desc resolver
|
|
237
|
-
: (RCTPromiseResolveBlock)resolve rejecter
|
|
238
|
-
: (RCTPromiseRejectBlock)reject) {
|
|
223
|
+
RCT_EXPORT_METHOD(peerConnectionSetRemoteDescription : (nonnull NSNumber *)objectID desc : (RTCSessionDescription *)
|
|
224
|
+
desc resolver : (RCTPromiseResolveBlock)resolve rejecter : (RCTPromiseRejectBlock)reject) {
|
|
239
225
|
RTCPeerConnection *peerConnection = self.peerConnections[objectID];
|
|
240
226
|
if (!peerConnection) {
|
|
241
227
|
reject(@"E_INVALID", @"PeerConnection not found", nil);
|
|
@@ -283,11 +269,8 @@ RCT_EXPORT_METHOD(peerConnectionSetRemoteDescription
|
|
|
283
269
|
[peerConnection setRemoteDescription:desc completionHandler:handler];
|
|
284
270
|
}
|
|
285
271
|
|
|
286
|
-
RCT_EXPORT_METHOD(peerConnectionAddICECandidate
|
|
287
|
-
|
|
288
|
-
: (RTCIceCandidate *)candidate resolver
|
|
289
|
-
: (RCTPromiseResolveBlock)resolve rejecter
|
|
290
|
-
: (RCTPromiseRejectBlock)reject) {
|
|
272
|
+
RCT_EXPORT_METHOD(peerConnectionAddICECandidate : (nonnull NSNumber *)objectID candidate : (RTCIceCandidate *)
|
|
273
|
+
candidate resolver : (RCTPromiseResolveBlock)resolve rejecter : (RCTPromiseRejectBlock)reject) {
|
|
291
274
|
RTCPeerConnection *peerConnection = self.peerConnections[objectID];
|
|
292
275
|
if (!peerConnection) {
|
|
293
276
|
reject(@"E_INVALID", @"PeerConnection not found", nil);
|
|
@@ -348,10 +331,8 @@ RCT_EXPORT_METHOD(peerConnectionDispose : (nonnull NSNumber *)objectID) {
|
|
|
348
331
|
[self.peerConnections removeObjectForKey:objectID];
|
|
349
332
|
}
|
|
350
333
|
|
|
351
|
-
RCT_EXPORT_METHOD(peerConnectionGetStats
|
|
352
|
-
|
|
353
|
-
: (RCTPromiseResolveBlock)resolve rejecter
|
|
354
|
-
: (RCTPromiseRejectBlock)reject) {
|
|
334
|
+
RCT_EXPORT_METHOD(peerConnectionGetStats : (nonnull NSNumber *)objectID resolver : (RCTPromiseResolveBlock)
|
|
335
|
+
resolve rejecter : (RCTPromiseRejectBlock)reject) {
|
|
355
336
|
RTCPeerConnection *peerConnection = self.peerConnections[objectID];
|
|
356
337
|
if (!peerConnection) {
|
|
357
338
|
RCTLogWarn(@"PeerConnection %@ not found in peerConnectionGetStats()", objectID);
|
|
@@ -364,11 +345,8 @@ RCT_EXPORT_METHOD(peerConnectionGetStats
|
|
|
364
345
|
}];
|
|
365
346
|
}
|
|
366
347
|
|
|
367
|
-
RCT_EXPORT_METHOD(receiverGetStats
|
|
368
|
-
|
|
369
|
-
: (nonnull NSString *)receiverId resolver
|
|
370
|
-
: (RCTPromiseResolveBlock)resolve rejecter
|
|
371
|
-
: (RCTPromiseRejectBlock)reject) {
|
|
348
|
+
RCT_EXPORT_METHOD(receiverGetStats : (nonnull NSNumber *)pcId receiverId : (nonnull NSString *)
|
|
349
|
+
receiverId resolver : (RCTPromiseResolveBlock)resolve rejecter : (RCTPromiseRejectBlock)reject) {
|
|
372
350
|
RTCPeerConnection *peerConnection = self.peerConnections[pcId];
|
|
373
351
|
if (!peerConnection) {
|
|
374
352
|
RCTLogWarn(@"PeerConnection %@ not found in receiverGetStats()", pcId);
|
|
@@ -396,11 +374,8 @@ RCT_EXPORT_METHOD(receiverGetStats
|
|
|
396
374
|
}];
|
|
397
375
|
}
|
|
398
376
|
|
|
399
|
-
RCT_EXPORT_METHOD(senderGetStats
|
|
400
|
-
|
|
401
|
-
: (nonnull NSString *)senderId resolver
|
|
402
|
-
: (RCTPromiseResolveBlock)resolve rejecter
|
|
403
|
-
: (RCTPromiseRejectBlock)reject) {
|
|
377
|
+
RCT_EXPORT_METHOD(senderGetStats : (nonnull NSNumber *)pcId senderId : (nonnull NSString *)
|
|
378
|
+
senderId resolver : (RCTPromiseResolveBlock)resolve rejecter : (RCTPromiseRejectBlock)reject) {
|
|
404
379
|
RTCPeerConnection *peerConnection = self.peerConnections[pcId];
|
|
405
380
|
if (!peerConnection) {
|
|
406
381
|
RCTLogWarn(@"PeerConnection %@ not found in senderGetStats()", pcId);
|
|
@@ -437,10 +412,8 @@ RCT_EXPORT_METHOD(peerConnectionRestartIce : (nonnull NSNumber *)objectID) {
|
|
|
437
412
|
[peerConnection restartIce];
|
|
438
413
|
}
|
|
439
414
|
|
|
440
|
-
RCT_EXPORT_BLOCKING_SYNCHRONOUS_METHOD(peerConnectionAddTrack
|
|
441
|
-
|
|
442
|
-
: (NSString *)trackId options
|
|
443
|
-
: (NSDictionary *)options) {
|
|
415
|
+
RCT_EXPORT_BLOCKING_SYNCHRONOUS_METHOD(peerConnectionAddTrack : (nonnull NSNumber *)objectID trackId : (NSString *)
|
|
416
|
+
trackId options : (NSDictionary *)options) {
|
|
444
417
|
__block id params = nil;
|
|
445
418
|
|
|
446
419
|
dispatch_sync(self.workerQueue, ^{
|
|
@@ -478,9 +451,8 @@ RCT_EXPORT_BLOCKING_SYNCHRONOUS_METHOD(peerConnectionAddTrack
|
|
|
478
451
|
return params;
|
|
479
452
|
}
|
|
480
453
|
|
|
481
|
-
RCT_EXPORT_BLOCKING_SYNCHRONOUS_METHOD(peerConnectionAddTransceiver
|
|
482
|
-
|
|
483
|
-
: (NSDictionary *)options) {
|
|
454
|
+
RCT_EXPORT_BLOCKING_SYNCHRONOUS_METHOD(peerConnectionAddTransceiver : (nonnull NSNumber *)
|
|
455
|
+
objectID options : (NSDictionary *)options) {
|
|
484
456
|
__block id params = nil;
|
|
485
457
|
|
|
486
458
|
dispatch_sync(self.workerQueue, ^{
|
|
@@ -536,9 +508,8 @@ RCT_EXPORT_BLOCKING_SYNCHRONOUS_METHOD(peerConnectionAddTransceiver
|
|
|
536
508
|
return params;
|
|
537
509
|
}
|
|
538
510
|
|
|
539
|
-
RCT_EXPORT_BLOCKING_SYNCHRONOUS_METHOD(peerConnectionRemoveTrack
|
|
540
|
-
|
|
541
|
-
: (nonnull NSString *)senderId) {
|
|
511
|
+
RCT_EXPORT_BLOCKING_SYNCHRONOUS_METHOD(peerConnectionRemoveTrack : (nonnull NSNumber *)
|
|
512
|
+
objectID senderId : (nonnull NSString *)senderId) {
|
|
542
513
|
__block BOOL ret = NO;
|
|
543
514
|
|
|
544
515
|
dispatch_sync(self.workerQueue, ^{
|
|
@@ -34,12 +34,8 @@ RCT_EXPORT_BLOCKING_SYNCHRONOUS_METHOD(receiverGetCapabilities : (NSString *)kin
|
|
|
34
34
|
return params;
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
-
RCT_EXPORT_METHOD(senderReplaceTrack
|
|
38
|
-
|
|
39
|
-
: (NSString *)senderId trackId
|
|
40
|
-
: (NSString *)trackId resolver
|
|
41
|
-
: (RCTPromiseResolveBlock)resolve rejecter
|
|
42
|
-
: (RCTPromiseRejectBlock)reject) {
|
|
37
|
+
RCT_EXPORT_METHOD(senderReplaceTrack : (nonnull NSNumber *)objectID senderId : (NSString *)senderId trackId : (
|
|
38
|
+
NSString *)trackId resolver : (RCTPromiseResolveBlock)resolve rejecter : (RCTPromiseRejectBlock)reject) {
|
|
43
39
|
RTCPeerConnection *peerConnection = self.peerConnections[objectID];
|
|
44
40
|
|
|
45
41
|
if (peerConnection == nil) {
|
|
@@ -66,12 +62,8 @@ RCT_EXPORT_METHOD(senderReplaceTrack
|
|
|
66
62
|
resolve(@true);
|
|
67
63
|
}
|
|
68
64
|
|
|
69
|
-
RCT_EXPORT_METHOD(senderSetParameters
|
|
70
|
-
|
|
71
|
-
: (NSString *)senderId options
|
|
72
|
-
: (NSDictionary *)options resolver
|
|
73
|
-
: (RCTPromiseResolveBlock)resolve rejecter
|
|
74
|
-
: (RCTPromiseRejectBlock)reject) {
|
|
65
|
+
RCT_EXPORT_METHOD(senderSetParameters : (nonnull NSNumber *)objectID senderId : (NSString *)senderId options : (
|
|
66
|
+
NSDictionary *)options resolver : (RCTPromiseResolveBlock)resolve rejecter : (RCTPromiseRejectBlock)reject) {
|
|
75
67
|
RTCPeerConnection *peerConnection = self.peerConnections[objectID];
|
|
76
68
|
|
|
77
69
|
if (peerConnection == nil) {
|
|
@@ -101,12 +93,8 @@ RCT_EXPORT_METHOD(senderSetParameters
|
|
|
101
93
|
resolve([SerializeUtils parametersToJSON:sender.parameters]);
|
|
102
94
|
}
|
|
103
95
|
|
|
104
|
-
RCT_EXPORT_METHOD(transceiverSetDirection
|
|
105
|
-
|
|
106
|
-
: (NSString *)senderId direction
|
|
107
|
-
: (NSString *)direction resolver
|
|
108
|
-
: (RCTPromiseResolveBlock)resolve rejecter
|
|
109
|
-
: (RCTPromiseRejectBlock)reject) {
|
|
96
|
+
RCT_EXPORT_METHOD(transceiverSetDirection : (nonnull NSNumber *)objectID senderId : (NSString *)senderId direction : (
|
|
97
|
+
NSString *)direction resolver : (RCTPromiseResolveBlock)resolve rejecter : (RCTPromiseRejectBlock)reject) {
|
|
110
98
|
RTCPeerConnection *peerConnection = self.peerConnections[objectID];
|
|
111
99
|
|
|
112
100
|
if (peerConnection == nil) {
|
|
@@ -139,11 +127,8 @@ RCT_EXPORT_METHOD(transceiverSetDirection
|
|
|
139
127
|
}
|
|
140
128
|
}
|
|
141
129
|
|
|
142
|
-
RCT_EXPORT_METHOD(transceiverStop
|
|
143
|
-
|
|
144
|
-
: (NSString *)senderId resolver
|
|
145
|
-
: (RCTPromiseResolveBlock)resolve rejecter
|
|
146
|
-
: (RCTPromiseRejectBlock)reject) {
|
|
130
|
+
RCT_EXPORT_METHOD(transceiverStop : (nonnull NSNumber *)objectID senderId : (NSString *)
|
|
131
|
+
senderId resolver : (RCTPromiseResolveBlock)resolve rejecter : (RCTPromiseRejectBlock)reject) {
|
|
147
132
|
RTCPeerConnection *peerConnection = self.peerConnections[objectID];
|
|
148
133
|
|
|
149
134
|
if (peerConnection == nil) {
|
|
@@ -171,10 +156,8 @@ RCT_EXPORT_METHOD(transceiverStop
|
|
|
171
156
|
resolve(@true);
|
|
172
157
|
}
|
|
173
158
|
|
|
174
|
-
RCT_EXPORT_BLOCKING_SYNCHRONOUS_METHOD(transceiverSetCodecPreferences
|
|
175
|
-
|
|
176
|
-
: (NSString *)senderId codecPreferences
|
|
177
|
-
: (NSArray *)codecPreferences) {
|
|
159
|
+
RCT_EXPORT_BLOCKING_SYNCHRONOUS_METHOD(transceiverSetCodecPreferences : (nonnull NSNumber *)objectID senderId : (
|
|
160
|
+
NSString *)senderId codecPreferences : (NSArray *)codecPreferences) {
|
|
178
161
|
RTCPeerConnection *peerConnection = self.peerConnections[objectID];
|
|
179
162
|
|
|
180
163
|
if (peerConnection == nil) {
|
|
@@ -219,7 +202,7 @@ RCT_EXPORT_BLOCKING_SYNCHRONOUS_METHOD(transceiverSetCodecPreferences
|
|
|
219
202
|
}];
|
|
220
203
|
}
|
|
221
204
|
}
|
|
222
|
-
|
|
205
|
+
|
|
223
206
|
// Convert JSON codec capabilities to the actual objects.
|
|
224
207
|
// Codec preferences is order sensitive.
|
|
225
208
|
NSMutableArray *codecsToSet = [NSMutableArray new];
|
|
@@ -10,6 +10,7 @@ NS_ASSUME_NONNULL_BEGIN
|
|
|
10
10
|
@property(nonatomic, strong, nullable) id<RTCAudioDevice> audioDevice;
|
|
11
11
|
@property(nonatomic, strong, nullable) NSDictionary *fieldTrials;
|
|
12
12
|
@property(nonatomic, assign) RTCLoggingSeverity loggingSeverity;
|
|
13
|
+
@property(nonatomic, assign) BOOL enableMultitaskingCameraAccess;
|
|
13
14
|
|
|
14
15
|
#pragma mark - This class is a singleton
|
|
15
16
|
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
#import "VideoFrameProcessor.h"
|
|
2
|
+
|
|
3
|
+
@interface ProcessorProvider : NSObject
|
|
4
|
+
|
|
5
|
+
+ (NSObject<VideoFrameProcessorDelegate> *)getProcessor:(NSString *)name;
|
|
6
|
+
+ (void)addProcessor:(NSObject<VideoFrameProcessorDelegate> *)processor forName:(NSString *)name;
|
|
7
|
+
+ (void)removeProcessor:(NSString *)name;
|
|
8
|
+
|
|
9
|
+
@end
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
#import "ProcessorProvider.h"
|
|
2
|
+
|
|
3
|
+
@implementation ProcessorProvider
|
|
4
|
+
|
|
5
|
+
static NSMutableDictionary<NSString *, NSObject<VideoFrameProcessorDelegate> *> *processorMap;
|
|
6
|
+
|
|
7
|
+
+ (void)initialize {
|
|
8
|
+
processorMap = [[NSMutableDictionary alloc] init];
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
+ (NSObject<VideoFrameProcessorDelegate> *)getProcessor:(NSString *)name {
|
|
12
|
+
return [processorMap objectForKey:name];
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
+ (void)addProcessor:(NSObject<VideoFrameProcessorDelegate> *)processor forName:(NSString *)name {
|
|
16
|
+
[processorMap setObject:processor forKey:name];
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
+ (void)removeProcessor:(NSString *)name {
|
|
20
|
+
[processorMap removeObjectForKey:name];
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
@end
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
#import <WebRTC/RTCVideoSource.h>
|
|
2
|
+
|
|
3
|
+
#import "VideoFrameProcessor.h"
|
|
4
|
+
|
|
5
|
+
@interface VideoEffectProcessor : NSObject<RTCVideoCapturerDelegate>
|
|
6
|
+
|
|
7
|
+
@property(nonatomic, strong) NSArray<NSObject<VideoFrameProcessorDelegate> *> *videoFrameProcessors;
|
|
8
|
+
@property(nonatomic, strong) RTCVideoSource *videoSource;
|
|
9
|
+
|
|
10
|
+
- (instancetype)initWithProcessors:(NSArray<NSObject<VideoFrameProcessorDelegate> *> *)videoFrameProcessors
|
|
11
|
+
videoSource:(RTCVideoSource *)videoSource;
|
|
12
|
+
|
|
13
|
+
@end
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
#import <WebRTC/RTCVideoCapturer.h>
|
|
2
|
+
|
|
3
|
+
#import "VideoEffectProcessor.h"
|
|
4
|
+
|
|
5
|
+
@implementation VideoEffectProcessor
|
|
6
|
+
|
|
7
|
+
- (instancetype)initWithProcessors:(NSArray<NSObject<VideoFrameProcessorDelegate> *> *)videoFrameProcessors
|
|
8
|
+
videoSource:(RTCVideoSource *)videoSource {
|
|
9
|
+
self = [super init];
|
|
10
|
+
_videoFrameProcessors = videoFrameProcessors;
|
|
11
|
+
_videoSource = videoSource;
|
|
12
|
+
return self;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
- (void)capturer:(nonnull RTCVideoCapturer *)capturer didCaptureVideoFrame:(nonnull RTCVideoFrame *)frame {
|
|
16
|
+
RTCVideoFrame *processedFrame = frame;
|
|
17
|
+
for (NSObject<VideoFrameProcessorDelegate> *processor in _videoFrameProcessors) {
|
|
18
|
+
processedFrame = [processor capturer:capturer didCaptureVideoFrame:processedFrame];
|
|
19
|
+
}
|
|
20
|
+
[self.videoSource capturer:capturer didCaptureVideoFrame:processedFrame];
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
@end
|
|
@@ -24,6 +24,7 @@
|
|
|
24
24
|
4EE3A8D425B841DD00FAA24A /* ScreenCapturer.m in Sources */ = {isa = PBXBuildFile; fileRef = 4EE3A8CD25B841DD00FAA24A /* ScreenCapturer.m */; };
|
|
25
25
|
D3FF699919D2664B25C9D458 /* Pods_RCTWebRTC.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A20F721AD842563B66292D5B /* Pods_RCTWebRTC.framework */; };
|
|
26
26
|
D74EF94829652169000742E1 /* TrackCapturerEventsEmitter.m in Sources */ = {isa = PBXBuildFile; fileRef = D74EF94629652169000742E1 /* TrackCapturerEventsEmitter.m */; };
|
|
27
|
+
D7F0711E2C6DC91F0031F594 /* WebRTCModule+RTCAudioSession.m in Sources */ = {isa = PBXBuildFile; fileRef = D7F0711D2C6DC91F0031F594 /* WebRTCModule+RTCAudioSession.m */; };
|
|
27
28
|
DEC96577264176C10052DB35 /* DataChannelWrapper.m in Sources */ = {isa = PBXBuildFile; fileRef = DEC96576264176C10052DB35 /* DataChannelWrapper.m */; };
|
|
28
29
|
/* End PBXBuildFile section */
|
|
29
30
|
|
|
@@ -75,6 +76,7 @@
|
|
|
75
76
|
D74EF94529652148000742E1 /* CapturerEventsDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = CapturerEventsDelegate.h; path = RCTWebRTC/CapturerEventsDelegate.h; sourceTree = SOURCE_ROOT; };
|
|
76
77
|
D74EF94629652169000742E1 /* TrackCapturerEventsEmitter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = TrackCapturerEventsEmitter.m; path = RCTWebRTC/TrackCapturerEventsEmitter.m; sourceTree = SOURCE_ROOT; };
|
|
77
78
|
D74EF94729652169000742E1 /* TrackCapturerEventsEmitter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TrackCapturerEventsEmitter.h; path = RCTWebRTC/TrackCapturerEventsEmitter.h; sourceTree = SOURCE_ROOT; };
|
|
79
|
+
D7F0711D2C6DC91F0031F594 /* WebRTCModule+RTCAudioSession.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = "WebRTCModule+RTCAudioSession.m"; path = "RCTWebRTC/WebRTCModule+RTCAudioSession.m"; sourceTree = SOURCE_ROOT; };
|
|
78
80
|
D7F99C122938F4E0000A2450 /* WebRTCModule+RTCMediaStream.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "WebRTCModule+RTCMediaStream.h"; path = "RCTWebRTC/WebRTCModule+RTCMediaStream.h"; sourceTree = SOURCE_ROOT; };
|
|
79
81
|
DEC96576264176C10052DB35 /* DataChannelWrapper.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = DataChannelWrapper.m; path = RCTWebRTC/DataChannelWrapper.m; sourceTree = "<group>"; };
|
|
80
82
|
DEC96579264176DF0052DB35 /* DataChannelWrapper.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = DataChannelWrapper.h; path = RCTWebRTC/DataChannelWrapper.h; sourceTree = "<group>"; };
|
|
@@ -131,6 +133,7 @@
|
|
|
131
133
|
4EE3A8AF25B8413200FAA24A /* VideoCaptureController.h */,
|
|
132
134
|
0BDDA6DF20C18B6B00B38B45 /* VideoCaptureController.m */,
|
|
133
135
|
4EE3A8B525B8414A00FAA24A /* WebRTCModule+Permissions.m */,
|
|
136
|
+
D7F0711D2C6DC91F0031F594 /* WebRTCModule+RTCAudioSession.m */,
|
|
134
137
|
4EE3A8B825B8415900FAA24A /* WebRTCModule+RTCDataChannel.h */,
|
|
135
138
|
4EE3A8B925B8415900FAA24A /* WebRTCModule+RTCDataChannel.m */,
|
|
136
139
|
D7F99C122938F4E0000A2450 /* WebRTCModule+RTCMediaStream.h */,
|
|
@@ -262,6 +265,7 @@
|
|
|
262
265
|
4EC498BC25B8777F00E76218 /* ScreenCapturePickerViewManager.m in Sources */,
|
|
263
266
|
4EE3A8B225B8414000FAA24A /* WebRTCModule.m in Sources */,
|
|
264
267
|
4EE3A8D225B841DD00FAA24A /* CaptureController.m in Sources */,
|
|
268
|
+
D7F0711E2C6DC91F0031F594 /* WebRTCModule+RTCAudioSession.m in Sources */,
|
|
265
269
|
D74EF94829652169000742E1 /* TrackCapturerEventsEmitter.m in Sources */,
|
|
266
270
|
4EE3A8D125B841DD00FAA24A /* SocketConnection.m in Sources */,
|
|
267
271
|
4EE3A8BD25B8416500FAA24A /* WebRTCModule+RTCMediaStream.m in Sources */,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sources":["Constraints.ts"],"sourcesContent":["\nexport type MediaTrackConstraints = {\n width?: ConstrainNumber;\n height?: ConstrainNumber;\n frameRate?: ConstrainNumber;\n facingMode?: ConstrainString;\n deviceId?: ConstrainString;\n groupId?: ConstrainString;\n}\n\ntype ConstrainNumber = number | {\n exact?: number,\n ideal?: number,\n max?: number,\n min?: number,\n}\n\ntype ConstrainString = string | {\n exact?: string,\n ideal?: string,\n}"],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_index","require","_reactNative","_getDisplayMedia","_interopRequireDefault","_getUserMedia","obj","__esModule","default","WebRTCModule","NativeModules","MediaDevices","EventTarget","enumerateDevices","Promise","resolve","getDisplayMedia","getUserMedia","constraints","proto","prototype","defineEventAttribute","_default","exports"],"sources":["MediaDevices.ts"],"sourcesContent":["import { EventTarget, Event, defineEventAttribute } from 'event-target-shim/index';\nimport { NativeModules } from 'react-native';\n\nimport getDisplayMedia from './getDisplayMedia';\nimport getUserMedia from './getUserMedia';\n\nconst { WebRTCModule } = NativeModules;\n\ntype MediaDevicesEventMap = {\n devicechange: Event<'devicechange'>\n}\n\nclass MediaDevices extends EventTarget<MediaDevicesEventMap> {\n /**\n * W3C \"Media Capture and Streams\" compatible {@code enumerateDevices}\n * implementation.\n */\n enumerateDevices() {\n return new Promise(resolve => WebRTCModule.enumerateDevices(resolve));\n }\n\n /**\n * W3C \"Screen Capture\" compatible {@code getDisplayMedia} implementation.\n * See: https://w3c.github.io/mediacapture-screen-share/\n *\n * @returns {Promise}\n */\n getDisplayMedia() {\n return getDisplayMedia();\n }\n\n /**\n * W3C \"Media Capture and Streams\" compatible {@code getUserMedia}\n * implementation.\n * See: https://www.w3.org/TR/mediacapture-streams/#dom-mediadevices-enumeratedevices\n *\n * @param {*} constraints\n * @returns {Promise}\n */\n getUserMedia(constraints) {\n return getUserMedia(constraints);\n }\n}\n\n/**\n * Define the `onxxx` event handlers.\n */\nconst proto = MediaDevices.prototype;\n\ndefineEventAttribute(proto, 'devicechange');\n\n\nexport default new MediaDevices();\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAEA,IAAAE,gBAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,aAAA,GAAAD,sBAAA,CAAAH,OAAA;
|
|
1
|
+
{"version":3,"names":["_index","require","_reactNative","_getDisplayMedia","_interopRequireDefault","_getUserMedia","obj","__esModule","default","WebRTCModule","NativeModules","MediaDevices","EventTarget","enumerateDevices","Promise","resolve","getDisplayMedia","getUserMedia","constraints","proto","prototype","defineEventAttribute","_default","exports"],"sources":["MediaDevices.ts"],"sourcesContent":["import { EventTarget, Event, defineEventAttribute } from 'event-target-shim/index';\nimport { NativeModules } from 'react-native';\n\nimport getDisplayMedia from './getDisplayMedia';\nimport getUserMedia, { Constraints } from './getUserMedia';\n\nconst { WebRTCModule } = NativeModules;\n\ntype MediaDevicesEventMap = {\n devicechange: Event<'devicechange'>\n}\n\nclass MediaDevices extends EventTarget<MediaDevicesEventMap> {\n /**\n * W3C \"Media Capture and Streams\" compatible {@code enumerateDevices}\n * implementation.\n */\n enumerateDevices() {\n return new Promise(resolve => WebRTCModule.enumerateDevices(resolve));\n }\n\n /**\n * W3C \"Screen Capture\" compatible {@code getDisplayMedia} implementation.\n * See: https://w3c.github.io/mediacapture-screen-share/\n *\n * @returns {Promise}\n */\n getDisplayMedia() {\n return getDisplayMedia();\n }\n\n /**\n * W3C \"Media Capture and Streams\" compatible {@code getUserMedia}\n * implementation.\n * See: https://www.w3.org/TR/mediacapture-streams/#dom-mediadevices-enumeratedevices\n *\n * @param {*} constraints\n * @returns {Promise}\n */\n getUserMedia(constraints: Constraints) {\n return getUserMedia(constraints);\n }\n}\n\n/**\n * Define the `onxxx` event handlers.\n */\nconst proto = MediaDevices.prototype;\n\ndefineEventAttribute(proto, 'devicechange');\n\n\nexport default new MediaDevices();\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAEA,IAAAE,gBAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,aAAA,GAAAD,sBAAA,CAAAH,OAAA;AAA2D,SAAAG,uBAAAE,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAE3D,MAAM;EAAEG;AAAa,CAAC,GAAGC,0BAAa;AAMtC,MAAMC,YAAY,SAASC,kBAAW,CAAuB;EACzD;AACJ;AACA;AACA;EACIC,gBAAgBA,CAAA,EAAG;IACf,OAAO,IAAIC,OAAO,CAACC,OAAO,IAAIN,YAAY,CAACI,gBAAgB,CAACE,OAAO,CAAC,CAAC;EACzE;;EAEA;AACJ;AACA;AACA;AACA;AACA;EACIC,eAAeA,CAAA,EAAG;IACd,OAAO,IAAAA,wBAAe,EAAC,CAAC;EAC5B;;EAEA;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;EACIC,YAAYA,CAACC,WAAwB,EAAE;IACnC,OAAO,IAAAD,qBAAY,EAACC,WAAW,CAAC;EACpC;AACJ;;AAEA;AACA;AACA;AACA,MAAMC,KAAK,GAAGR,YAAY,CAACS,SAAS;AAEpC,IAAAC,2BAAoB,EAACF,KAAK,EAAE,cAAc,CAAC;AAAC,IAAAG,QAAA,GAG7B,IAAIX,YAAY,CAAC,CAAC;AAAAY,OAAA,CAAAf,OAAA,GAAAc,QAAA"}
|