react-native-webrtc 1.100.1 → 1.106.0
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 +45 -127
- package/android/src/main/java/com/oney/WebRTCModule/WebRTCModule.java +4 -8
- package/ios/RCTWebRTC/RCTConvert+WebRTC.m +1 -4
- package/ios/RCTWebRTC/ScreenCapturer.m +0 -1
- package/lib/commonjs/MediaStream.js +1 -1
- package/lib/commonjs/MediaStream.js.map +1 -1
- 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/RTCPeerConnection.js.map +1 -1
- package/lib/commonjs/RTCSessionDescription.js.map +1 -1
- package/lib/commonjs/RTCUtil.js +15 -32
- 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.map +1 -1
- package/lib/module/MediaStream.js +1 -1
- package/lib/module/MediaStream.js.map +1 -1
- 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/RTCPeerConnection.js.map +1 -1
- package/lib/module/RTCSessionDescription.js.map +1 -1
- package/lib/module/RTCUtil.js +14 -32
- 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.map +1 -1
- package/lib/typescript/MediaDevices.d.ts +2 -2
- package/lib/typescript/MediaStream.d.ts +6 -6
- package/lib/typescript/MediaStreamTrack.d.ts +5 -5
- package/lib/typescript/RTCDataChannel.d.ts +4 -2
- package/lib/typescript/RTCPeerConnection.d.ts +3 -3
- package/lib/typescript/RTCUtil.d.ts +4 -8
- package/lib/typescript/getDisplayMedia.d.ts +2 -1
- package/lib/typescript/getUserMedia.d.ts +2 -1
- package/package.json +3 -4
- package/react-native-webrtc.podspec +2 -3
- package/src/MediaStream.ts +11 -11
- package/src/MediaStreamTrack.ts +6 -6
- package/src/Permissions.ts +1 -1
- package/src/RTCDataChannel.ts +11 -8
- package/src/RTCPeerConnection.ts +11 -11
- package/src/RTCSessionDescription.ts +3 -3
- package/src/RTCUtil.ts +17 -37
- package/src/getDisplayMedia.ts +1 -1
- package/src/getUserMedia.ts +2 -2
- package/src/index.ts +1 -1
- package/tools/build-webrtc.py +32 -33
- package/tools/downloadBitcode.sh +3 -12
- package/tools/downloadWebRTC.js +26 -15
package/src/RTCPeerConnection.ts
CHANGED
|
@@ -64,9 +64,9 @@ export default class RTCPeerConnection extends defineCustomEventTarget(...PEER_C
|
|
|
64
64
|
iceConnectionState: RTCIceConnectionState = 'new';
|
|
65
65
|
|
|
66
66
|
_peerConnectionId: number;
|
|
67
|
-
_localStreams:
|
|
68
|
-
_remoteStreams:
|
|
69
|
-
_subscriptions:
|
|
67
|
+
_localStreams: MediaStream[] = [];
|
|
68
|
+
_remoteStreams: MediaStream[] = [];
|
|
69
|
+
_subscriptions: any[] = [];
|
|
70
70
|
|
|
71
71
|
constructor(configuration) {
|
|
72
72
|
super();
|
|
@@ -75,7 +75,7 @@ export default class RTCPeerConnection extends defineCustomEventTarget(...PEER_C
|
|
|
75
75
|
this._registerEvents();
|
|
76
76
|
}
|
|
77
77
|
|
|
78
|
-
addStream(stream: MediaStream) {
|
|
78
|
+
addStream(stream: MediaStream): void {
|
|
79
79
|
const index = this._localStreams.indexOf(stream);
|
|
80
80
|
if (index !== -1) {
|
|
81
81
|
return;
|
|
@@ -84,7 +84,7 @@ export default class RTCPeerConnection extends defineCustomEventTarget(...PEER_C
|
|
|
84
84
|
this._localStreams.push(stream);
|
|
85
85
|
}
|
|
86
86
|
|
|
87
|
-
removeStream(stream: MediaStream) {
|
|
87
|
+
removeStream(stream: MediaStream): void {
|
|
88
88
|
const index = this._localStreams.indexOf(stream);
|
|
89
89
|
if (index === -1) {
|
|
90
90
|
return;
|
|
@@ -125,7 +125,7 @@ export default class RTCPeerConnection extends defineCustomEventTarget(...PEER_C
|
|
|
125
125
|
});
|
|
126
126
|
}
|
|
127
127
|
|
|
128
|
-
setConfiguration(configuration) {
|
|
128
|
+
setConfiguration(configuration): void {
|
|
129
129
|
WebRTCModule.peerConnectionSetConfiguration(configuration, this._peerConnectionId);
|
|
130
130
|
}
|
|
131
131
|
|
|
@@ -188,19 +188,19 @@ export default class RTCPeerConnection extends defineCustomEventTarget(...PEER_C
|
|
|
188
188
|
});
|
|
189
189
|
}
|
|
190
190
|
|
|
191
|
-
getLocalStreams() {
|
|
191
|
+
getLocalStreams(): MediaStream[] {
|
|
192
192
|
return this._localStreams.slice();
|
|
193
193
|
}
|
|
194
194
|
|
|
195
|
-
getRemoteStreams() {
|
|
195
|
+
getRemoteStreams(): MediaStream[] {
|
|
196
196
|
return this._remoteStreams.slice();
|
|
197
197
|
}
|
|
198
198
|
|
|
199
|
-
close() {
|
|
199
|
+
close(): void {
|
|
200
200
|
WebRTCModule.peerConnectionClose(this._peerConnectionId);
|
|
201
201
|
}
|
|
202
202
|
|
|
203
|
-
restartIce() {
|
|
203
|
+
restartIce(): void {
|
|
204
204
|
WebRTCModule.peerConnectionRestartIce(this._peerConnectionId);
|
|
205
205
|
}
|
|
206
206
|
|
|
@@ -339,7 +339,7 @@ export default class RTCPeerConnection extends defineCustomEventTarget(...PEER_C
|
|
|
339
339
|
* values with which to initialize corresponding attributes of the new
|
|
340
340
|
* instance such as id
|
|
341
341
|
*/
|
|
342
|
-
createDataChannel(label: string, dataChannelDict?: RTCDataChannelInit) {
|
|
342
|
+
createDataChannel(label: string, dataChannelDict?: RTCDataChannelInit): RTCDataChannel {
|
|
343
343
|
if (dataChannelDict && 'id' in dataChannelDict) {
|
|
344
344
|
const id = dataChannelDict.id;
|
|
345
345
|
if (typeof id !== 'number') {
|
|
@@ -8,15 +8,15 @@ export default class RTCSessionDescription {
|
|
|
8
8
|
this._type = info.type;
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
get sdp() {
|
|
11
|
+
get sdp(): string {
|
|
12
12
|
return this._sdp;
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
get type() {
|
|
15
|
+
get type(): string | null {
|
|
16
16
|
return this._type;
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
-
toJSON() {
|
|
19
|
+
toJSON(): { sdp: string, type: string | null } {
|
|
20
20
|
return {
|
|
21
21
|
sdp: this._sdp,
|
|
22
22
|
type: this._type
|
package/src/RTCUtil.ts
CHANGED
|
@@ -8,6 +8,8 @@ const DEFAULT_VIDEO_CONSTRAINTS = {
|
|
|
8
8
|
width: 1280
|
|
9
9
|
};
|
|
10
10
|
|
|
11
|
+
const FACING_MODES = [ 'user', 'environment' ];
|
|
12
|
+
|
|
11
13
|
const ASPECT_RATIO = 16 / 9;
|
|
12
14
|
|
|
13
15
|
const STANDARD_OA_OPTIONS = {
|
|
@@ -63,32 +65,19 @@ function normalizeMediaConstraints(constraints, mediaType) {
|
|
|
63
65
|
case 'audio':
|
|
64
66
|
return constraints;
|
|
65
67
|
case 'video': {
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
height: extractNumber(constraints.mandatory, 'minHeight'),
|
|
74
|
-
width: extractNumber(constraints.mandatory, 'minWidth')
|
|
75
|
-
};
|
|
76
|
-
} else {
|
|
77
|
-
// New style.
|
|
78
|
-
c = {
|
|
79
|
-
deviceId: extractString(constraints, 'deviceId'),
|
|
80
|
-
facingMode: extractString(constraints, 'facingMode'),
|
|
81
|
-
frameRate: extractNumber(constraints, 'frameRate'),
|
|
82
|
-
height: extractNumber(constraints, 'height'),
|
|
83
|
-
width: extractNumber(constraints, 'width')
|
|
84
|
-
};
|
|
85
|
-
}
|
|
68
|
+
const c = {
|
|
69
|
+
deviceId: extractString(constraints, 'deviceId'),
|
|
70
|
+
facingMode: extractString(constraints, 'facingMode'),
|
|
71
|
+
frameRate: extractNumber(constraints, 'frameRate'),
|
|
72
|
+
height: extractNumber(constraints, 'height'),
|
|
73
|
+
width: extractNumber(constraints, 'width')
|
|
74
|
+
};
|
|
86
75
|
|
|
87
76
|
if (!c.deviceId) {
|
|
88
77
|
delete c.deviceId;
|
|
89
78
|
}
|
|
90
79
|
|
|
91
|
-
if (!
|
|
80
|
+
if (!FACING_MODES.includes(c.facingMode)) {
|
|
92
81
|
c.facingMode = DEFAULT_VIDEO_CONSTRAINTS.facingMode;
|
|
93
82
|
}
|
|
94
83
|
|
|
@@ -99,9 +88,9 @@ function normalizeMediaConstraints(constraints, mediaType) {
|
|
|
99
88
|
if (!c.height && !c.width) {
|
|
100
89
|
c.height = DEFAULT_VIDEO_CONSTRAINTS.height;
|
|
101
90
|
c.width = DEFAULT_VIDEO_CONSTRAINTS.width;
|
|
102
|
-
} else if (!c.height) {
|
|
91
|
+
} else if (!c.height && c.width) {
|
|
103
92
|
c.height = Math.round(c.width / ASPECT_RATIO);
|
|
104
|
-
} else if (!c.width) {
|
|
93
|
+
} else if (!c.width && c.height) {
|
|
105
94
|
c.width = Math.round(c.height * ASPECT_RATIO);
|
|
106
95
|
}
|
|
107
96
|
|
|
@@ -129,7 +118,7 @@ function chr4() {
|
|
|
129
118
|
*
|
|
130
119
|
* @return {String} uuidv4
|
|
131
120
|
*/
|
|
132
|
-
export function uniqueID() {
|
|
121
|
+
export function uniqueID(): string {
|
|
133
122
|
return `${chr4()}${chr4()}-${chr4()}-${chr4()}-${chr4()}-${chr4()}${chr4()}${chr4()}`;
|
|
134
123
|
}
|
|
135
124
|
|
|
@@ -139,32 +128,23 @@ export function uniqueID() {
|
|
|
139
128
|
* @param {Object} obj - object to be cloned
|
|
140
129
|
* @return {Object} cloned obj
|
|
141
130
|
*/
|
|
142
|
-
export function deepClone(obj) {
|
|
131
|
+
export function deepClone<T>(obj: T): T {
|
|
143
132
|
return JSON.parse(JSON.stringify(obj));
|
|
144
133
|
}
|
|
145
134
|
|
|
146
|
-
interface Constraints {
|
|
147
|
-
mandatory?: object;
|
|
148
|
-
}
|
|
149
|
-
|
|
150
135
|
/**
|
|
151
136
|
* Normalize options passed to createOffer() / createAnswer().
|
|
152
137
|
*
|
|
153
|
-
* @param
|
|
154
|
-
* @return
|
|
138
|
+
* @param options - user supplied options
|
|
139
|
+
* @return Normalized options
|
|
155
140
|
*/
|
|
156
|
-
export function normalizeOfferAnswerOptions(options:
|
|
141
|
+
export function normalizeOfferAnswerOptions(options: object = {}): object {
|
|
157
142
|
const newOptions = {};
|
|
158
143
|
|
|
159
144
|
if (!options) {
|
|
160
145
|
return newOptions;
|
|
161
146
|
}
|
|
162
147
|
|
|
163
|
-
// Support legacy constraints.
|
|
164
|
-
if (options.mandatory) {
|
|
165
|
-
options = options.mandatory;
|
|
166
|
-
}
|
|
167
|
-
|
|
168
148
|
// Convert standard options into WebRTC internal constant names.
|
|
169
149
|
// See: https://github.com/jitsi/webrtc/blob/0cd6ce4de669bed94ba47b88cb71b9be0341bb81/sdk/media_constraints.cc#L113
|
|
170
150
|
for (const [key, value] of Object.entries(options)) {
|
package/src/getDisplayMedia.ts
CHANGED
|
@@ -6,7 +6,7 @@ import MediaStreamError from './MediaStreamError';
|
|
|
6
6
|
|
|
7
7
|
const { WebRTCModule } = NativeModules;
|
|
8
8
|
|
|
9
|
-
export default function getDisplayMedia() {
|
|
9
|
+
export default function getDisplayMedia(): Promise<MediaStream> {
|
|
10
10
|
return new Promise((resolve, reject) => {
|
|
11
11
|
WebRTCModule.getDisplayMedia().then(
|
|
12
12
|
data => {
|
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
|
@@ -21,7 +21,7 @@ export {
|
|
|
21
21
|
registerGlobals
|
|
22
22
|
};
|
|
23
23
|
|
|
24
|
-
function registerGlobals() {
|
|
24
|
+
function registerGlobals(): void {
|
|
25
25
|
// Should not happen. React Native has a global navigator object.
|
|
26
26
|
if (typeof global.navigator !== 'object') {
|
|
27
27
|
throw new Error('navigator is not an object');
|
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,5 @@
|
|
|
1
1
|
#!/bin/bash
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
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 "The current WebRTC build already contains bitcode."
|
|
5
|
+
echo "Soon this file will disappear and so will bitcode builds."
|
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,22 +55,25 @@ 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
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
60
|
+
if (iosUrl) {
|
|
61
|
+
items.push({
|
|
62
|
+
url: iosUrl,
|
|
63
|
+
dstFileName: path.basename(iosUrl),
|
|
64
|
+
dstDir: `${__dirname}/../apple/`
|
|
65
|
+
});
|
|
66
|
+
}
|
|
64
67
|
}
|
|
65
68
|
|
|
66
69
|
// Android
|
|
67
70
|
//
|
|
68
71
|
|
|
72
|
+
const androidUrl = builds['android'];
|
|
73
|
+
|
|
69
74
|
items.push({
|
|
70
|
-
url:
|
|
71
|
-
dstFileName:
|
|
75
|
+
url: androidUrl,
|
|
76
|
+
dstFileName: path.basename(androidUrl),
|
|
72
77
|
dstDir: `${__dirname}/../android/libs/`
|
|
73
78
|
});
|
|
74
79
|
|
|
@@ -88,12 +93,18 @@ async function download(url, filePath) {
|
|
|
88
93
|
|
|
89
94
|
await download(url, dstPath);
|
|
90
95
|
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
96
|
+
if (path.extname(dstPath) === '.zip') {
|
|
97
|
+
const zip = AdmZip(dstPath);
|
|
98
|
+
|
|
99
|
+
zip.extractAllTo(dstDir, true);
|
|
100
|
+
} else {
|
|
101
|
+
tar.extract({
|
|
102
|
+
file: dstPath,
|
|
103
|
+
cwd: dstDir,
|
|
104
|
+
sync: true,
|
|
105
|
+
strict: true
|
|
106
|
+
});
|
|
107
|
+
}
|
|
97
108
|
|
|
98
109
|
console.log('Done!');
|
|
99
110
|
}
|