react-native-webrtc 1.100.1 → 106.0.0-beta.1
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/ISSUE_TEMPLATE.md +17 -13
- package/README.md +46 -129
- package/android/src/main/java/com/oney/WebRTCModule/PeerConnectionObserver.java +160 -165
- package/android/src/main/java/com/oney/WebRTCModule/SerializeUtils.java +279 -0
- package/android/src/main/java/com/oney/WebRTCModule/WebRTCModule.java +361 -56
- package/android/src/main/java/com/oney/WebRTCModule/WebRTCView.java +5 -1
- package/ios/RCTWebRTC/RCTConvert+WebRTC.m +2 -6
- package/ios/RCTWebRTC/ScreenCapturer.m +0 -1
- package/ios/RCTWebRTC/SerializeUtils.h +25 -0
- package/ios/RCTWebRTC/SerializeUtils.m +219 -0
- package/ios/RCTWebRTC/WebRTCModule+RTCPeerConnection.m +284 -128
- package/ios/RCTWebRTC/WebRTCModule+Transceivers.m +216 -0
- package/ios/RCTWebRTC/WebRTCModule.h +15 -4
- package/ios/RCTWebRTC/WebRTCModule.m +26 -6
- package/lib/commonjs/EventEmitter.js +24 -0
- package/lib/commonjs/EventEmitter.js.map +1 -1
- package/lib/commonjs/Logger.js +65 -0
- package/lib/commonjs/Logger.js.map +1 -0
- package/lib/commonjs/MediaStream.js +1 -1
- package/lib/commonjs/MediaStream.js.map +1 -1
- package/lib/commonjs/MediaStreamTrack.js +4 -2
- package/lib/commonjs/MediaStreamTrack.js.map +1 -1
- package/lib/commonjs/Permissions.js +1 -1
- package/lib/commonjs/Permissions.js.map +1 -1
- package/lib/commonjs/RTCDataChannel.js.map +1 -1
- package/lib/commonjs/RTCErrorEvent.js +33 -0
- package/lib/commonjs/RTCErrorEvent.js.map +1 -0
- package/lib/commonjs/RTCPeerConnection.js +354 -103
- package/lib/commonjs/RTCPeerConnection.js.map +1 -1
- package/lib/commonjs/RTCRtcpParameters.js +24 -0
- package/lib/commonjs/RTCRtcpParameters.js.map +1 -0
- package/lib/commonjs/RTCRtpCapabilities.js +79 -0
- package/lib/commonjs/RTCRtpCapabilities.js.map +1 -0
- package/lib/commonjs/RTCRtpCodecCapability.js +25 -0
- package/lib/commonjs/RTCRtpCodecCapability.js.map +1 -0
- package/lib/commonjs/RTCRtpCodecParameters.js +33 -0
- package/lib/commonjs/RTCRtpCodecParameters.js.map +1 -0
- package/lib/commonjs/RTCRtpEncodingParameters.js +81 -0
- package/lib/commonjs/RTCRtpEncodingParameters.js.map +1 -0
- package/lib/commonjs/RTCRtpHeaderExtension.js +27 -0
- package/lib/commonjs/RTCRtpHeaderExtension.js.map +1 -0
- package/lib/commonjs/RTCRtpParameters.js +26 -0
- package/lib/commonjs/RTCRtpParameters.js.map +1 -0
- package/lib/commonjs/RTCRtpReceiveParameters.js +20 -0
- package/lib/commonjs/RTCRtpReceiveParameters.js.map +1 -0
- package/lib/commonjs/RTCRtpReceiver.js +51 -0
- package/lib/commonjs/RTCRtpReceiver.js.map +1 -0
- package/lib/commonjs/RTCRtpSendParameters.js +60 -0
- package/lib/commonjs/RTCRtpSendParameters.js.map +1 -0
- package/lib/commonjs/RTCRtpSender.js +85 -0
- package/lib/commonjs/RTCRtpSender.js.map +1 -0
- package/lib/commonjs/RTCRtpTransceiver.js +141 -0
- package/lib/commonjs/RTCRtpTransceiver.js.map +1 -0
- package/lib/commonjs/RTCSessionDescription.js.map +1 -1
- package/lib/commonjs/RTCTrackEvent.js +32 -0
- package/lib/commonjs/RTCTrackEvent.js.map +1 -0
- package/lib/commonjs/RTCUtil.js +20 -37
- package/lib/commonjs/RTCUtil.js.map +1 -1
- package/lib/commonjs/getDisplayMedia.js.map +1 -1
- package/lib/commonjs/getUserMedia.js.map +1 -1
- package/lib/commonjs/index.js +127 -3
- package/lib/commonjs/index.js.map +1 -1
- package/lib/module/EventEmitter.js +21 -0
- package/lib/module/EventEmitter.js.map +1 -1
- package/lib/module/Logger.js +53 -0
- package/lib/module/Logger.js.map +1 -0
- package/lib/module/MediaStream.js +1 -1
- package/lib/module/MediaStream.js.map +1 -1
- package/lib/module/MediaStreamTrack.js +4 -2
- package/lib/module/MediaStreamTrack.js.map +1 -1
- package/lib/module/Permissions.js +1 -1
- package/lib/module/Permissions.js.map +1 -1
- package/lib/module/RTCDataChannel.js.map +1 -1
- package/lib/module/RTCErrorEvent.js +22 -0
- package/lib/module/RTCErrorEvent.js.map +1 -0
- package/lib/module/RTCPeerConnection.js +348 -103
- package/lib/module/RTCPeerConnection.js.map +1 -1
- package/lib/module/RTCRtcpParameters.js +15 -0
- package/lib/module/RTCRtcpParameters.js.map +1 -0
- package/lib/module/RTCRtpCapabilities.js +63 -0
- package/lib/module/RTCRtpCapabilities.js.map +1 -0
- package/lib/module/RTCRtpCodecCapability.js +16 -0
- package/lib/module/RTCRtpCodecCapability.js.map +1 -0
- package/lib/module/RTCRtpCodecParameters.js +24 -0
- package/lib/module/RTCRtpCodecParameters.js.map +1 -0
- package/lib/module/RTCRtpEncodingParameters.js +72 -0
- package/lib/module/RTCRtpEncodingParameters.js.map +1 -0
- package/lib/module/RTCRtpHeaderExtension.js +18 -0
- package/lib/module/RTCRtpHeaderExtension.js.map +1 -0
- package/lib/module/RTCRtpParameters.js +17 -0
- package/lib/module/RTCRtpParameters.js.map +1 -0
- package/lib/module/RTCRtpReceiveParameters.js +8 -0
- package/lib/module/RTCRtpReceiveParameters.js.map +1 -0
- package/lib/module/RTCRtpReceiver.js +39 -0
- package/lib/module/RTCRtpReceiver.js.map +1 -0
- package/lib/module/RTCRtpSendParameters.js +49 -0
- package/lib/module/RTCRtpSendParameters.js.map +1 -0
- package/lib/module/RTCRtpSender.js +70 -0
- package/lib/module/RTCRtpSender.js.map +1 -0
- package/lib/module/RTCRtpTransceiver.js +125 -0
- package/lib/module/RTCRtpTransceiver.js.map +1 -0
- package/lib/module/RTCSessionDescription.js.map +1 -1
- package/lib/module/RTCTrackEvent.js +23 -0
- package/lib/module/RTCTrackEvent.js.map +1 -0
- package/lib/module/RTCUtil.js +18 -36
- package/lib/module/RTCUtil.js.map +1 -1
- package/lib/module/getDisplayMedia.js.map +1 -1
- package/lib/module/getUserMedia.js.map +1 -1
- package/lib/module/index.js +35 -4
- package/lib/module/index.js.map +1 -1
- package/lib/typescript/EventEmitter.d.ts +3 -0
- package/lib/typescript/Logger.d.ts +13 -0
- package/lib/typescript/MediaDevices.d.ts +2 -2
- package/lib/typescript/MediaStream.d.ts +6 -6
- package/lib/typescript/MediaStreamTrack.d.ts +10 -9
- package/lib/typescript/RTCDataChannel.d.ts +4 -2
- package/lib/typescript/RTCErrorEvent.d.ts +12 -0
- package/lib/typescript/RTCPeerConnection.d.ts +42 -11
- package/lib/typescript/RTCRtcpParameters.d.ts +8 -0
- package/lib/typescript/RTCRtpCapabilities.d.ts +19 -0
- package/lib/typescript/RTCRtpCodecCapability.d.ts +7 -0
- package/lib/typescript/RTCRtpCodecParameters.d.ts +14 -0
- package/lib/typescript/RTCRtpEncodingParameters.d.ts +21 -0
- package/lib/typescript/RTCRtpHeaderExtension.d.ts +10 -0
- package/lib/typescript/RTCRtpParameters.d.ts +14 -0
- package/lib/typescript/RTCRtpReceiveParameters.d.ts +4 -0
- package/lib/typescript/RTCRtpReceiver.d.ts +15 -0
- package/lib/typescript/RTCRtpSendParameters.d.ts +17 -0
- package/lib/typescript/RTCRtpSender.d.ts +21 -0
- package/lib/typescript/RTCRtpTransceiver.d.ts +35 -0
- package/lib/typescript/RTCTrackEvent.d.ts +15 -0
- package/lib/typescript/RTCUtil.d.ts +5 -9
- package/lib/typescript/getDisplayMedia.d.ts +2 -1
- package/lib/typescript/getUserMedia.d.ts +2 -1
- package/lib/typescript/index.d.ts +16 -3
- package/package.json +6 -4
- package/react-native-webrtc.podspec +1 -1
- package/src/EventEmitter.ts +21 -1
- package/src/Logger.ts +49 -0
- package/src/MediaStream.ts +11 -11
- package/src/MediaStreamTrack.ts +14 -13
- package/src/Permissions.ts +1 -1
- package/src/RTCDataChannel.ts +11 -8
- package/src/RTCErrorEvent.ts +21 -0
- package/src/RTCPeerConnection.ts +400 -158
- package/src/RTCRtcpParameters.ts +14 -0
- package/src/RTCRtpCapabilities.ts +54 -0
- package/src/RTCRtpCodecCapability.ts +13 -0
- package/src/RTCRtpCodecParameters.ts +23 -0
- package/src/RTCRtpEncodingParameters.ts +67 -0
- package/src/RTCRtpHeaderExtension.ts +18 -0
- package/src/RTCRtpParameters.ts +21 -0
- package/src/RTCRtpReceiveParameters.ts +7 -0
- package/src/RTCRtpReceiver.ts +35 -0
- package/src/RTCRtpSendParameters.ts +51 -0
- package/src/RTCRtpSender.ts +72 -0
- package/src/RTCRtpTransceiver.ts +125 -0
- package/src/RTCSessionDescription.ts +3 -3
- package/src/RTCTrackEvent.ts +21 -0
- package/src/RTCUtil.ts +20 -40
- package/src/getDisplayMedia.ts +1 -1
- package/src/getUserMedia.ts +2 -2
- package/src/index.ts +51 -6
- package/tools/build-webrtc.py +32 -33
- package/tools/downloadBitcode.sh +2 -12
- package/tools/downloadWebRTC.js +21 -12
package/src/getUserMedia.ts
CHANGED
|
@@ -13,7 +13,7 @@ interface Constraints {
|
|
|
13
13
|
video?: boolean | object;
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
export default function getUserMedia(constraints: Constraints = {}) {
|
|
16
|
+
export default function getUserMedia(constraints: Constraints = {}): Promise<MediaStream> {
|
|
17
17
|
// According to
|
|
18
18
|
// https://www.w3.org/TR/mediacapture-streams/#dom-mediadevices-getusermedia,
|
|
19
19
|
// the constraints argument is a dictionary of type MediaStreamConstraints.
|
|
@@ -32,7 +32,7 @@ export default function getUserMedia(constraints: Constraints = {}) {
|
|
|
32
32
|
constraints = RTCUtil.normalizeConstraints(constraints);
|
|
33
33
|
|
|
34
34
|
// Request required permissions
|
|
35
|
-
const reqPermissions:
|
|
35
|
+
const reqPermissions: Promise<boolean>[] = [];
|
|
36
36
|
if (constraints.audio) {
|
|
37
37
|
reqPermissions.push(permissions.request({ name: 'microphone' }));
|
|
38
38
|
} else {
|
package/src/index.ts
CHANGED
|
@@ -1,19 +1,49 @@
|
|
|
1
|
-
import ScreenCapturePickerView from './ScreenCapturePickerView';
|
|
2
|
-
import RTCPeerConnection from './RTCPeerConnection';
|
|
3
1
|
import RTCIceCandidate from './RTCIceCandidate';
|
|
2
|
+
import RTCPeerConnection from './RTCPeerConnection';
|
|
3
|
+
import RTCRtpReceiver from './RTCRtpReceiver';
|
|
4
|
+
import RTCRtpSender from './RTCRtpSender';
|
|
5
|
+
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';
|
|
4
15
|
import RTCSessionDescription from './RTCSessionDescription';
|
|
16
|
+
import RTCErrorEvent from './RTCErrorEvent';
|
|
5
17
|
import RTCView from './RTCView';
|
|
18
|
+
import ScreenCapturePickerView from './ScreenCapturePickerView';
|
|
6
19
|
import MediaStream from './MediaStream';
|
|
7
20
|
import MediaStreamTrack from './MediaStreamTrack';
|
|
8
21
|
import mediaDevices from './MediaDevices';
|
|
9
22
|
import permissions from './Permissions';
|
|
23
|
+
import Logger from './Logger';
|
|
24
|
+
|
|
25
|
+
Logger.enable('*');
|
|
26
|
+
//Logger.enable(`*,-${Logger.ROOT_PREFIX}:*:DEBUG`);
|
|
10
27
|
|
|
11
28
|
export {
|
|
12
|
-
ScreenCapturePickerView,
|
|
13
|
-
RTCPeerConnection,
|
|
14
29
|
RTCIceCandidate,
|
|
30
|
+
RTCPeerConnection,
|
|
15
31
|
RTCSessionDescription,
|
|
16
32
|
RTCView,
|
|
33
|
+
ScreenCapturePickerView,
|
|
34
|
+
RTCRtpTransceiver,
|
|
35
|
+
RTCRtpReceiver,
|
|
36
|
+
RTCRtpSender,
|
|
37
|
+
RTCErrorEvent,
|
|
38
|
+
RTCRtpCapabilities,
|
|
39
|
+
RTCRtpCodecCapability,
|
|
40
|
+
RTCRtpCodecParameters,
|
|
41
|
+
RTCRtpEncodingParameters,
|
|
42
|
+
RTCRtpParameters,
|
|
43
|
+
RTCRtpSendParameters,
|
|
44
|
+
RTCRtpReceiveParameters,
|
|
45
|
+
RTCRtcpParameters,
|
|
46
|
+
RTCRtpHeaderExtension,
|
|
17
47
|
MediaStream,
|
|
18
48
|
MediaStreamTrack,
|
|
19
49
|
mediaDevices,
|
|
@@ -21,7 +51,7 @@ export {
|
|
|
21
51
|
registerGlobals
|
|
22
52
|
};
|
|
23
53
|
|
|
24
|
-
function registerGlobals() {
|
|
54
|
+
function registerGlobals(): void {
|
|
25
55
|
// Should not happen. React Native has a global navigator object.
|
|
26
56
|
if (typeof global.navigator !== 'object') {
|
|
27
57
|
throw new Error('navigator is not an object');
|
|
@@ -35,9 +65,24 @@ function registerGlobals() {
|
|
|
35
65
|
global.navigator.mediaDevices.getDisplayMedia = mediaDevices.getDisplayMedia.bind(mediaDevices);
|
|
36
66
|
global.navigator.mediaDevices.enumerateDevices = mediaDevices.enumerateDevices.bind(mediaDevices);
|
|
37
67
|
|
|
38
|
-
global.RTCPeerConnection = RTCPeerConnection;
|
|
39
68
|
global.RTCIceCandidate = RTCIceCandidate;
|
|
69
|
+
global.RTCPeerConnection = RTCPeerConnection;
|
|
70
|
+
global.RTCRtpReceiver = RTCRtpReceiver;
|
|
71
|
+
global.RTCRtpSender = RTCRtpReceiver;
|
|
40
72
|
global.RTCSessionDescription = RTCSessionDescription;
|
|
41
73
|
global.MediaStream = MediaStream;
|
|
42
74
|
global.MediaStreamTrack = MediaStreamTrack;
|
|
75
|
+
global.RTCRtpTransceiver = RTCRtpTransceiver;
|
|
76
|
+
global.RTCRtpReceiver = RTCRtpReceiver;
|
|
77
|
+
global.RTCRtpSender = RTCRtpSender;
|
|
78
|
+
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;
|
|
43
88
|
}
|
package/tools/build-webrtc.py
CHANGED
|
@@ -10,6 +10,9 @@ import sys
|
|
|
10
10
|
|
|
11
11
|
# Constants
|
|
12
12
|
|
|
13
|
+
APPLE_FRAMEWORK_NAME = 'WebRTC.framework'
|
|
14
|
+
APPLE_DSYM_NAME = 'WebRTC.dSYM'
|
|
15
|
+
|
|
13
16
|
ANDROID_CPU_ABI_MAP = {
|
|
14
17
|
'arm' : 'armeabi-v7a',
|
|
15
18
|
'arm64' : 'arm64-v8a',
|
|
@@ -35,10 +38,7 @@ def build_gn_args(platform_args):
|
|
|
35
38
|
return "--args='" + ' '.join(GN_COMMON_ARGS + platform_args) + "'"
|
|
36
39
|
|
|
37
40
|
GN_COMMON_ARGS = [
|
|
38
|
-
'is_component_build=false',
|
|
39
41
|
'rtc_libvpx_build_vp9=true',
|
|
40
|
-
'rtc_build_dcsctp=true',
|
|
41
|
-
'rtc_build_usrsctp=false',
|
|
42
42
|
'rtc_enable_protobuf=false',
|
|
43
43
|
'rtc_include_tests=false',
|
|
44
44
|
'is_debug=%s',
|
|
@@ -46,7 +46,7 @@ GN_COMMON_ARGS = [
|
|
|
46
46
|
]
|
|
47
47
|
|
|
48
48
|
_GN_APPLE_COMMON = [
|
|
49
|
-
'enable_dsyms=
|
|
49
|
+
'enable_dsyms=true',
|
|
50
50
|
'enable_stripping=true',
|
|
51
51
|
'rtc_enable_symbol_export=false',
|
|
52
52
|
'rtc_enable_objc_symbol_export=true',
|
|
@@ -54,11 +54,8 @@ _GN_APPLE_COMMON = [
|
|
|
54
54
|
]
|
|
55
55
|
|
|
56
56
|
_GN_IOS_ARGS = [
|
|
57
|
-
'enable_ios_bitcode=true',
|
|
58
57
|
'ios_deployment_target="12.0"',
|
|
59
58
|
'ios_enable_code_signing=false',
|
|
60
|
-
'use_lld=false',
|
|
61
|
-
'use_custom_libcxx=false',
|
|
62
59
|
'target_os="ios"',
|
|
63
60
|
'target_environment="%s"'
|
|
64
61
|
]
|
|
@@ -233,21 +230,38 @@ def build(target_dir, platform, debug):
|
|
|
233
230
|
simulators = [item for item in IOS_BUILD_ARCHS if item.startswith('simulator')]
|
|
234
231
|
tenv, arch = simulators[0].split(':')
|
|
235
232
|
gn_out_dir = 'out/%s-ios-%s-%s' % (build_type, tenv, arch)
|
|
236
|
-
|
|
237
|
-
|
|
233
|
+
|
|
234
|
+
shutil.copytree(os.path.join(gn_out_dir, APPLE_FRAMEWORK_NAME), os.path.join(gn_out_dir, 'fat-' + APPLE_FRAMEWORK_NAME))
|
|
235
|
+
out_lib_path = os.path.join(gn_out_dir, 'fat-' + APPLE_FRAMEWORK_NAME, 'WebRTC')
|
|
238
236
|
slice_paths = []
|
|
239
237
|
for item in simulators:
|
|
240
238
|
tenv, arch = item.split(':')
|
|
241
|
-
lib_path = os.path.join('out/%s-ios-%s-%s' % (build_type, tenv, arch),
|
|
239
|
+
lib_path = os.path.join('out/%s-ios-%s-%s' % (build_type, tenv, arch), APPLE_FRAMEWORK_NAME, 'WebRTC')
|
|
242
240
|
slice_paths.append(lib_path)
|
|
243
241
|
sh('lipo %s -create -output %s' % (' '.join(slice_paths), out_lib_path))
|
|
244
242
|
|
|
245
|
-
orig_framework_path = os.path.join(gn_out_dir,
|
|
246
|
-
bak_framework_path = os.path.join(gn_out_dir, 'bak-
|
|
247
|
-
fat_framework_path = os.path.join(gn_out_dir, 'fat-
|
|
243
|
+
orig_framework_path = os.path.join(gn_out_dir, APPLE_FRAMEWORK_NAME)
|
|
244
|
+
bak_framework_path = os.path.join(gn_out_dir, 'bak-' + APPLE_FRAMEWORK_NAME)
|
|
245
|
+
fat_framework_path = os.path.join(gn_out_dir, 'fat-' + APPLE_FRAMEWORK_NAME)
|
|
248
246
|
shutil.move(orig_framework_path, bak_framework_path)
|
|
249
247
|
shutil.move(fat_framework_path, orig_framework_path)
|
|
250
248
|
|
|
249
|
+
# dSYMs
|
|
250
|
+
shutil.copytree(os.path.join(gn_out_dir, APPLE_DSYM_NAME), os.path.join(gn_out_dir, 'fat-' + APPLE_DSYM_NAME))
|
|
251
|
+
out_dsym_path = os.path.join(gn_out_dir, 'fat-' + APPLE_DSYM_NAME, 'Contents', 'Resources', 'DWARF', 'WebRTC')
|
|
252
|
+
slice_paths = []
|
|
253
|
+
for item in simulators:
|
|
254
|
+
tenv, arch = item.split(':')
|
|
255
|
+
dsym_path = os.path.join('out/%s-ios-%s-%s' % (build_type, tenv, arch), APPLE_DSYM_NAME, 'Contents', 'Resources', 'DWARF', 'WebRTC')
|
|
256
|
+
slice_paths.append(dsym_path)
|
|
257
|
+
sh('lipo %s -create -output %s' % (' '.join(slice_paths), out_dsym_path))
|
|
258
|
+
|
|
259
|
+
orig_dsym_path = os.path.join(gn_out_dir, APPLE_DSYM_NAME)
|
|
260
|
+
bak_dsym_path = os.path.join(gn_out_dir, 'bak-' + APPLE_DSYM_NAME)
|
|
261
|
+
fat_dsym_path = os.path.join(gn_out_dir, 'fat-' + APPLE_DSYM_NAME)
|
|
262
|
+
shutil.move(orig_dsym_path, bak_dsym_path)
|
|
263
|
+
shutil.move(fat_dsym_path, orig_dsym_path)
|
|
264
|
+
|
|
251
265
|
_IOS_BUILD_ARCHS = [item for item in IOS_BUILD_ARCHS if not item.startswith('simulator')]
|
|
252
266
|
_IOS_BUILD_ARCHS.append(simulators[0])
|
|
253
267
|
|
|
@@ -257,28 +271,13 @@ def build(target_dir, platform, debug):
|
|
|
257
271
|
for item in _IOS_BUILD_ARCHS:
|
|
258
272
|
tenv, arch = item.split(':')
|
|
259
273
|
gn_out_dir = 'out/%s-ios-%s-%s' % (build_type, tenv, arch)
|
|
260
|
-
xcodebuild_cmd += ' -framework %s' % os.path.join(gn_out_dir,
|
|
261
|
-
|
|
262
|
-
# gn_out_dir = 'out/%s-macos-%s' % (build_type, arch)
|
|
263
|
-
# xcodebuild_cmd += ' -framework %s' % os.path.join(gn_out_dir, 'WebRTC.framework')
|
|
264
|
-
sh(xcodebuild_cmd)
|
|
265
|
-
sh('tar zcf WebRTC.xcframework-bitcode.tgz WebRTC.xcframework', cwd=build_dir)
|
|
266
|
-
rmr(xcframework_path)
|
|
267
|
-
|
|
268
|
-
# XCFramework (stripped)
|
|
269
|
-
xcodebuild_cmd = 'xcodebuild -create-xcframework -output %s' % xcframework_path
|
|
270
|
-
bitcode_strip_cmd = 'xcrun bitcode_strip -r %s -o %s'
|
|
271
|
-
for item in _IOS_BUILD_ARCHS:
|
|
272
|
-
tenv, arch = item.split(':')
|
|
273
|
-
gn_out_dir = 'out/%s-ios-%s-%s' % (build_type, tenv, arch)
|
|
274
|
-
xcodebuild_cmd += ' -framework %s' % os.path.join(gn_out_dir, 'WebRTC.framework')
|
|
275
|
-
framework_path = os.path.join(gn_out_dir, 'WebRTC.framework', 'WebRTC')
|
|
276
|
-
sh(bitcode_strip_cmd % (framework_path, framework_path))
|
|
274
|
+
xcodebuild_cmd += ' -framework %s' % os.path.abspath(os.path.join(gn_out_dir, APPLE_FRAMEWORK_NAME))
|
|
275
|
+
xcodebuild_cmd += ' -debug-symbols %s' % os.path.abspath(os.path.join(gn_out_dir, APPLE_DSYM_NAME))
|
|
277
276
|
#for arch in MACOS_BUILD_ARCHS:
|
|
278
277
|
# gn_out_dir = 'out/%s-macos-%s' % (build_type, arch)
|
|
279
|
-
# xcodebuild_cmd += ' -framework %s' % os.path.join(gn_out_dir,
|
|
278
|
+
# xcodebuild_cmd += ' -framework %s' % os.path.join(gn_out_dir, APPLE_FRAMEWORK_NAME)
|
|
280
279
|
sh(xcodebuild_cmd)
|
|
281
|
-
sh('
|
|
280
|
+
sh('zip -r WebRTC.xcframework.zip WebRTC.xcframework', cwd=build_dir)
|
|
282
281
|
rmr(xcframework_path)
|
|
283
282
|
else:
|
|
284
283
|
gn_out_dir = 'out/%s-%s' % (build_type, ANDROID_BUILD_CPUS[0])
|
|
@@ -292,7 +291,7 @@ def build(target_dir, platform, debug):
|
|
|
292
291
|
|
|
293
292
|
sh('jar cvfM libjingle_peerconnection.so.jar lib', cwd=build_dir)
|
|
294
293
|
rmr(os.path.join(build_dir, 'lib'))
|
|
295
|
-
sh('
|
|
294
|
+
sh('zip -r android-webrtc.zip *.jar', cwd=build_dir)
|
|
296
295
|
|
|
297
296
|
|
|
298
297
|
if __name__ == "__main__":
|
package/tools/downloadBitcode.sh
CHANGED
|
@@ -1,14 +1,4 @@
|
|
|
1
1
|
#!/bin/bash
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
THIS_DIR=$(cd -P "$(dirname "$(readlink "${BASH_SOURCE[0]}" || echo "${BASH_SOURCE[0]}")")" && pwd)
|
|
6
|
-
|
|
7
|
-
pushd ${THIS_DIR}
|
|
8
|
-
|
|
9
|
-
export RN_WEBRTC_BITCODE=1
|
|
10
|
-
export RN_WEBRTC_FORCE_DOWNLOAD=1
|
|
11
|
-
|
|
12
|
-
node downloadWebRTC.js
|
|
13
|
-
|
|
14
|
-
popd
|
|
3
|
+
echo "Bitcode is deprecated since Xcode 14."
|
|
4
|
+
echo "This package no longer provides bitcode."
|
package/tools/downloadWebRTC.js
CHANGED
|
@@ -3,6 +3,8 @@ const fs = require('fs');
|
|
|
3
3
|
const https = require('https');
|
|
4
4
|
const path = require('path');
|
|
5
5
|
const process = require('process');
|
|
6
|
+
|
|
7
|
+
const AdmZip = require('adm-zip');
|
|
6
8
|
const tar = require('tar');
|
|
7
9
|
|
|
8
10
|
const pkg = require('../package.json');
|
|
@@ -53,12 +55,11 @@ async function download(url, filePath) {
|
|
|
53
55
|
//
|
|
54
56
|
|
|
55
57
|
if (process.platform === 'darwin') {
|
|
56
|
-
const
|
|
57
|
-
const url = bitcode ? builds['ios-bitcode'] : builds['ios'];
|
|
58
|
+
const iosUrl = builds['ios'];
|
|
58
59
|
|
|
59
60
|
items.push({
|
|
60
|
-
url,
|
|
61
|
-
dstFileName:
|
|
61
|
+
url: iosUrl,
|
|
62
|
+
dstFileName: path.basename(iosUrl),
|
|
62
63
|
dstDir: `${__dirname}/../apple/`
|
|
63
64
|
});
|
|
64
65
|
}
|
|
@@ -66,9 +67,11 @@ async function download(url, filePath) {
|
|
|
66
67
|
// Android
|
|
67
68
|
//
|
|
68
69
|
|
|
70
|
+
const androidUrl = builds['android'];
|
|
71
|
+
|
|
69
72
|
items.push({
|
|
70
|
-
url:
|
|
71
|
-
dstFileName:
|
|
73
|
+
url: androidUrl,
|
|
74
|
+
dstFileName: path.basename(androidUrl),
|
|
72
75
|
dstDir: `${__dirname}/../android/libs/`
|
|
73
76
|
});
|
|
74
77
|
|
|
@@ -88,12 +91,18 @@ async function download(url, filePath) {
|
|
|
88
91
|
|
|
89
92
|
await download(url, dstPath);
|
|
90
93
|
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
94
|
+
if (path.extname(dstPath) === '.zip') {
|
|
95
|
+
const zip = AdmZip(dstPath);
|
|
96
|
+
|
|
97
|
+
zip.extractAllTo(dstDir, true);
|
|
98
|
+
} else {
|
|
99
|
+
tar.extract({
|
|
100
|
+
file: dstPath,
|
|
101
|
+
cwd: dstDir,
|
|
102
|
+
sync: true,
|
|
103
|
+
strict: true
|
|
104
|
+
});
|
|
105
|
+
}
|
|
97
106
|
|
|
98
107
|
console.log('Done!');
|
|
99
108
|
}
|