react-native-webrtc 1.92.0 → 1.94.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/.prettierignore +9 -0
- package/.prettierrc.json +10 -0
- package/README.md +2 -1
- package/android/libs/.placeholder +0 -0
- package/android/src/main/java/com/oney/WebRTCModule/GetUserMediaImpl.java +0 -5
- package/android/src/main/java/com/oney/WebRTCModule/LibraryLoader.java +21 -0
- package/android/src/main/java/com/oney/WebRTCModule/StringUtils.java +24 -0
- package/android/src/main/java/com/oney/WebRTCModule/WebRTCModule.java +222 -275
- package/android/src/main/java/com/oney/WebRTCModule/WebRTCView.java +9 -84
- package/apple/.placeholder +0 -0
- package/ios/RCTWebRTC/VideoCaptureController.h +2 -2
- package/ios/RCTWebRTC/VideoCaptureController.m +131 -48
- package/ios/RCTWebRTC/WebRTCModule+RTCPeerConnection.m +39 -20
- package/metro.config.js +3 -4
- package/metro.config.macos.js +7 -8
- package/package.json +21 -12
- package/react-native.config.js +5 -6
- package/{EventEmitter.js → src/EventEmitter.js} +1 -1
- package/{MediaDevices.js → src/MediaDevices.js} +6 -12
- package/src/MediaStream.js +128 -0
- package/src/MediaStreamError.js +12 -0
- package/src/MediaStreamErrorEvent.js +11 -0
- package/src/MediaStreamEvent.js +11 -0
- package/src/MediaStreamTrack.js +104 -0
- package/src/MediaStreamTrackEvent.js +11 -0
- package/src/MessageEvent.js +10 -0
- package/{Permissions.js → src/Permissions.js} +26 -23
- package/src/RTCDataChannel.js +143 -0
- package/src/RTCDataChannelEvent.js +11 -0
- package/src/RTCEvent.js +8 -0
- package/src/RTCIceCandidate.js +20 -0
- package/src/RTCIceCandidateEvent.js +15 -0
- package/src/RTCPeerConnection.js +349 -0
- package/src/RTCSessionDescription.js +22 -0
- package/{RTCUtil.js → src/RTCUtil.js} +56 -57
- package/src/RTCView.js +60 -0
- package/src/ScreenCapturePickerView.js +4 -0
- package/{getDisplayMedia.js → src/getDisplayMedia.js} +8 -11
- package/src/getUserMedia.js +98 -0
- package/src/index.js +44 -0
- package/tools/build-webrtc.py +61 -49
- package/tools/downloadBitcode.sh +4 -16
- package/tools/downloadWebRTC.js +100 -0
- package/MediaStream.js +0 -138
- package/MediaStreamError.js +0 -14
- package/MediaStreamErrorEvent.js +0 -12
- package/MediaStreamEvent.js +0 -12
- package/MediaStreamTrack.js +0 -118
- package/MediaStreamTrackEvent.js +0 -12
- package/MessageEvent.js +0 -11
- package/RTCDataChannel.js +0 -161
- package/RTCDataChannelEvent.js +0 -12
- package/RTCEvent.js +0 -9
- package/RTCIceCandidate.js +0 -21
- package/RTCIceCandidateEvent.js +0 -16
- package/RTCPeerConnection.js +0 -379
- package/RTCSessionDescription.js +0 -23
- package/RTCView.js +0 -70
- package/ScreenCapturePickerView.js +0 -7
- package/android/libs/libjingle_peerconnection.so.jar +0 -0
- package/android/libs/libwebrtc.jar +0 -0
- package/apple/WebRTC.xcframework.tgz +0 -0
- package/getUserMedia.js +0 -98
- package/index.js +0 -47
- package/ios/RCTWebRTC.xcodeproj/project.xcworkspace/contents.xcworkspacedata +0 -7
- package/ios/RCTWebRTC.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +0 -8
- package/ios/RCTWebRTC.xcodeproj/project.xcworkspace/xcuserdata/saghul.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
- package/ios/RCTWebRTC.xcodeproj/xcuserdata/saghul.xcuserdatad/xcschemes/xcschememanagement.plist +0 -14
package/.prettierignore
ADDED
package/.prettierrc.json
ADDED
package/README.md
CHANGED
|
@@ -15,7 +15,7 @@ Everyone is welcome to our [Discourse community](https://react-native-webrtc.dis
|
|
|
15
15
|
|
|
16
16
|
## WebRTC Revision
|
|
17
17
|
|
|
18
|
-
* Currently used revision: [
|
|
18
|
+
* Currently used revision: [M94](https://github.com/jitsi/webrtc/commit/561d58b4136684f4247ed780ce090a871be7cf75)
|
|
19
19
|
* Supported architectures
|
|
20
20
|
* Android: armeabi-v7a, arm64-v8a, x86, x86_64
|
|
21
21
|
* iOS: arm64, x86_64 (for bitcode support, run [this script](https://github.com/react-native-webrtc/react-native-webrtc/blob/master/tools/downloadBitcode.sh))
|
|
@@ -116,6 +116,7 @@ Rendering RTCView.
|
|
|
116
116
|
By calling this method the JavaScript global namespace gets "polluted" with the following additions:
|
|
117
117
|
|
|
118
118
|
* `navigator.mediaDevices.getUserMedia()`
|
|
119
|
+
* `navigator.mediaDevices.getDisplayMedia()`
|
|
119
120
|
* `navigator.mediaDevices.enumerateDevices()`
|
|
120
121
|
* `window.RTCPeerConnection`
|
|
121
122
|
* `window.RTCIceCandidate`
|
|
File without changes
|
|
@@ -180,11 +180,6 @@ class GetUserMediaImpl {
|
|
|
180
180
|
final ReadableMap constraints,
|
|
181
181
|
final Callback successCallback,
|
|
182
182
|
final Callback errorCallback) {
|
|
183
|
-
// TODO: change getUserMedia constraints format to support new syntax
|
|
184
|
-
// constraint format seems changed, and there is no mandatory any more.
|
|
185
|
-
// and has a new syntax/attrs to specify resolution
|
|
186
|
-
// should change `parseConstraints()` according
|
|
187
|
-
// see: https://www.w3.org/TR/mediacapture-streams/#idl-def-MediaTrackConstraints
|
|
188
183
|
|
|
189
184
|
AudioTrack audioTrack = null;
|
|
190
185
|
VideoTrack videoTrack = null;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
package com.oney.WebRTCModule;
|
|
2
|
+
|
|
3
|
+
import org.webrtc.Logging;
|
|
4
|
+
import org.webrtc.NativeLibraryLoader;
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Custom library loader. WebRTC's default library loader swallows errors, which
|
|
8
|
+
* makes debugging impossible if all we have is a crash log. Let it throw since
|
|
9
|
+
* the app is going to crash anyway. This way we'll have the information in the
|
|
10
|
+
* backtrace.
|
|
11
|
+
*/
|
|
12
|
+
public class LibraryLoader implements NativeLibraryLoader {
|
|
13
|
+
private static String TAG = "LibraryLoader";
|
|
14
|
+
|
|
15
|
+
@Override
|
|
16
|
+
public boolean load(String name) {
|
|
17
|
+
Logging.d(TAG, "Loading library: " + name);
|
|
18
|
+
System.loadLibrary(name);
|
|
19
|
+
return true;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
package com.oney.WebRTCModule;
|
|
2
2
|
|
|
3
|
+
import android.util.Log;
|
|
4
|
+
|
|
3
5
|
import org.webrtc.PeerConnection;
|
|
4
6
|
import org.webrtc.RTCStats;
|
|
5
7
|
import org.webrtc.RTCStatsReport;
|
|
@@ -7,6 +9,8 @@ import org.webrtc.RTCStatsReport;
|
|
|
7
9
|
import java.util.Map;
|
|
8
10
|
|
|
9
11
|
public class StringUtils {
|
|
12
|
+
private static final String TAG = StringUtils.class.getSimpleName();
|
|
13
|
+
|
|
10
14
|
/**
|
|
11
15
|
* Constructs a JSON <tt>String</tt> representation of a specific array of
|
|
12
16
|
* <tt>RTCStatsReport</tt>s (produced by {@link PeerConnection#getStats}).
|
|
@@ -74,6 +78,26 @@ public class StringUtils {
|
|
|
74
78
|
}
|
|
75
79
|
|
|
76
80
|
builder.append("]");
|
|
81
|
+
} else if (value instanceof Map) {
|
|
82
|
+
try {
|
|
83
|
+
Map<String, Object> mapValue = (Map) value;
|
|
84
|
+
|
|
85
|
+
boolean firstKey = true;
|
|
86
|
+
builder.append("{");
|
|
87
|
+
|
|
88
|
+
for (Map.Entry<String, Object> entry : mapValue.entrySet()) {
|
|
89
|
+
if (firstKey) {
|
|
90
|
+
firstKey = false;
|
|
91
|
+
} else {
|
|
92
|
+
builder.append(",");
|
|
93
|
+
}
|
|
94
|
+
builder.append("\"").append(entry.getKey()).append("\":");
|
|
95
|
+
appendValue(builder, entry.getValue());
|
|
96
|
+
}
|
|
97
|
+
builder.append("}");
|
|
98
|
+
} catch (ClassCastException e) {
|
|
99
|
+
Log.e(TAG, "Error parsing stats value " + value);
|
|
100
|
+
}
|
|
77
101
|
} else if (value instanceof String) {
|
|
78
102
|
builder.append("\"").append(value).append("\"");
|
|
79
103
|
} else {
|