react-native-webrtc 106.0.0-beta.2 → 106.0.0-beta.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/.eslintignore +6 -0
- package/.github/stale.yml +15 -0
- package/.github/workflows/ci.yml +17 -0
- package/android/src/main/java/com/oney/WebRTCModule/GetUserMediaImpl.java +36 -0
- package/android/src/main/java/com/oney/WebRTCModule/SerializeUtils.java +65 -26
- package/android/src/main/java/com/oney/WebRTCModule/WebRTCModule.java +30 -1
- package/android/src/main/java/com/oney/WebRTCModule/videoEffects/ProcessorProvider.java +37 -0
- package/android/src/main/java/com/oney/WebRTCModule/videoEffects/VideoEffectProcessor.java +57 -0
- package/android/src/main/java/com/oney/WebRTCModule/videoEffects/VideoFrameProcessor.java +19 -0
- package/android/src/main/java/com/oney/WebRTCModule/videoEffects/VideoFrameProcessorFactoryInterface.java +13 -0
- package/ios/RCTWebRTC/SerializeUtils.m +18 -5
- package/ios/RCTWebRTC/WebRTCModule+RTCPeerConnection.m +53 -5
- package/ios/RCTWebRTC/WebRTCModule+Transceivers.m +5 -4
- package/ios/RCTWebRTC.xcodeproj/project.pbxproj +46 -9
- package/ios/RCTWebRTC.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
- package/ios/RCTWebRTC.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
- package/ios/RCTWebRTC.xcodeproj/project.xcworkspace/xcuserdata/saghul.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
- package/ios/RCTWebRTC.xcodeproj/xcuserdata/saghul.xcuserdatad/xcschemes/xcschememanagement.plist +14 -0
- package/ios/RCTWebRTC.xcworkspace/contents.xcworkspacedata +10 -0
- package/lib/commonjs/EventEmitter.js.map +1 -1
- package/lib/commonjs/Logger.js.map +1 -1
- package/lib/commonjs/MediaDevices.js +2 -2
- package/lib/commonjs/MediaDevices.js.map +1 -1
- package/lib/commonjs/MediaStream.js +3 -3
- package/lib/commonjs/MediaStream.js.map +1 -1
- package/lib/commonjs/MediaStreamTrack.js +15 -3
- package/lib/commonjs/MediaStreamTrack.js.map +1 -1
- package/lib/commonjs/Permissions.js +3 -3
- package/lib/commonjs/Permissions.js.map +1 -1
- package/lib/commonjs/RTCDataChannel.js +6 -5
- package/lib/commonjs/RTCDataChannel.js.map +1 -1
- package/lib/commonjs/RTCErrorEvent.js +1 -1
- package/lib/commonjs/RTCErrorEvent.js.map +1 -1
- package/lib/commonjs/RTCPeerConnection.js +139 -58
- package/lib/commonjs/RTCPeerConnection.js.map +1 -1
- package/lib/commonjs/RTCRtcpParameters.js +7 -0
- package/lib/commonjs/RTCRtcpParameters.js.map +1 -1
- package/lib/commonjs/RTCRtpCapabilities.js +10 -2
- package/lib/commonjs/RTCRtpCapabilities.js.map +1 -1
- package/lib/commonjs/RTCRtpCodecParameters.js +22 -4
- package/lib/commonjs/RTCRtpCodecParameters.js.map +1 -1
- package/lib/commonjs/RTCRtpEncodingParameters.js +21 -10
- package/lib/commonjs/RTCRtpEncodingParameters.js.map +1 -1
- package/lib/commonjs/RTCRtpHeaderExtension.js +8 -0
- package/lib/commonjs/RTCRtpHeaderExtension.js.map +1 -1
- package/lib/commonjs/RTCRtpParameters.js +25 -3
- package/lib/commonjs/RTCRtpParameters.js.map +1 -1
- package/lib/commonjs/RTCRtpReceiveParameters.js.map +1 -1
- package/lib/commonjs/RTCRtpReceiver.js +21 -10
- package/lib/commonjs/RTCRtpReceiver.js.map +1 -1
- package/lib/commonjs/RTCRtpSendParameters.js +10 -4
- package/lib/commonjs/RTCRtpSendParameters.js.map +1 -1
- package/lib/commonjs/RTCRtpSender.js +3 -3
- package/lib/commonjs/RTCRtpSender.js.map +1 -1
- package/lib/commonjs/RTCRtpTransceiver.js.map +1 -1
- package/lib/commonjs/RTCSessionDescription.js.map +1 -1
- package/lib/commonjs/RTCUtil.js +13 -0
- package/lib/commonjs/RTCUtil.js.map +1 -1
- package/lib/commonjs/getDisplayMedia.js.map +1 -1
- package/lib/commonjs/getUserMedia.js +3 -3
- package/lib/commonjs/getUserMedia.js.map +1 -1
- package/lib/commonjs/index.js +12 -93
- package/lib/commonjs/index.js.map +1 -1
- package/lib/module/EventEmitter.js.map +1 -1
- package/lib/module/Logger.js.map +1 -1
- package/lib/module/MediaDevices.js +1 -1
- package/lib/module/MediaDevices.js.map +1 -1
- package/lib/module/MediaStream.js +2 -2
- package/lib/module/MediaStream.js.map +1 -1
- package/lib/module/MediaStreamTrack.js +14 -2
- package/lib/module/MediaStreamTrack.js.map +1 -1
- package/lib/module/Permissions.js +3 -3
- package/lib/module/Permissions.js.map +1 -1
- package/lib/module/RTCDataChannel.js +4 -3
- package/lib/module/RTCDataChannel.js.map +1 -1
- package/lib/module/RTCErrorEvent.js +2 -2
- package/lib/module/RTCErrorEvent.js.map +1 -1
- package/lib/module/RTCPeerConnection.js +135 -55
- package/lib/module/RTCPeerConnection.js.map +1 -1
- package/lib/module/RTCRtcpParameters.js +7 -0
- package/lib/module/RTCRtcpParameters.js.map +1 -1
- package/lib/module/RTCRtpCapabilities.js +10 -2
- package/lib/module/RTCRtpCapabilities.js.map +1 -1
- package/lib/module/RTCRtpCodecParameters.js +22 -4
- package/lib/module/RTCRtpCodecParameters.js.map +1 -1
- package/lib/module/RTCRtpEncodingParameters.js +21 -10
- package/lib/module/RTCRtpEncodingParameters.js.map +1 -1
- package/lib/module/RTCRtpHeaderExtension.js +8 -0
- package/lib/module/RTCRtpHeaderExtension.js.map +1 -1
- package/lib/module/RTCRtpParameters.js +20 -3
- package/lib/module/RTCRtpParameters.js.map +1 -1
- package/lib/module/RTCRtpReceiveParameters.js +1 -1
- package/lib/module/RTCRtpReceiveParameters.js.map +1 -1
- package/lib/module/RTCRtpReceiver.js +18 -8
- package/lib/module/RTCRtpReceiver.js.map +1 -1
- package/lib/module/RTCRtpSendParameters.js +10 -5
- package/lib/module/RTCRtpSendParameters.js.map +1 -1
- package/lib/module/RTCRtpSender.js +3 -3
- package/lib/module/RTCRtpSender.js.map +1 -1
- package/lib/module/RTCRtpTransceiver.js.map +1 -1
- package/lib/module/RTCSessionDescription.js.map +1 -1
- package/lib/module/RTCUtil.js +11 -0
- package/lib/module/RTCUtil.js.map +1 -1
- package/lib/module/getDisplayMedia.js.map +1 -1
- package/lib/module/getUserMedia.js +1 -1
- package/lib/module/getUserMedia.js.map +1 -1
- package/lib/module/index.js +8 -26
- package/lib/module/index.js.map +1 -1
- package/lib/typescript/EventEmitter.d.ts +4 -3
- package/lib/typescript/MediaStreamTrack.d.ts +1 -0
- package/lib/typescript/Permissions.d.ts +1 -1
- package/lib/typescript/RTCDataChannel.d.ts +2 -1
- package/lib/typescript/RTCErrorEvent.d.ts +1 -1
- package/lib/typescript/RTCPeerConnection.d.ts +7 -8
- package/lib/typescript/RTCRtcpParameters.d.ts +6 -4
- package/lib/typescript/RTCRtpCodecParameters.d.ts +11 -9
- package/lib/typescript/RTCRtpEncodingParameters.d.ts +13 -11
- package/lib/typescript/RTCRtpHeaderExtension.d.ts +7 -5
- package/lib/typescript/RTCRtpParameters.d.ts +9 -8
- package/lib/typescript/RTCRtpReceiveParameters.d.ts +1 -1
- package/lib/typescript/RTCRtpReceiver.d.ts +9 -4
- package/lib/typescript/RTCRtpSendParameters.d.ts +9 -10
- package/lib/typescript/RTCRtpSender.d.ts +3 -3
- package/lib/typescript/RTCRtpTransceiver.d.ts +1 -1
- package/lib/typescript/RTCSessionDescription.d.ts +6 -8
- package/lib/typescript/RTCUtil.d.ts +7 -0
- package/lib/typescript/index.d.ts +6 -15
- package/package.json +7 -4
- package/react-native-webrtc.podspec +1 -2
- package/src/.eslintrc.cjs +67 -0
- package/src/EventEmitter.ts +5 -4
- package/src/Logger.ts +1 -1
- package/src/MediaDevices.ts +2 -2
- package/src/MediaStream.ts +13 -4
- package/src/MediaStreamTrack.ts +21 -5
- package/src/Permissions.ts +12 -5
- package/src/RTCDataChannel.ts +17 -5
- package/src/RTCErrorEvent.ts +9 -9
- package/src/RTCPeerConnection.ts +189 -91
- package/src/RTCRtcpParameters.ts +21 -12
- package/src/RTCRtpCapabilities.ts +15 -4
- package/src/RTCRtpCodecParameters.ts +34 -13
- package/src/RTCRtpEncodingParameters.ts +37 -23
- package/src/RTCRtpHeaderExtension.ts +15 -6
- package/src/RTCRtpParameters.ts +26 -11
- package/src/RTCRtpReceiveParameters.ts +3 -3
- package/src/RTCRtpReceiver.ts +26 -10
- package/src/RTCRtpSendParameters.ts +29 -17
- package/src/RTCRtpSender.ts +14 -13
- package/src/RTCRtpTransceiver.ts +11 -7
- package/src/RTCSessionDescription.ts +7 -2
- package/src/RTCUtil.ts +24 -4
- package/src/getDisplayMedia.ts +1 -1
- package/src/getUserMedia.ts +9 -2
- package/src/index.ts +9 -34
- package/tools/downloadWebRTC.js +7 -5
- package/.prettierignore +0 -9
- package/.prettierrc.json +0 -10
- package/lib/commonjs/typings.d.js +0 -2
- package/lib/commonjs/typings.d.js.map +0 -1
- package/lib/module/typings.d.js +0 -2
- package/lib/module/typings.d.js.map +0 -1
- package/src/typings.d.ts +0 -1
package/src/getUserMedia.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
|
|
2
2
|
import { NativeModules } from 'react-native';
|
|
3
|
-
|
|
3
|
+
|
|
4
4
|
|
|
5
5
|
import MediaStream from './MediaStream';
|
|
6
6
|
import MediaStreamError from './MediaStreamError';
|
|
7
7
|
import permissions from './Permissions';
|
|
8
|
+
import * as RTCUtil from './RTCUtil';
|
|
8
9
|
|
|
9
10
|
const { WebRTCModule } = NativeModules;
|
|
10
11
|
|
|
@@ -33,11 +34,13 @@ export default function getUserMedia(constraints: Constraints = {}): Promise<Med
|
|
|
33
34
|
|
|
34
35
|
// Request required permissions
|
|
35
36
|
const reqPermissions: Promise<boolean>[] = [];
|
|
37
|
+
|
|
36
38
|
if (constraints.audio) {
|
|
37
39
|
reqPermissions.push(permissions.request({ name: 'microphone' }));
|
|
38
40
|
} else {
|
|
39
41
|
reqPermissions.push(Promise.resolve(false));
|
|
40
42
|
}
|
|
43
|
+
|
|
41
44
|
if (constraints.video) {
|
|
42
45
|
reqPermissions.push(permissions.request({ name: 'camera' }));
|
|
43
46
|
} else {
|
|
@@ -46,7 +49,7 @@ export default function getUserMedia(constraints: Constraints = {}): Promise<Med
|
|
|
46
49
|
|
|
47
50
|
return new Promise((resolve, reject) => {
|
|
48
51
|
Promise.all(reqPermissions).then(results => {
|
|
49
|
-
const [audioPerm, videoPerm] = results;
|
|
52
|
+
const [ audioPerm, videoPerm ] = results;
|
|
50
53
|
|
|
51
54
|
// Check permission results and remove unneeded permissions.
|
|
52
55
|
|
|
@@ -57,6 +60,7 @@ export default function getUserMedia(constraints: Constraints = {}): Promise<Med
|
|
|
57
60
|
message: 'Permission denied.',
|
|
58
61
|
name: 'SecurityError'
|
|
59
62
|
};
|
|
63
|
+
|
|
60
64
|
reject(new MediaStreamError(error));
|
|
61
65
|
|
|
62
66
|
return;
|
|
@@ -69,6 +73,7 @@ export default function getUserMedia(constraints: Constraints = {}): Promise<Med
|
|
|
69
73
|
// Store initial constraints.
|
|
70
74
|
for (const trackInfo of tracks) {
|
|
71
75
|
const c = constraints[trackInfo.kind];
|
|
76
|
+
|
|
72
77
|
if (typeof c === 'object') {
|
|
73
78
|
trackInfo.constraints = RTCUtil.deepClone(c);
|
|
74
79
|
}
|
|
@@ -85,11 +90,13 @@ export default function getUserMedia(constraints: Constraints = {}): Promise<Med
|
|
|
85
90
|
|
|
86
91
|
const failure = (type, message) => {
|
|
87
92
|
let error;
|
|
93
|
+
|
|
88
94
|
switch (type) {
|
|
89
95
|
case 'TypeError':
|
|
90
96
|
error = new TypeError(message);
|
|
91
97
|
break;
|
|
92
98
|
}
|
|
99
|
+
|
|
93
100
|
if (!error) {
|
|
94
101
|
error = new MediaStreamError({ message, name: type });
|
|
95
102
|
}
|
package/src/index.ts
CHANGED
|
@@ -1,29 +1,20 @@
|
|
|
1
|
+
import Logger from './Logger';
|
|
2
|
+
import mediaDevices from './MediaDevices';
|
|
3
|
+
import MediaStream from './MediaStream';
|
|
4
|
+
import MediaStreamTrack from './MediaStreamTrack';
|
|
5
|
+
import permissions from './Permissions';
|
|
6
|
+
import RTCErrorEvent from './RTCErrorEvent';
|
|
1
7
|
import RTCIceCandidate from './RTCIceCandidate';
|
|
2
8
|
import RTCPeerConnection from './RTCPeerConnection';
|
|
3
9
|
import RTCRtpReceiver from './RTCRtpReceiver';
|
|
4
10
|
import RTCRtpSender from './RTCRtpSender';
|
|
5
11
|
import RTCRtpTransceiver from './RTCRtpTransceiver';
|
|
6
|
-
import RTCRtpCapabilities from './RTCRtpCapabilities';
|
|
7
|
-
import RTCRtpCodecCapability from './RTCRtpCodecCapability';
|
|
8
|
-
import RTCRtpEncodingParameters from './RTCRtpEncodingParameters';
|
|
9
|
-
import RTCRtpCodecParameters from './RTCRtpCodecParameters';
|
|
10
|
-
import RTCRtpParameters from './RTCRtpParameters';
|
|
11
|
-
import RTCRtcpParameters from './RTCRtcpParameters';
|
|
12
|
-
import RTCRtpHeaderExtension from './RTCRtpHeaderExtension';
|
|
13
|
-
import RTCRtpSendParameters from './RTCRtpSendParameters';
|
|
14
|
-
import RTCRtpReceiveParameters from './RTCRtpReceiveParameters';
|
|
15
12
|
import RTCSessionDescription from './RTCSessionDescription';
|
|
16
|
-
import RTCErrorEvent from './RTCErrorEvent';
|
|
17
13
|
import RTCView from './RTCView';
|
|
18
14
|
import ScreenCapturePickerView from './ScreenCapturePickerView';
|
|
19
|
-
import MediaStream from './MediaStream';
|
|
20
|
-
import MediaStreamTrack from './MediaStreamTrack';
|
|
21
|
-
import mediaDevices from './MediaDevices';
|
|
22
|
-
import permissions from './Permissions';
|
|
23
|
-
import Logger from './Logger';
|
|
24
15
|
|
|
25
16
|
Logger.enable('*');
|
|
26
|
-
//Logger.enable(`*,-${Logger.ROOT_PREFIX}:*:DEBUG`);
|
|
17
|
+
// Logger.enable(`*,-${Logger.ROOT_PREFIX}:*:DEBUG`);
|
|
27
18
|
|
|
28
19
|
export {
|
|
29
20
|
RTCIceCandidate,
|
|
@@ -35,15 +26,6 @@ export {
|
|
|
35
26
|
RTCRtpReceiver,
|
|
36
27
|
RTCRtpSender,
|
|
37
28
|
RTCErrorEvent,
|
|
38
|
-
RTCRtpCapabilities,
|
|
39
|
-
RTCRtpCodecCapability,
|
|
40
|
-
RTCRtpCodecParameters,
|
|
41
|
-
RTCRtpEncodingParameters,
|
|
42
|
-
RTCRtpParameters,
|
|
43
|
-
RTCRtpSendParameters,
|
|
44
|
-
RTCRtpReceiveParameters,
|
|
45
|
-
RTCRtcpParameters,
|
|
46
|
-
RTCRtpHeaderExtension,
|
|
47
29
|
MediaStream,
|
|
48
30
|
MediaStreamTrack,
|
|
49
31
|
mediaDevices,
|
|
@@ -51,6 +33,8 @@ export {
|
|
|
51
33
|
registerGlobals
|
|
52
34
|
};
|
|
53
35
|
|
|
36
|
+
declare const global: any;
|
|
37
|
+
|
|
54
38
|
function registerGlobals(): void {
|
|
55
39
|
// Should not happen. React Native has a global navigator object.
|
|
56
40
|
if (typeof global.navigator !== 'object') {
|
|
@@ -76,13 +60,4 @@ function registerGlobals(): void {
|
|
|
76
60
|
global.RTCRtpReceiver = RTCRtpReceiver;
|
|
77
61
|
global.RTCRtpSender = RTCRtpSender;
|
|
78
62
|
global.RTCErrorEvent = RTCErrorEvent;
|
|
79
|
-
global.RTCRtpCapabilities = RTCRtpCapabilities;
|
|
80
|
-
global.RTCRtpCodecCapability = RTCRtpCodecCapability;
|
|
81
|
-
global.RTCRtpCodecParameters = RTCRtpCodecParameters;
|
|
82
|
-
global.RTCRtpEncodingParameters = RTCRtpEncodingParameters;
|
|
83
|
-
global.RTCRtpParameters = RTCRtpParameters;
|
|
84
|
-
global.RTCRtpSendParameters = RTCRtpSendParameters;
|
|
85
|
-
global.RTCRtpReceiverParameters = RTCRtpReceiveParameters;
|
|
86
|
-
global.RTCRtcpParameters = RTCRtcpParameters;
|
|
87
|
-
global.RTCRtpHeaderExtension = RTCRtpHeaderExtension;
|
|
88
63
|
}
|
package/tools/downloadWebRTC.js
CHANGED
|
@@ -57,11 +57,13 @@ async function download(url, filePath) {
|
|
|
57
57
|
if (process.platform === 'darwin') {
|
|
58
58
|
const iosUrl = builds['ios'];
|
|
59
59
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
60
|
+
if (iosUrl) {
|
|
61
|
+
items.push({
|
|
62
|
+
url: iosUrl,
|
|
63
|
+
dstFileName: path.basename(iosUrl),
|
|
64
|
+
dstDir: `${__dirname}/../apple/`
|
|
65
|
+
});
|
|
66
|
+
}
|
|
65
67
|
}
|
|
66
68
|
|
|
67
69
|
// Android
|
package/.prettierignore
DELETED
package/.prettierrc.json
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[]}
|
package/lib/module/typings.d.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[]}
|
package/src/typings.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
declare var global: any;
|