react-native-webrtc 106.0.0-beta.5 → 106.0.0-beta.7

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 (53) hide show
  1. package/README.md +2 -2
  2. package/android/src/main/java/com/oney/WebRTCModule/GetUserMediaImpl.java +1 -1
  3. package/android/src/main/java/com/oney/WebRTCModule/PeerConnectionObserver.java +18 -24
  4. package/android/src/main/java/com/oney/WebRTCModule/VideoTrackAdapter.java +1 -1
  5. package/android/src/main/java/com/oney/WebRTCModule/WebRTCModule.java +59 -68
  6. package/ios/RCTWebRTC/RCTConvert+WebRTC.m +10 -0
  7. package/ios/RCTWebRTC/SerializeUtils.m +4 -2
  8. package/ios/RCTWebRTC/WebRTCModule+RTCPeerConnection.m +73 -60
  9. package/ios/RCTWebRTC/WebRTCModule+Transceivers.m +23 -22
  10. package/ios/RCTWebRTC/WebRTCModule+VideoTrackAdapter.m +1 -1
  11. package/ios/RCTWebRTC/WebRTCModule.h +0 -8
  12. package/ios/RCTWebRTC/WebRTCModule.m +1 -20
  13. package/lib/commonjs/MediaStreamTrack.js +24 -7
  14. package/lib/commonjs/MediaStreamTrack.js.map +1 -1
  15. package/lib/commonjs/RTCIceCandidate.js +14 -4
  16. package/lib/commonjs/RTCIceCandidate.js.map +1 -1
  17. package/lib/commonjs/RTCPeerConnection.js +129 -132
  18. package/lib/commonjs/RTCPeerConnection.js.map +1 -1
  19. package/lib/commonjs/RTCRtpSender.js +6 -5
  20. package/lib/commonjs/RTCRtpSender.js.map +1 -1
  21. package/lib/commonjs/RTCRtpTransceiver.js +11 -49
  22. package/lib/commonjs/RTCRtpTransceiver.js.map +1 -1
  23. package/lib/commonjs/RTCView.js +0 -55
  24. package/lib/commonjs/RTCView.js.map +1 -1
  25. package/lib/commonjs/index.js +3 -0
  26. package/lib/commonjs/index.js.map +1 -1
  27. package/lib/module/MediaStreamTrack.js +25 -8
  28. package/lib/module/MediaStreamTrack.js.map +1 -1
  29. package/lib/module/RTCIceCandidate.js +14 -4
  30. package/lib/module/RTCIceCandidate.js.map +1 -1
  31. package/lib/module/RTCPeerConnection.js +129 -130
  32. package/lib/module/RTCPeerConnection.js.map +1 -1
  33. package/lib/module/RTCRtpSender.js +6 -5
  34. package/lib/module/RTCRtpSender.js.map +1 -1
  35. package/lib/module/RTCRtpTransceiver.js +11 -44
  36. package/lib/module/RTCRtpTransceiver.js.map +1 -1
  37. package/lib/module/RTCView.js +0 -49
  38. package/lib/module/RTCView.js.map +1 -1
  39. package/lib/module/index.js +2 -0
  40. package/lib/module/index.js.map +1 -1
  41. package/lib/typescript/MediaStreamTrack.d.ts +11 -3
  42. package/lib/typescript/RTCIceCandidate.d.ts +5 -1
  43. package/lib/typescript/RTCPeerConnection.d.ts +5 -5
  44. package/lib/typescript/RTCRtpTransceiver.d.ts +2 -8
  45. package/lib/typescript/RTCView.d.ts +53 -46
  46. package/package.json +2 -2
  47. package/src/MediaStreamTrack.ts +23 -7
  48. package/src/RTCIceCandidate.ts +8 -5
  49. package/src/RTCPeerConnection.ts +133 -126
  50. package/src/RTCRtpSender.ts +6 -7
  51. package/src/RTCRtpTransceiver.ts +15 -45
  52. package/src/RTCView.ts +53 -49
  53. package/src/index.ts +2 -0
package/src/RTCView.ts CHANGED
@@ -1,5 +1,4 @@
1
-
2
- import { requireNativeComponent } from 'react-native';
1
+ import { requireNativeComponent, ViewProps } from 'react-native';
3
2
 
4
3
  /**
5
4
  * Native prop validation was removed from RN in:
@@ -8,53 +7,58 @@ import { requireNativeComponent } from 'react-native';
8
7
  * So we list them here for documentation purposes.
9
8
  */
10
9
 
