react-native-webrtc 111.0.3 → 111.0.4
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/README.md +13 -10
- package/android/src/main/java/com/oney/WebRTCModule/PeerConnectionObserver.java +18 -0
- package/android/src/main/java/com/oney/WebRTCModule/SerializeUtils.java +1 -1
- package/android/src/main/java/com/oney/WebRTCModule/WebRTCModule.java +6 -22
- package/ios/RCTWebRTC/CaptureController.m +4 -0
- package/ios/RCTWebRTC/ScreenCaptureController.m +4 -0
- package/ios/RCTWebRTC/ScreenCapturePickerViewManager.m +2 -2
- package/ios/RCTWebRTC/ScreenCapturer.m +4 -0
- package/ios/RCTWebRTC/TrackCapturerEventsEmitter.m +1 -1
- package/ios/RCTWebRTC/VideoCaptureController.h +2 -1
- package/ios/RCTWebRTC/VideoCaptureController.m +3 -0
- package/ios/RCTWebRTC/WebRTCModule+Permissions.m +10 -1
- package/ios/RCTWebRTC/WebRTCModule+RTCMediaStream.h +1 -1
- package/ios/RCTWebRTC/WebRTCModule+RTCMediaStream.m +40 -3
- package/ios/RCTWebRTC/WebRTCModule+RTCPeerConnection.m +30 -19
- package/ios/RCTWebRTC/WebRTCModule.m +3 -1
- package/ios/RCTWebRTC/WebRTCModuleOptions.h +1 -0
- package/ios/RCTWebRTC/WebRTCModuleOptions.m +1 -0
- package/ios/RCTWebRTC.xcodeproj/project.pbxproj +1 -0
- package/lib/commonjs/MediaStream.js +2 -3
- package/lib/commonjs/MediaStream.js.map +1 -1
- package/lib/commonjs/MediaStreamTrackEvent.js +12 -2
- package/lib/commonjs/MediaStreamTrackEvent.js.map +1 -1
- package/lib/commonjs/MessageEvent.js +13 -2
- package/lib/commonjs/MessageEvent.js.map +1 -1
- package/lib/commonjs/RTCDataChannel.js +1 -8
- package/lib/commonjs/RTCDataChannel.js.map +1 -1
- package/lib/commonjs/RTCDataChannelEvent.js +12 -2
- package/lib/commonjs/RTCDataChannelEvent.js.map +1 -1
- package/lib/commonjs/RTCErrorEvent.js +2 -3
- package/lib/commonjs/RTCErrorEvent.js.map +1 -1
- package/lib/commonjs/RTCEvent.js +13 -3
- package/lib/commonjs/RTCEvent.js.map +1 -1
- package/lib/commonjs/RTCIceCandidate.js.map +1 -1
- package/lib/commonjs/RTCIceCandidateEvent.js +13 -2
- package/lib/commonjs/RTCIceCandidateEvent.js.map +1 -1
- package/lib/commonjs/RTCPeerConnection.js +87 -42
- package/lib/commonjs/RTCPeerConnection.js.map +1 -1
- package/lib/commonjs/RTCTrackEvent.js +18 -2
- package/lib/commonjs/RTCTrackEvent.js.map +1 -1
- package/lib/module/MediaStream.js +2 -3
- package/lib/module/MediaStream.js.map +1 -1
- package/lib/module/MediaStreamTrackEvent.js +12 -2
- package/lib/module/MediaStreamTrackEvent.js.map +1 -1
- package/lib/module/MessageEvent.js +13 -2
- package/lib/module/MessageEvent.js.map +1 -1
- package/lib/module/RTCDataChannel.js +2 -9
- package/lib/module/RTCDataChannel.js.map +1 -1
- package/lib/module/RTCDataChannelEvent.js +12 -2
- package/lib/module/RTCDataChannelEvent.js.map +1 -1
- package/lib/module/RTCErrorEvent.js +2 -2
- package/lib/module/RTCErrorEvent.js.map +1 -1
- package/lib/module/RTCEvent.js +14 -3
- package/lib/module/RTCEvent.js.map +1 -1
- package/lib/module/RTCIceCandidate.js.map +1 -1
- package/lib/module/RTCIceCandidateEvent.js +13 -2
- package/lib/module/RTCIceCandidateEvent.js.map +1 -1
- package/lib/module/RTCPeerConnection.js +88 -43
- package/lib/module/RTCPeerConnection.js.map +1 -1
- package/lib/module/RTCTrackEvent.js +18 -2
- package/lib/module/RTCTrackEvent.js.map +1 -1
- package/lib/typescript/MediaStream.d.ts +14 -4
- package/lib/typescript/MediaStream.d.ts.map +1 -1
- package/lib/typescript/MediaStreamTrackEvent.d.ts +16 -5
- package/lib/typescript/MediaStreamTrackEvent.d.ts.map +1 -1
- package/lib/typescript/MessageEvent.d.ts +17 -5
- package/lib/typescript/MessageEvent.d.ts.map +1 -1
- package/lib/typescript/RTCDataChannel.d.ts +12 -3
- package/lib/typescript/RTCDataChannel.d.ts.map +1 -1
- package/lib/typescript/RTCDataChannelEvent.d.ts +16 -5
- package/lib/typescript/RTCDataChannelEvent.d.ts.map +1 -1
- package/lib/typescript/RTCErrorEvent.d.ts +3 -3
- package/lib/typescript/RTCErrorEvent.d.ts.map +1 -1
- package/lib/typescript/RTCEvent.d.ts +12 -3
- package/lib/typescript/RTCEvent.d.ts.map +1 -1
- package/lib/typescript/RTCIceCandidate.d.ts +7 -5
- package/lib/typescript/RTCIceCandidate.d.ts.map +1 -1
- package/lib/typescript/RTCIceCandidateEvent.d.ts +17 -3
- package/lib/typescript/RTCIceCandidateEvent.d.ts.map +1 -1
- package/lib/typescript/RTCPeerConnection.d.ts +28 -5
- package/lib/typescript/RTCPeerConnection.d.ts.map +1 -1
- package/lib/typescript/RTCTrackEvent.d.ts +20 -6
- package/lib/typescript/RTCTrackEvent.d.ts.map +1 -1
- package/package.json +1 -1
- package/react-native-webrtc.podspec +1 -1
- package/src/MediaStream.ts +14 -4
- package/src/MediaStreamTrackEvent.ts +18 -4
- package/src/MessageEvent.ts +19 -5
- package/src/RTCDataChannel.ts +10 -8
- package/src/RTCDataChannelEvent.ts +21 -4
- package/src/RTCErrorEvent.ts +3 -3
- package/src/RTCEvent.ts +18 -4
- package/src/RTCIceCandidate.ts +7 -1
- package/src/RTCIceCandidateEvent.ts +19 -4
- package/src/RTCPeerConnection.ts +110 -51
- package/src/RTCTrackEvent.ts +25 -4
package/README.md
CHANGED
|
@@ -10,14 +10,14 @@ A WebRTC module for React Native.
|
|
|
10
10
|
|
|
11
11
|
## Feature Overview
|
|
12
12
|
|
|
13
|
-
| | Android | iOS | macOS* | Windows* | Web* | Expo* |
|
|
14
|
-
| :-: |
|
|
15
|
-
| Audio/Video | :heavy_check_mark: | :heavy_check_mark: | - | - | :heavy_check_mark: | :heavy_check_mark: |
|
|
16
|
-
| Data Channels | :heavy_check_mark: | :heavy_check_mark: | - | - | :heavy_check_mark: | :heavy_check_mark: |
|
|
17
|
-
| Screen Capture | :heavy_check_mark: | :heavy_check_mark: | - | - | :heavy_check_mark: | :heavy_check_mark: |
|
|
18
|
-
| Plan B | - | - | - | - | - | - |
|
|
19
|
-
| Unified Plan* | :heavy_check_mark: | :heavy_check_mark: | - | - | :heavy_check_mark: | :heavy_check_mark: |
|
|
20
|
-
| Simulcast* | :heavy_check_mark: | :heavy_check_mark: | - | - | :heavy_check_mark: | :heavy_check_mark: |
|
|
13
|
+
| | Android | iOS | tvOS | macOS* | Windows* | Web* | Expo* |
|
|
14
|
+
| :- | :-: | :-: | :-: | :-: | :-: | :-: | :-: |
|
|
15
|
+
| Audio/Video | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | - | - | :heavy_check_mark: | :heavy_check_mark: |
|
|
16
|
+
| Data Channels | :heavy_check_mark: | :heavy_check_mark: | - | - | - | :heavy_check_mark: | :heavy_check_mark: |
|
|
17
|
+
| Screen Capture | :heavy_check_mark: | :heavy_check_mark: | - | - | - | :heavy_check_mark: | :heavy_check_mark: |
|
|
18
|
+
| Plan B | - | - | - | - | - | - | - |
|
|
19
|
+
| Unified Plan* | :heavy_check_mark: | :heavy_check_mark: | - | - | - | :heavy_check_mark: | :heavy_check_mark: |
|
|
20
|
+
| Simulcast* | :heavy_check_mark: | :heavy_check_mark: | - | - | - | :heavy_check_mark: | :heavy_check_mark: |
|
|
21
21
|
|
|
22
22
|
> **macOS** - We don't currently actively support macOS at this time.
|
|
23
23
|
Support might return in the future.
|
|
@@ -25,9 +25,10 @@ Support might return in the future.
|
|
|
25
25
|
> **Windows** - We don't currently support the [react-native-windows](https://github.com/microsoft/react-native-windows) platform at this time.
|
|
26
26
|
Anyone interested in getting the ball rolling? We're open to contributions.
|
|
27
27
|
|
|
28
|
-
> **Web** - The [react-native-webrtc-web-shim](https://github.com/react-native-webrtc/react-native-webrtc-web-shim) project provides a shim for [react-native-web](https://github.com/necolas/react-native-web) support.
|
|
28
|
+
> **Web** - The [react-native-webrtc-web-shim](https://github.com/react-native-webrtc/react-native-webrtc-web-shim) project provides a shim for [react-native-web](https://github.com/necolas/react-native-web) support.
|
|
29
|
+
Which will allow you to use [(almost)](https://github.com/react-native-webrtc/react-native-webrtc-web-shim/tree/main#setup) the exact same code in your [react-native-web](https://github.com/necolas/react-native-web) project as you would with [react-native](https://reactnative.dev/) directly.
|
|
29
30
|
|
|
30
|
-
> **Expo** - As this module includes native code it is not available in the [Expo Go](https://expo.dev/client) app by default.
|
|
31
|
+
> **Expo** - As this module includes native code it is not available in the [Expo Go](https://expo.dev/client) app by default.
|
|
31
32
|
However you can get things working via the [expo-dev-client](https://docs.expo.dev/development/getting-started/) library and out-of-tree [config-plugins/react-native-webrtc](https://github.com/expo/config-plugins/tree/master/packages/react-native-webrtc) package.
|
|
32
33
|
|
|
33
34
|
> **Unified Plan** - As of version 106.0.0 Unified Plan is the only supported mode.
|
|
@@ -42,6 +43,7 @@ Software encode/decode factories have been enabled by default.
|
|
|
42
43
|
* Supported architectures
|
|
43
44
|
* Android: armeabi-v7a, arm64-v8a, x86, x86_64
|
|
44
45
|
* iOS: arm64, x86_64
|
|
46
|
+
* tvOS: arm64
|
|
45
47
|
* macOS: (temporarily disabled)
|
|
46
48
|
|
|
47
49
|
## Getting Started
|
|
@@ -57,6 +59,7 @@ Don't forget to follow platform guides below to cover any extra required steps.
|
|
|
57
59
|
|
|
58
60
|
- [Android Install](./Documentation/AndroidInstallation.md)
|
|
59
61
|
- [iOS Install](./Documentation/iOSInstallation.md)
|
|
62
|
+
- [tvOS Install](./Documentation/tvOSInstallation.md)
|
|
60
63
|
- [Basic Usage](./Documentation/BasicUsage.md)
|
|
61
64
|
- [Step by Step Call Guide](./Documentation/CallGuide.md)
|
|
62
65
|
- [Improving Call Reliability](./Documentation/ImprovingCallReliability.md)
|
|
@@ -502,9 +502,27 @@ class PeerConnectionObserver implements PeerConnection.Observer {
|
|
|
502
502
|
@Override
|
|
503
503
|
public void onSignalingChange(PeerConnection.SignalingState signalingState) {
|
|
504
504
|
ThreadUtils.runOnExecutor(() -> {
|
|
505
|
+
WritableMap newLocalSdpMap = Arguments.createMap();
|
|
506
|
+
WritableMap newRemoteSdpMap = Arguments.createMap();
|
|
507
|
+
SessionDescription newLocalSdp = peerConnection.getLocalDescription();
|
|
508
|
+
SessionDescription newRemoteSdp = peerConnection.getRemoteDescription();
|
|
509
|
+
|
|
510
|
+
if (newLocalSdp != null) {
|
|
511
|
+
newLocalSdpMap.putString("type", newLocalSdp.type.canonicalForm());
|
|
512
|
+
newLocalSdpMap.putString("sdp", newLocalSdp.description);
|
|
513
|
+
}
|
|
514
|
+
|
|
515
|
+
if (newRemoteSdp != null) {
|
|
516
|
+
newRemoteSdpMap.putString("type", newRemoteSdp.type.canonicalForm());
|
|
517
|
+
newRemoteSdpMap.putString("sdp", newRemoteSdp.description);
|
|
518
|
+
}
|
|
519
|
+
|
|
505
520
|
WritableMap params = Arguments.createMap();
|
|
506
521
|
params.putInt("pcId", id);
|
|
507
522
|
params.putString("signalingState", signalingStateString(signalingState));
|
|
523
|
+
params.putMap("localSdp", newLocalSdpMap);
|
|
524
|
+
params.putMap("remoteSdp", newRemoteSdpMap);
|
|
525
|
+
|
|
508
526
|
webRTCModule.sendEvent("peerConnectionSignalingStateChanged", params);
|
|
509
527
|
});
|
|
510
528
|
}
|
|
@@ -280,7 +280,7 @@ public class SerializeUtils {
|
|
|
280
280
|
return null;
|
|
281
281
|
}
|
|
282
282
|
|
|
283
|
-
RtpTransceiver.RtpTransceiverDirection direction = RtpTransceiver.RtpTransceiverDirection.
|
|
283
|
+
RtpTransceiver.RtpTransceiverDirection direction = RtpTransceiver.RtpTransceiverDirection.SEND_RECV;
|
|
284
284
|
List<String> streamIds = new ArrayList<>();
|
|
285
285
|
List<RtpParameters.Encoding> sendEncodings = new ArrayList<>();
|
|
286
286
|
|
|
@@ -367,16 +367,20 @@ public class WebRTCModule extends ReactContextBaseJavaModule {
|
|
|
367
367
|
}
|
|
368
368
|
|
|
369
369
|
@ReactMethod(isBlockingSynchronousMethod = true)
|
|
370
|
-
public
|
|
370
|
+
public boolean peerConnectionInit(ReadableMap configuration, int id) {
|
|
371
371
|
PeerConnection.RTCConfiguration rtcConfiguration = parseRTCConfiguration(configuration);
|
|
372
372
|
|
|
373
373
|
try {
|
|
374
|
-
ThreadUtils
|
|
374
|
+
return (boolean) ThreadUtils
|
|
375
375
|
.submitToExecutor(() -> {
|
|
376
376
|
PeerConnectionObserver observer = new PeerConnectionObserver(this, id);
|
|
377
377
|
PeerConnection peerConnection = mFactory.createPeerConnection(rtcConfiguration, observer);
|
|
378
|
+
if (peerConnection == null) {
|
|
379
|
+
return false;
|
|
380
|
+
}
|
|
378
381
|
observer.setPeerConnection(peerConnection);
|
|
379
382
|
mPeerConnectionObservers.put(id, observer);
|
|
383
|
+
return true;
|
|
380
384
|
})
|
|
381
385
|
.get();
|
|
382
386
|
} catch (ExecutionException | InterruptedException e) {
|
|
@@ -1006,17 +1010,7 @@ public class WebRTCModule extends ReactContextBaseJavaModule {
|
|
|
1006
1010
|
@Override
|
|
1007
1011
|
public void onSetSuccess() {
|
|
1008
1012
|
ThreadUtils.runOnExecutor(() -> {
|
|
1009
|
-
WritableMap newSdpMap = Arguments.createMap();
|
|
1010
1013
|
WritableMap params = Arguments.createMap();
|
|
1011
|
-
|
|
1012
|
-
SessionDescription newSdp = peerConnection.getLocalDescription();
|
|
1013
|
-
// Can happen when doing a rollback.
|
|
1014
|
-
if (newSdp != null) {
|
|
1015
|
-
newSdpMap.putString("type", newSdp.type.canonicalForm());
|
|
1016
|
-
newSdpMap.putString("sdp", newSdp.description);
|
|
1017
|
-
}
|
|
1018
|
-
|
|
1019
|
-
params.putMap("sdpInfo", newSdpMap);
|
|
1020
1014
|
params.putArray("transceiversInfo", getTransceiversInfo(peerConnection));
|
|
1021
1015
|
|
|
1022
1016
|
promise.resolve(params);
|
|
@@ -1071,18 +1065,8 @@ public class WebRTCModule extends ReactContextBaseJavaModule {
|
|
|
1071
1065
|
@Override
|
|
1072
1066
|
public void onSetSuccess() {
|
|
1073
1067
|
ThreadUtils.runOnExecutor(() -> {
|
|
1074
|
-
WritableMap newSdpMap = Arguments.createMap();
|
|
1075
1068
|
WritableMap params = Arguments.createMap();
|
|
1076
|
-
|
|
1077
|
-
SessionDescription newSdp = peerConnection.getRemoteDescription();
|
|
1078
|
-
// Be defensive for the rollback cases.
|
|
1079
|
-
if (newSdp != null) {
|
|
1080
|
-
newSdpMap.putString("type", newSdp.type.canonicalForm());
|
|
1081
|
-
newSdpMap.putString("sdp", newSdp.description);
|
|
1082
|
-
}
|
|
1083
|
-
|
|
1084
1069
|
params.putArray("transceiversInfo", getTransceiversInfo(peerConnection));
|
|
1085
|
-
params.putMap("sdpInfo", newSdpMap);
|
|
1086
1070
|
|
|
1087
1071
|
WritableArray newTransceivers = Arguments.createArray();
|
|
1088
1072
|
for (RtpTransceiver transceiver : peerConnection.getTransceivers()) {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
#if !TARGET_OS_TV
|
|
1
2
|
|
|
2
3
|
#import <Foundation/Foundation.h>
|
|
3
4
|
#import <WebRTC/RTCCameraVideoCapturer.h>
|
|
@@ -5,7 +6,6 @@
|
|
|
5
6
|
#import "CaptureController.h"
|
|
6
7
|
|
|
7
8
|
@interface VideoCaptureController : CaptureController
|
|
8
|
-
|
|
9
9
|
@property(nonatomic, readonly, strong) AVCaptureDeviceFormat *selectedFormat;
|
|
10
10
|
@property(nonatomic, readonly, assign) int frameRate;
|
|
11
11
|
|
|
@@ -15,3 +15,4 @@
|
|
|
15
15
|
- (void)switchCamera;
|
|
16
16
|
|
|
17
17
|
@end
|
|
18
|
+
#endif
|
|
@@ -23,13 +23,16 @@ RCT_EXPORT_METHOD(checkPermission
|
|
|
23
23
|
: (NSString *)mediaType resolver
|
|
24
24
|
: (RCTPromiseResolveBlock)resolve rejecter
|
|
25
25
|
: (RCTPromiseRejectBlock)reject) {
|
|
26
|
+
#if TARGET_OS_TV
|
|
27
|
+
resolve(@"tvOS is not supported");
|
|
28
|
+
return;
|
|
29
|
+
#else
|
|
26
30
|
AVMediaType mediaType_ = [self avMediaType:mediaType];
|
|
27
31
|
|
|
28
32
|
if (mediaType_ == nil) {
|
|
29
33
|
reject(@"invalid_type", @"Invalid media type", nil);
|
|
30
34
|
return;
|
|
31
35
|
}
|
|
32
|
-
|
|
33
36
|
AVAuthorizationStatus status = [AVCaptureDevice authorizationStatusForMediaType:mediaType_];
|
|
34
37
|
switch (status) {
|
|
35
38
|
case AVAuthorizationStatusAuthorized:
|
|
@@ -44,12 +47,17 @@ RCT_EXPORT_METHOD(checkPermission
|
|
|
44
47
|
resolve(PERMISSION_DENIED);
|
|
45
48
|
break;
|
|
46
49
|
}
|
|
50
|
+
#endif
|
|
47
51
|
}
|
|
48
52
|
|
|
49
53
|
RCT_EXPORT_METHOD(requestPermission
|
|
50
54
|
: (NSString *)mediaType resolver
|
|
51
55
|
: (RCTPromiseResolveBlock)resolve rejecter
|
|
52
56
|
: (RCTPromiseRejectBlock)reject) {
|
|
57
|
+
#if TARGET_OS_TV
|
|
58
|
+
resolve(@"tvOS is not supported");
|
|
59
|
+
return;
|
|
60
|
+
#else
|
|
53
61
|
AVMediaType mediaType_ = [self avMediaType:mediaType];
|
|
54
62
|
|
|
55
63
|
if (mediaType_ == nil) {
|
|
@@ -61,6 +69,7 @@ RCT_EXPORT_METHOD(requestPermission
|
|
|
61
69
|
completionHandler:^(BOOL granted) {
|
|
62
70
|
resolve(@(granted));
|
|
63
71
|
}];
|
|
72
|
+
#endif
|
|
64
73
|
}
|
|
65
74
|
|
|
66
75
|
@end
|
|
@@ -29,12 +29,15 @@
|
|
|
29
29
|
RTCAudioTrack *audioTrack = [self.peerConnectionFactory audioTrackWithTrackId:trackId];
|
|
30
30
|
return audioTrack;
|
|
31
31
|
}
|
|
32
|
-
|
|
33
32
|
/**
|
|
34
33
|
* Initializes a new {@link RTCVideoTrack} with the given capture controller
|
|
35
34
|
*/
|
|
36
35
|
- (RTCVideoTrack *)createVideoTrackWithCaptureController:
|
|
37
36
|
(CaptureController * (^)(RTCVideoSource *))captureControllerCreator {
|
|
37
|
+
#if TARGET_OS_TV
|
|
38
|
+
return nil;
|
|
39
|
+
#else
|
|
40
|
+
|
|
38
41
|
RTCVideoSource *videoSource = [self.peerConnectionFactory videoSource];
|
|
39
42
|
|
|
40
43
|
NSString *trackUUID = [[NSUUID UUID] UUIDString];
|
|
@@ -45,14 +48,17 @@
|
|
|
45
48
|
[captureController startCapture];
|
|
46
49
|
|
|
47
50
|
return videoTrack;
|
|
51
|
+
#endif
|
|
48
52
|
}
|
|
49
|
-
|
|
50
53
|
/**
|
|
51
54
|
* Initializes a new {@link RTCMediaTrack} with the given tracks.
|
|
52
55
|
*
|
|
53
56
|
* @return An array with the mediaStreamId in index 0, and track infos in index 1.
|
|
54
57
|
*/
|
|
55
58
|
- (NSArray *)createMediaStream:(NSArray<RTCMediaStreamTrack *> *)tracks {
|
|
59
|
+
#if TARGET_OS_TV
|
|
60
|
+
return nil;
|
|
61
|
+
#else
|
|
56
62
|
NSString *mediaStreamId = [[NSUUID UUID] UUIDString];
|
|
57
63
|
RTCMediaStream *mediaStream = [self.peerConnectionFactory mediaStreamWithStreamId:mediaStreamId];
|
|
58
64
|
NSMutableArray<NSDictionary *> *trackInfos = [NSMutableArray array];
|
|
@@ -91,12 +97,16 @@
|
|
|
91
97
|
|
|
92
98
|
self.localStreams[mediaStreamId] = mediaStream;
|
|
93
99
|
return @[ mediaStreamId, trackInfos ];
|
|
100
|
+
#endif
|
|
94
101
|
}
|
|
95
102
|
|
|
96
103
|
/**
|
|
97
104
|
* Initializes a new {@link RTCVideoTrack} which satisfies the given constraints.
|
|
98
105
|
*/
|
|
99
106
|
- (RTCVideoTrack *)createVideoTrack:(NSDictionary *)constraints {
|
|
107
|
+
#if TARGET_OS_TV
|
|
108
|
+
return nil;
|
|
109
|
+
#else
|
|
100
110
|
RTCVideoSource *videoSource = [self.peerConnectionFactory videoSource];
|
|
101
111
|
|
|
102
112
|
NSString *trackUUID = [[NSUUID UUID] UUIDString];
|
|
@@ -111,10 +121,11 @@
|
|
|
111
121
|
#endif
|
|
112
122
|
|
|
113
123
|
return videoTrack;
|
|
124
|
+
#endif
|
|
114
125
|
}
|
|
115
126
|
|
|
116
127
|
- (RTCVideoTrack *)createScreenCaptureVideoTrack {
|
|
117
|
-
#if TARGET_IPHONE_SIMULATOR || TARGET_OS_OSX
|
|
128
|
+
#if TARGET_IPHONE_SIMULATOR || TARGET_OS_OSX || TARGET_OS_TV
|
|
118
129
|
return nil;
|
|
119
130
|
#endif
|
|
120
131
|
|
|
@@ -136,6 +147,11 @@
|
|
|
136
147
|
}
|
|
137
148
|
|
|
138
149
|
RCT_EXPORT_METHOD(getDisplayMedia : (RCTPromiseResolveBlock)resolve rejecter : (RCTPromiseRejectBlock)reject) {
|
|
150
|
+
#if TARGET_OS_TV
|
|
151
|
+
reject(@"unsupported_platform", @"tvOS is not supported", nil);
|
|
152
|
+
return;
|
|
153
|
+
#else
|
|
154
|
+
|
|
139
155
|
RTCVideoTrack *videoTrack = [self createScreenCaptureVideoTrack];
|
|
140
156
|
|
|
141
157
|
if (videoTrack == nil) {
|
|
@@ -160,6 +176,7 @@ RCT_EXPORT_METHOD(getDisplayMedia : (RCTPromiseResolveBlock)resolve rejecter : (
|
|
|
160
176
|
|
|
161
177
|
self.localStreams[mediaStreamId] = mediaStream;
|
|
162
178
|
resolve(@{@"streamId" : mediaStreamId, @"track" : trackInfo});
|
|
179
|
+
#endif
|
|
163
180
|
}
|
|
164
181
|
|
|
165
182
|
/**
|
|
@@ -173,6 +190,10 @@ RCT_EXPORT_METHOD(getUserMedia
|
|
|
173
190
|
: (NSDictionary *)constraints successCallback
|
|
174
191
|
: (RCTResponseSenderBlock)successCallback errorCallback
|
|
175
192
|
: (RCTResponseSenderBlock)errorCallback) {
|
|
193
|
+
#if TARGET_OS_TV
|
|
194
|
+
errorCallback(@[ @"PlatformNotSupported", @"getUserMedia is not supported on tvOS." ]);
|
|
195
|
+
return;
|
|
196
|
+
#else
|
|
176
197
|
RTCAudioTrack *audioTrack = nil;
|
|
177
198
|
RTCVideoTrack *videoTrack = nil;
|
|
178
199
|
|
|
@@ -231,11 +252,15 @@ RCT_EXPORT_METHOD(getUserMedia
|
|
|
231
252
|
|
|
232
253
|
self.localStreams[mediaStreamId] = mediaStream;
|
|
233
254
|
successCallback(@[ mediaStreamId, tracks ]);
|
|
255
|
+
#endif
|
|
234
256
|
}
|
|
235
257
|
|
|
236
258
|
#pragma mark - Other stream related APIs
|
|
237
259
|
|
|
238
260
|
RCT_EXPORT_METHOD(enumerateDevices : (RCTResponseSenderBlock)callback) {
|
|
261
|
+
#if TARGET_OS_TV
|
|
262
|
+
callback(@[]);
|
|
263
|
+
#else
|
|
239
264
|
NSMutableArray *devices = [NSMutableArray array];
|
|
240
265
|
AVCaptureDeviceDiscoverySession *videoevicesSession =
|
|
241
266
|
[AVCaptureDeviceDiscoverySession discoverySessionWithDeviceTypes:@[ AVCaptureDeviceTypeBuiltInWideAngleCamera ]
|
|
@@ -277,6 +302,7 @@ RCT_EXPORT_METHOD(enumerateDevices : (RCTResponseSenderBlock)callback) {
|
|
|
277
302
|
}];
|
|
278
303
|
}
|
|
279
304
|
callback(@[ devices ]);
|
|
305
|
+
#endif
|
|
280
306
|
}
|
|
281
307
|
|
|
282
308
|
RCT_EXPORT_METHOD(mediaStreamCreate : (nonnull NSString *)streamID) {
|
|
@@ -334,12 +360,17 @@ RCT_EXPORT_METHOD(mediaStreamRelease : (nonnull NSString *)streamID) {
|
|
|
334
360
|
}
|
|
335
361
|
|
|
336
362
|
RCT_EXPORT_METHOD(mediaStreamTrackRelease : (nonnull NSString *)trackID) {
|
|
363
|
+
#if TARGET_OS_TV
|
|
364
|
+
return;
|
|
365
|
+
#else
|
|
366
|
+
|
|
337
367
|
RTCMediaStreamTrack *track = self.localTracks[trackID];
|
|
338
368
|
if (track) {
|
|
339
369
|
track.isEnabled = NO;
|
|
340
370
|
[track.captureController stopCapture];
|
|
341
371
|
[self.localTracks removeObjectForKey:trackID];
|
|
342
372
|
}
|
|
373
|
+
#endif
|
|
343
374
|
}
|
|
344
375
|
|
|
345
376
|
RCT_EXPORT_METHOD(mediaStreamTrackSetEnabled : (nonnull NSNumber *)pcId : (nonnull NSString *)trackID : (BOOL)enabled) {
|
|
@@ -349,6 +380,7 @@ RCT_EXPORT_METHOD(mediaStreamTrackSetEnabled : (nonnull NSNumber *)pcId : (nonnu
|
|
|
349
380
|
}
|
|
350
381
|
|
|
351
382
|
track.isEnabled = enabled;
|
|
383
|
+
#if !TARGET_OS_TV
|
|
352
384
|
if (track.captureController) { // It could be a remote track!
|
|
353
385
|
if (enabled) {
|
|
354
386
|
[track.captureController startCapture];
|
|
@@ -356,14 +388,19 @@ RCT_EXPORT_METHOD(mediaStreamTrackSetEnabled : (nonnull NSNumber *)pcId : (nonnu
|
|
|
356
388
|
[track.captureController stopCapture];
|
|
357
389
|
}
|
|
358
390
|
}
|
|
391
|
+
#endif
|
|
359
392
|
}
|
|
360
393
|
|
|
361
394
|
RCT_EXPORT_METHOD(mediaStreamTrackSwitchCamera : (nonnull NSString *)trackID) {
|
|
395
|
+
#if TARGET_OS_TV
|
|
396
|
+
return;
|
|
397
|
+
#else
|
|
362
398
|
RTCMediaStreamTrack *track = self.localTracks[trackID];
|
|
363
399
|
if (track) {
|
|
364
400
|
RTCVideoTrack *videoTrack = (RTCVideoTrack *)track;
|
|
365
401
|
[(VideoCaptureController *)videoTrack.captureController switchCamera];
|
|
366
402
|
}
|
|
403
|
+
#endif
|
|
367
404
|
}
|
|
368
405
|
|
|
369
406
|
RCT_EXPORT_METHOD(mediaStreamTrackSetVolume : (nonnull NSNumber *)pcId : (nonnull NSString *)trackID : (double)volume) {
|
|
@@ -76,13 +76,19 @@ int _transceiverNextId = 0;
|
|
|
76
76
|
RCT_EXPORT_BLOCKING_SYNCHRONOUS_METHOD(peerConnectionInit
|
|
77
77
|
: (RTCConfiguration *)configuration objectID
|
|
78
78
|
: (nonnull NSNumber *)objectID) {
|
|
79
|
+
__block BOOL ret = YES;
|
|
80
|
+
|
|
79
81
|
dispatch_sync(self.workerQueue, ^{
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
[[RTCMediaConstraints alloc] initWithMandatoryConstraints:nil optionalConstraints:optionalConstraints];
|
|
82
|
+
RTCMediaConstraints *constraints = [[RTCMediaConstraints alloc] initWithMandatoryConstraints:nil
|
|
83
|
+
optionalConstraints:nil];
|
|
83
84
|
RTCPeerConnection *peerConnection = [self.peerConnectionFactory peerConnectionWithConfiguration:configuration
|
|
84
85
|
constraints:constraints
|
|
85
86
|
delegate:self];
|
|
87
|
+
if (peerConnection == nil) {
|
|
88
|
+
ret = NO;
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
|
|
86
92
|
peerConnection.dataChannels = [NSMutableDictionary new];
|
|
87
93
|
peerConnection.reactTag = objectID;
|
|
88
94
|
peerConnection.remoteStreams = [NSMutableDictionary new];
|
|
@@ -93,7 +99,7 @@ RCT_EXPORT_BLOCKING_SYNCHRONOUS_METHOD(peerConnectionInit
|
|
|
93
99
|
self.peerConnections[objectID] = peerConnection;
|
|
94
100
|
});
|
|
95
101
|
|
|
96
|
-
return
|
|
102
|
+
return @(ret);
|
|
97
103
|
}
|
|
98
104
|
|
|
99
105
|
RCT_EXPORT_METHOD(peerConnectionSetConfiguration
|
|
@@ -202,14 +208,7 @@ RCT_EXPORT_METHOD(peerConnectionSetLocalDescription
|
|
|
202
208
|
if (error) {
|
|
203
209
|
reject(@"E_OPERATION_ERROR", error.localizedDescription, nil);
|
|
204
210
|
} else {
|
|
205
|
-
NSMutableDictionary *sdpInfo = [NSMutableDictionary new];
|
|
206
|
-
RTCSessionDescription *localDesc = peerConnection.localDescription;
|
|
207
|
-
if (localDesc) {
|
|
208
|
-
sdpInfo[@"type"] = [RTCSessionDescription stringForType:localDesc.type];
|
|
209
|
-
sdpInfo[@"sdp"] = localDesc.sdp;
|
|
210
|
-
}
|
|
211
211
|
id data = @{
|
|
212
|
-
@"sdpInfo" : sdpInfo,
|
|
213
212
|
@"transceiversInfo" :
|
|
214
213
|
[SerializeUtils constructTransceiversInfoArrayWithPeerConnection:peerConnection]
|
|
215
214
|
};
|
|
@@ -257,14 +256,7 @@ RCT_EXPORT_METHOD(peerConnectionSetRemoteDescription
|
|
|
257
256
|
}
|
|
258
257
|
}
|
|
259
258
|
|
|
260
|
-
NSMutableDictionary *sdpInfo = [NSMutableDictionary new];
|
|
261
|
-
RTCSessionDescription *remoteDesc = peerConnection.remoteDescription;
|
|
262
|
-
if (remoteDesc) {
|
|
263
|
-
sdpInfo[@"type"] = [RTCSessionDescription stringForType:remoteDesc.type];
|
|
264
|
-
sdpInfo[@"sdp"] = remoteDesc.sdp;
|
|
265
|
-
}
|
|
266
259
|
id data = @{
|
|
267
|
-
@"sdpInfo" : sdpInfo,
|
|
268
260
|
@"transceiversInfo" :
|
|
269
261
|
[SerializeUtils constructTransceiversInfoArrayWithPeerConnection:peerConnection],
|
|
270
262
|
@"newTransceivers" : newTransceivers
|
|
@@ -732,10 +724,29 @@ RCT_EXPORT_BLOCKING_SYNCHRONOUS_METHOD(peerConnectionRemoveTrack
|
|
|
732
724
|
|
|
733
725
|
- (void)peerConnection:(RTCPeerConnection *)peerConnection didChangeSignalingState:(RTCSignalingState)newState {
|
|
734
726
|
dispatch_async(self.workerQueue, ^{
|
|
727
|
+
id newLocalSdp = @{};
|
|
728
|
+
id newRemoteSdp = @{};
|
|
729
|
+
|
|
730
|
+
if (peerConnection.localDescription) {
|
|
731
|
+
newLocalSdp = @{
|
|
732
|
+
@"type" : [RTCSessionDescription stringForType:peerConnection.localDescription.type],
|
|
733
|
+
@"sdp" : peerConnection.localDescription.sdp
|
|
734
|
+
};
|
|
735
|
+
}
|
|
736
|
+
|
|
737
|
+
if (peerConnection.remoteDescription) {
|
|
738
|
+
newRemoteSdp = @{
|
|
739
|
+
@"type" : [RTCSessionDescription stringForType:peerConnection.remoteDescription.type],
|
|
740
|
+
@"sdp" : peerConnection.remoteDescription.sdp
|
|
741
|
+
};
|
|
742
|
+
}
|
|
743
|
+
|
|
735
744
|
[self sendEventWithName:kEventPeerConnectionSignalingStateChanged
|
|
736
745
|
body:@{
|
|
737
746
|
@"pcId" : peerConnection.reactTag,
|
|
738
|
-
@"signalingState" : [self stringForSignalingState:newState]
|
|
747
|
+
@"signalingState" : [self stringForSignalingState:newState],
|
|
748
|
+
@"localSdp" : newLocalSdp,
|
|
749
|
+
@"remoteSdp" : newRemoteSdp
|
|
739
750
|
}];
|
|
740
751
|
});
|
|
741
752
|
}
|
|
@@ -40,6 +40,7 @@
|
|
|
40
40
|
self = [super init];
|
|
41
41
|
if (self) {
|
|
42
42
|
WebRTCModuleOptions *options = [WebRTCModuleOptions sharedInstance];
|
|
43
|
+
id<RTCAudioDevice> audioDevice = options.audioDevice;
|
|
43
44
|
id<RTCVideoDecoderFactory> decoderFactory = options.videoDecoderFactory;
|
|
44
45
|
id<RTCVideoEncoderFactory> encoderFactory = options.videoEncoderFactory;
|
|
45
46
|
NSDictionary *fieldTrials = options.fieldTrials;
|
|
@@ -69,7 +70,8 @@
|
|
|
69
70
|
RCTLogInfo(@"Using video decoder factory: %@", NSStringFromClass([decoderFactory class]));
|
|
70
71
|
|
|
71
72
|
_peerConnectionFactory = [[RTCPeerConnectionFactory alloc] initWithEncoderFactory:encoderFactory
|
|
72
|
-
decoderFactory:decoderFactory
|
|
73
|
+
decoderFactory:decoderFactory
|
|
74
|
+
audioDevice:audioDevice];
|
|
73
75
|
|
|
74
76
|
_peerConnections = [NSMutableDictionary new];
|
|
75
77
|
_localStreams = [NSMutableDictionary new];
|
|
@@ -7,6 +7,7 @@ NS_ASSUME_NONNULL_BEGIN
|
|
|
7
7
|
|
|
8
8
|
@property(nonatomic, strong, nullable) id<RTCVideoDecoderFactory> videoDecoderFactory;
|
|
9
9
|
@property(nonatomic, strong, nullable) id<RTCVideoEncoderFactory> videoEncoderFactory;
|
|
10
|
+
@property(nonatomic, strong, nullable) id<RTCAudioDevice> audioDevice;
|
|
10
11
|
@property(nonatomic, strong, nullable) NSDictionary *fieldTrials;
|
|
11
12
|
@property(nonatomic, assign) RTCLoggingSeverity loggingSeverity;
|
|
12
13
|
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
var _eventTargetShim = require("event-target-shim");
|
|
7
|
+
var _eventTargetShim = _interopRequireDefault(require("event-target-shim"));
|
|
8
8
|
var _reactNative = require("react-native");
|
|
9
9
|
var _MediaStreamTrack = _interopRequireDefault(require("./MediaStreamTrack"));
|
|
10
10
|
var _RTCUtil = require("./RTCUtil");
|
|
@@ -12,8 +12,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
12
12
|
const {
|
|
13
13
|
WebRTCModule
|
|
14
14
|
} = _reactNative.NativeModules;
|
|
15
|
-
|
|
16
|
-
class MediaStream extends (0, _eventTargetShim.defineCustomEventTarget)(...MEDIA_STREAM_EVENTS) {
|
|
15
|
+
class MediaStream extends _eventTargetShim.default {
|
|
17
16
|
_tracks = [];
|
|
18
17
|
|
|
19
18
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_eventTargetShim","require","_reactNative","_MediaStreamTrack","
|
|
1
|
+
{"version":3,"names":["_eventTargetShim","_interopRequireDefault","require","_reactNative","_MediaStreamTrack","_RTCUtil","obj","__esModule","default","WebRTCModule","NativeModules","MediaStream","EventTarget","_tracks","constructor","arg","_id","uniqueID","_reactTag","mediaStreamCreate","id","track","getTracks","addTrack","Array","isArray","streamId","streamReactTag","tracks","trackInfo","push","MediaStreamTrack","TypeError","active","index","indexOf","mediaStreamAddTrack","remote","_peerConnectionId","removeTrack","splice","mediaStreamRemoveTrack","slice","getTrackById","trackId","find","getAudioTracks","filter","kind","getVideoTracks","clone","Error","toURL","release","releaseTracks","arguments","length","undefined","mediaStreamRelease","exports"],"sourceRoot":"../../src","sources":["MediaStream.ts"],"mappings":"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"}
|
|
@@ -4,9 +4,19 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
|
|
7
|
+
var _eventTargetShim = require("event-target-shim");
|
|
8
|
+
/**
|
|
9
|
+
* @eventClass
|
|
10
|
+
* This event is fired whenever the MediaStreamTrack has changed in any way.
|
|
11
|
+
* @param {MEDIA_STREAM_EVENTS} type - The type of event.
|
|
12
|
+
* @param {IMediaStreamTrackEventInitDict} eventInitDict - The event init properties.
|
|
13
|
+
* @see {@link https://developer.mozilla.org/en-US/docs/Web/API/MediaStream#events MDN} for details.
|
|
14
|
+
*/
|
|
15
|
+
class MediaStreamTrackEvent extends _eventTargetShim.Event {
|
|
16
|
+
/** @eventProperty */
|
|
17
|
+
|
|
8
18
|
constructor(type, eventInitDict) {
|
|
9
|
-
|
|
19
|
+
super(type, eventInitDict);
|
|
10
20
|
this.track = eventInitDict.track;
|
|
11
21
|
}
|
|
12
22
|
}
|