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.
Files changed (68) hide show
  1. package/.prettierignore +9 -0
  2. package/.prettierrc.json +10 -0
  3. package/README.md +2 -1
  4. package/android/libs/.placeholder +0 -0
  5. package/android/src/main/java/com/oney/WebRTCModule/GetUserMediaImpl.java +0 -5
  6. package/android/src/main/java/com/oney/WebRTCModule/LibraryLoader.java +21 -0
  7. package/android/src/main/java/com/oney/WebRTCModule/StringUtils.java +24 -0
  8. package/android/src/main/java/com/oney/WebRTCModule/WebRTCModule.java +222 -275
  9. package/android/src/main/java/com/oney/WebRTCModule/WebRTCView.java +9 -84
  10. package/apple/.placeholder +0 -0
  11. package/ios/RCTWebRTC/VideoCaptureController.h +2 -2
  12. package/ios/RCTWebRTC/VideoCaptureController.m +131 -48
  13. package/ios/RCTWebRTC/WebRTCModule+RTCPeerConnection.m +39 -20
  14. package/metro.config.js +3 -4
  15. package/metro.config.macos.js +7 -8
  16. package/package.json +21 -12
  17. package/react-native.config.js +5 -6
  18. package/{EventEmitter.js → src/EventEmitter.js} +1 -1
  19. package/{MediaDevices.js → src/MediaDevices.js} +6 -12
  20. package/src/MediaStream.js +128 -0
  21. package/src/MediaStreamError.js +12 -0
  22. package/src/MediaStreamErrorEvent.js +11 -0
  23. package/src/MediaStreamEvent.js +11 -0
  24. package/src/MediaStreamTrack.js +104 -0
  25. package/src/MediaStreamTrackEvent.js +11 -0
  26. package/src/MessageEvent.js +10 -0
  27. package/{Permissions.js → src/Permissions.js} +26 -23
  28. package/src/RTCDataChannel.js +143 -0
  29. package/src/RTCDataChannelEvent.js +11 -0
  30. package/src/RTCEvent.js +8 -0
  31. package/src/RTCIceCandidate.js +20 -0
  32. package/src/RTCIceCandidateEvent.js +15 -0
  33. package/src/RTCPeerConnection.js +349 -0
  34. package/src/RTCSessionDescription.js +22 -0
  35. package/{RTCUtil.js → src/RTCUtil.js} +56 -57
  36. package/src/RTCView.js +60 -0
  37. package/src/ScreenCapturePickerView.js +4 -0
  38. package/{getDisplayMedia.js → src/getDisplayMedia.js} +8 -11
  39. package/src/getUserMedia.js +98 -0
  40. package/src/index.js +44 -0
  41. package/tools/build-webrtc.py +61 -49
  42. package/tools/downloadBitcode.sh +4 -16
  43. package/tools/downloadWebRTC.js +100 -0
  44. package/MediaStream.js +0 -138
  45. package/MediaStreamError.js +0 -14
  46. package/MediaStreamErrorEvent.js +0 -12
  47. package/MediaStreamEvent.js +0 -12
  48. package/MediaStreamTrack.js +0 -118
  49. package/MediaStreamTrackEvent.js +0 -12
  50. package/MessageEvent.js +0 -11
  51. package/RTCDataChannel.js +0 -161
  52. package/RTCDataChannelEvent.js +0 -12
  53. package/RTCEvent.js +0 -9
  54. package/RTCIceCandidate.js +0 -21
  55. package/RTCIceCandidateEvent.js +0 -16
  56. package/RTCPeerConnection.js +0 -379
  57. package/RTCSessionDescription.js +0 -23
  58. package/RTCView.js +0 -70
  59. package/ScreenCapturePickerView.js +0 -7
  60. package/android/libs/libjingle_peerconnection.so.jar +0 -0
  61. package/android/libs/libwebrtc.jar +0 -0
  62. package/apple/WebRTC.xcframework.tgz +0 -0
  63. package/getUserMedia.js +0 -98
  64. package/index.js +0 -47
  65. package/ios/RCTWebRTC.xcodeproj/project.xcworkspace/contents.xcworkspacedata +0 -7
  66. package/ios/RCTWebRTC.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +0 -8
  67. package/ios/RCTWebRTC.xcodeproj/project.xcworkspace/xcuserdata/saghul.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
  68. package/ios/RCTWebRTC.xcodeproj/xcuserdata/saghul.xcuserdatad/xcschemes/xcschememanagement.plist +0 -14
@@ -0,0 +1,9 @@
1
+ android
2
+ apple
3
+ examples
4
+ ios
5
+ macos
6
+ tools
7
+ Documentation
8
+ *.md
9
+ *.json
@@ -0,0 +1,10 @@
1
+ {
2
+ "printWidth": 120,
3
+ "tabWidth": 4,
4
+ "useTabs": false,
5
+ "semi": true,
6
+ "singleQuote": true,
7
+ "trailingComma": "none",
8
+ "bracketSpacing": true,
9
+ "arrowParens": "avoid"
10
+ }
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: [M89](https://github.com/jitsi/webrtc/commit/7ba1fdf35209c4cf5d2aa47d1507e097f88a07ac)
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 {