11
- /**
12
- * Indicates whether the video specified by {@link #streamURL} should be
13
- * mirrored during rendering. Commonly, applications choose to mirror the
14
- * user-facing camera.
15
- *
16
- * mirror: boolean
17
- */
18
-
19
- /**
20
- * In the fashion of
21
- * https://www.w3.org/TR/html5/embedded-content-0.html#dom-video-videowidth
22
- * and https://www.w3.org/TR/html5/rendering.html#video-object-fit,
23
- * resembles the CSS style object-fit.
24
- *
25
- * objectFit: 'contain' | 'cover'
26
- */
10
+ interface RTCVideoViewProps extends ViewProps {
11
+ /**
12
+ * Indicates whether the video specified by {@link #streamURL} should be
13
+ * mirrored during rendering. Commonly, applications choose to mirror the
14
+ * user-facing camera.
15
+ *
16
+ * mirror: boolean
17
+ */
18
+ mirror?: boolean;
27
19
 
28
- /**
29
- * URL / id of the stream that should be rendered.
30
- *
31
- * streamURL: string
32
- */
20
+ /**
21
+ * In the fashion of
22
+ * https://www.w3.org/TR/html5/embedded-content-0.html#dom-video-videowidth
23
+ * and https://www.w3.org/TR/html5/rendering.html#video-object-fit,
24
+ * resembles the CSS style object-fit.
25
+ *
26
+ * objectFit: 'contain' | 'cover'
27
+ */
28
+ objectFit?: 'contain' | 'cover';
33
29
 
34
- /**
35
- * Similarly to the CSS property z-index, specifies the z-order of this
36
- * RTCView in the stacking space of all RTCViews. When RTCViews overlap,
37
- * zOrder determines which one covers the other. An RTCView with a larger
38
- * zOrder generally covers an RTCView with a lower one.
39
- *
40
- * Non-overlapping RTCViews may safely share a z-order (because one does not
41
- * have to cover the other).
42
- *
43
- * The support for zOrder is platform-dependent and/or
44
- * implementation-specific. Thus, specifying a value for zOrder is to be
45
- * thought of as giving a hint rather than as imposing a requirement. For
46
- * example, video renderers such as RTCView are commonly implemented using
47
- * OpenGL and OpenGL views may have different numbers of layers in their
48
- * stacking space. Android has three: a layer bellow the window (aka
49
- * default), a layer bellow the window again but above the previous layer
50
- * (aka media overlay), and above the window. Consequently, it is advisable
51
- * to limit the number of utilized layers in the stacking space to the
52
- * minimum sufficient for the desired display. For example, a video call
53
- * application usually needs a maximum of two zOrder values: 0 for the
54
- * remote video(s) which appear in the background, and 1 for the local
55
- * video(s) which appear above the remote video(s).
56
- *
57
- * zOrder: number
58
- */
30
+ /**
31
+ * URL / id of the stream that should be rendered.
32
+ *
33
+ * streamURL: string
34
+ */
35
+ streamURL: string;
36
+ /**
37
+ * Similarly to the CSS property z-index, specifies the z-order of this
38
+ * RTCView in the stacking space of all RTCViews. When RTCViews overlap,
39
+ * zOrder determines which one covers the other. An RTCView with a larger
40
+ * zOrder generally covers an RTCView with a lower one.
41
+ *
42
+ * Non-overlapping RTCViews may safely share a z-order (because one does not
43
+ * have to cover the other).
44
+ *
45
+ * The support for zOrder is platform-dependent and/or
46
+ * implementation-specific. Thus, specifying a value for zOrder is to be
47
+ * thought of as giving a hint rather than as imposing a requirement. For
48
+ * example, video renderers such as RTCView are commonly implemented using
49
+ * OpenGL and OpenGL views may have different numbers of layers in their
50
+ * stacking space. Android has three: a layer bellow the window (aka
51
+ * default), a layer bellow the window again but above the previous layer
52
+ * (aka media overlay), and above the window. Consequently, it is advisable
53
+ * to limit the number of utilized layers in the stacking space to the
54
+ * minimum sufficient for the desired display. For example, a video call
55
+ * application usually needs a maximum of two zOrder values: 0 for the
56
+ * remote video(s) which appear in the background, and 1 for the local
57
+ * video(s) which appear above the remote video(s).
58
+ *
59
+ * zOrder: number
60
+ */
61
+ zOrder?: number;
62
+ }
59
63
 
60
- export default requireNativeComponent('RTCVideoView');
64
+ export default requireNativeComponent<RTCVideoViewProps>('RTCVideoView');
package/src/index.ts CHANGED
@@ -2,6 +2,7 @@ import Logger from './Logger';
2
2
  import mediaDevices from './MediaDevices';
3
3
  import MediaStream from './MediaStream';
4
4
  import MediaStreamTrack from './MediaStreamTrack';
5
+ import MediaStreamTrackEvent from './MediaStreamTrackEvent';
5
6
  import permissions from './Permissions';
6
7
  import RTCErrorEvent from './RTCErrorEvent';
7
8
  import RTCIceCandidate from './RTCIceCandidate';
@@ -56,6 +57,7 @@ function registerGlobals(): void {
56
57
  global.RTCSessionDescription = RTCSessionDescription;
57
58
  global.MediaStream = MediaStream;
58
59
  global.MediaStreamTrack = MediaStreamTrack;
60
+ global.MediaStreamTrackEvent = MediaStreamTrackEvent;
59
61
  global.RTCRtpTransceiver = RTCRtpTransceiver;
60
62
  global.RTCRtpReceiver = RTCRtpReceiver;
61
63
  global.RTCRtpSender = RTCRtpSender;