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

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 (69) hide show
  1. package/android/src/main/java/com/oney/WebRTCModule/SerializeUtils.java +65 -26
  2. package/android/src/main/java/com/oney/WebRTCModule/WebRTCModule.java +3 -0
  3. package/ios/RCTWebRTC/SerializeUtils.m +18 -5
  4. package/ios/RCTWebRTC/WebRTCModule+RTCPeerConnection.m +34 -2
  5. package/ios/RCTWebRTC/WebRTCModule+Transceivers.m +5 -4
  6. package/lib/commonjs/RTCPeerConnection.js +4 -1
  7. package/lib/commonjs/RTCPeerConnection.js.map +1 -1
  8. package/lib/commonjs/RTCRtcpParameters.js +7 -0
  9. package/lib/commonjs/RTCRtcpParameters.js.map +1 -1
  10. package/lib/commonjs/RTCRtpCodecParameters.js +22 -4
  11. package/lib/commonjs/RTCRtpCodecParameters.js.map +1 -1
  12. package/lib/commonjs/RTCRtpEncodingParameters.js +12 -1
  13. package/lib/commonjs/RTCRtpEncodingParameters.js.map +1 -1
  14. package/lib/commonjs/RTCRtpHeaderExtension.js +8 -0
  15. package/lib/commonjs/RTCRtpHeaderExtension.js.map +1 -1
  16. package/lib/commonjs/RTCRtpParameters.js +25 -3
  17. package/lib/commonjs/RTCRtpParameters.js.map +1 -1
  18. package/lib/commonjs/RTCRtpReceiveParameters.js.map +1 -1
  19. package/lib/commonjs/RTCRtpReceiver.js +16 -2
  20. package/lib/commonjs/RTCRtpReceiver.js.map +1 -1
  21. package/lib/commonjs/RTCRtpSendParameters.js +10 -4
  22. package/lib/commonjs/RTCRtpSendParameters.js.map +1 -1
  23. package/lib/commonjs/RTCRtpSender.js +1 -1
  24. package/lib/commonjs/RTCRtpSender.js.map +1 -1
  25. package/lib/commonjs/index.js +0 -81
  26. package/lib/commonjs/index.js.map +1 -1
  27. package/lib/module/RTCPeerConnection.js +3 -1
  28. package/lib/module/RTCPeerConnection.js.map +1 -1
  29. package/lib/module/RTCRtcpParameters.js +7 -0
  30. package/lib/module/RTCRtcpParameters.js.map +1 -1
  31. package/lib/module/RTCRtpCodecParameters.js +22 -4
  32. package/lib/module/RTCRtpCodecParameters.js.map +1 -1
  33. package/lib/module/RTCRtpEncodingParameters.js +12 -1
  34. package/lib/module/RTCRtpEncodingParameters.js.map +1 -1
  35. package/lib/module/RTCRtpHeaderExtension.js +8 -0
  36. package/lib/module/RTCRtpHeaderExtension.js.map +1 -1
  37. package/lib/module/RTCRtpParameters.js +20 -3
  38. package/lib/module/RTCRtpParameters.js.map +1 -1
  39. package/lib/module/RTCRtpReceiveParameters.js.map +1 -1
  40. package/lib/module/RTCRtpReceiver.js +13 -2
  41. package/lib/module/RTCRtpReceiver.js.map +1 -1
  42. package/lib/module/RTCRtpSendParameters.js +9 -4
  43. package/lib/module/RTCRtpSendParameters.js.map +1 -1
  44. package/lib/module/RTCRtpSender.js +1 -1
  45. package/lib/module/RTCRtpSender.js.map +1 -1
  46. package/lib/module/index.js +1 -19
  47. package/lib/module/index.js.map +1 -1
  48. package/lib/typescript/RTCPeerConnection.d.ts +1 -1
  49. package/lib/typescript/RTCRtcpParameters.d.ts +6 -4
  50. package/lib/typescript/RTCRtpCodecParameters.d.ts +11 -9
  51. package/lib/typescript/RTCRtpEncodingParameters.d.ts +11 -9
  52. package/lib/typescript/RTCRtpHeaderExtension.d.ts +7 -5
  53. package/lib/typescript/RTCRtpParameters.d.ts +9 -8
  54. package/lib/typescript/RTCRtpReceiver.d.ts +8 -3
  55. package/lib/typescript/RTCRtpSendParameters.d.ts +8 -9
  56. package/lib/typescript/RTCRtpSender.d.ts +2 -2
  57. package/lib/typescript/index.d.ts +1 -10
  58. package/package.json +1 -1
  59. package/src/RTCPeerConnection.ts +3 -1
  60. package/src/RTCRtcpParameters.ts +14 -5
  61. package/src/RTCRtpCodecParameters.ts +34 -13
  62. package/src/RTCRtpEncodingParameters.ts +19 -7
  63. package/src/RTCRtpHeaderExtension.ts +15 -6
  64. package/src/RTCRtpParameters.ts +26 -11
  65. package/src/RTCRtpReceiveParameters.ts +2 -1
  66. package/src/RTCRtpReceiver.ts +20 -4
  67. package/src/RTCRtpSendParameters.ts +22 -12
  68. package/src/RTCRtpSender.ts +3 -4
  69. package/src/index.ts +0 -27
@@ -1,4 +1,4 @@
1
- import RTCRtpEncodingParameters from './RTCRtpEncodingParameters';
1
+ import RTCRtpEncodingParameters, { RTCRtpEncodingParametersInit } from './RTCRtpEncodingParameters';
2
2
  import RTCRtpParameters, { RTCRtpParametersInit } from './RTCRtpParameters';
3
3
 
4
4
  type DegradationPreferenceType = 'maintain-framerate'
@@ -23,31 +23,41 @@ class DegradationPreference {
23
23
  }
24
24
  }
25
25
 
26
+ export interface RTCRtpSendParametersInit extends RTCRtpParametersInit {
27
+ transactionId: string;
28
+ encodings: RTCRtpEncodingParametersInit[];
29
+ degradationPreference?: string;
30
+ }
31
+
26
32
  export default class RTCRtpSendParameters extends RTCRtpParameters {
27
33
  readonly transactionId: string;
28
34
  readonly encodings: RTCRtpEncodingParameters[];
29
35
  degradationPreference: DegradationPreferenceType | null;
30
- constructor(init: RTCRtpParametersInit & {
31
- transactionId: string,
32
- encodings: RTCRtpEncodingParameters[],
33
- degradationPreference?: string
34
- }) {
36
+
37
+ constructor(init: RTCRtpSendParametersInit) {
35
38
  super(init);
39
+
36
40
  this.transactionId = init.transactionId;
37
- this.encodings = init.encodings;
41
+ this.encodings = [];
38
42
  this.degradationPreference = init.degradationPreference ?
39
43
  DegradationPreference.fromNative(init.degradationPreference) : null;
44
+
45
+ for (const enc of init.encodings) {
46
+ this.encodings.push(new RTCRtpEncodingParameters(enc));
47
+ }
40
48
  }
41
49
 
42
- toJSON() {
43
- const obj = {
44
- encodings: this.encodings,
45
- };
50
+ toJSON(): RTCRtpSendParametersInit {
51
+ const obj = super.toJSON();
52
+
53
+ obj['transactionId'] = this.transactionId;
54
+
55
+ obj['encodings'] = this.encodings.map(e => e.toJSON());
46
56
 
47
57
  if (this.degradationPreference !== null) {
48
58
  obj['degradationPreference'] = DegradationPreference.toNative(this.degradationPreference);
49
59
  }
50
60
 
51
- return obj;
61
+ return obj as RTCRtpSendParametersInit;
52
62
  }
53
63
  }
@@ -2,7 +2,7 @@ import { NativeModules } from 'react-native';
2
2
 
3
3
  import MediaStreamTrack from './MediaStreamTrack';
4
4
  import RTCRtpCapabilities, { senderCapabilities, DEFAULT_AUDIO_CAPABILITIES } from './RTCRtpCapabilities';
5
- import RTCRtpSendParameters from './RTCRtpSendParameters';
5
+ import RTCRtpSendParameters, { RTCRtpSendParametersInit } from './RTCRtpSendParameters';
6
6
 
7
7
  const { WebRTCModule } = NativeModules;
8
8
 
@@ -17,11 +17,11 @@ export default class RTCRtpSender {
17
17
  peerConnectionId: number,
18
18
  id: string,
19
19
  track?: MediaStreamTrack,
20
- rtpParameters: RTCRtpSendParameters
20
+ rtpParameters: RTCRtpSendParametersInit
21
21
  }) {
22
22
  this._peerConnectionId = info.peerConnectionId;
23
23
  this._id = info.id;
24
- this._rtpParameters = info.rtpParameters;
24
+ this._rtpParameters = new RTCRtpSendParameters(info.rtpParameters);
25
25
 
26
26
  if (info.track) {
27
27
  this._track = info.track;
@@ -63,7 +63,6 @@ export default class RTCRtpSender {
63
63
  });
64
64
  }
65
65
 
66
-
67
66
  get track() {
68
67
  return this._track;
69
68
  }
package/src/index.ts CHANGED
@@ -6,16 +6,7 @@ import permissions from './Permissions';
6
6
  import RTCErrorEvent from './RTCErrorEvent';
7
7
  import RTCIceCandidate from './RTCIceCandidate';
8
8
  import RTCPeerConnection from './RTCPeerConnection';
9
- import RTCRtcpParameters from './RTCRtcpParameters';
10
- import RTCRtpCapabilities from './RTCRtpCapabilities';
11
- import RTCRtpCodecCapability from './RTCRtpCodecCapability';
12
- import RTCRtpCodecParameters from './RTCRtpCodecParameters';
13
- import RTCRtpEncodingParameters from './RTCRtpEncodingParameters';
14
- import RTCRtpHeaderExtension from './RTCRtpHeaderExtension';
15
- import RTCRtpParameters from './RTCRtpParameters';
16
- import RTCRtpReceiveParameters from './RTCRtpReceiveParameters';
17
9
  import RTCRtpReceiver from './RTCRtpReceiver';
18
- import RTCRtpSendParameters from './RTCRtpSendParameters';
19
10
  import RTCRtpSender from './RTCRtpSender';
20
11
  import RTCRtpTransceiver from './RTCRtpTransceiver';
21
12
  import RTCSessionDescription from './RTCSessionDescription';
@@ -35,15 +26,6 @@ export {
35
26
  RTCRtpReceiver,
36
27
  RTCRtpSender,
37
28
  RTCErrorEvent,
38
- RTCRtpCapabilities,
39
- RTCRtpCodecCapability,
40
- RTCRtpCodecParameters,
41
- RTCRtpEncodingParameters,
42
- RTCRtpParameters,
43
- RTCRtpSendParameters,
44
- RTCRtpReceiveParameters,
45
- RTCRtcpParameters,
46
- RTCRtpHeaderExtension,
47
29
  MediaStream,
48
30
  MediaStreamTrack,
49
31
  mediaDevices,
@@ -78,13 +60,4 @@ function registerGlobals(): void {
78
60
  global.RTCRtpReceiver = RTCRtpReceiver;
79
61
  global.RTCRtpSender = RTCRtpSender;
80
62
  global.RTCErrorEvent = RTCErrorEvent;
81
- global.RTCRtpCapabilities = RTCRtpCapabilities;
82
- global.RTCRtpCodecCapability = RTCRtpCodecCapability;
83
- global.RTCRtpCodecParameters = RTCRtpCodecParameters;
84
- global.RTCRtpEncodingParameters = RTCRtpEncodingParameters;
85
- global.RTCRtpParameters = RTCRtpParameters;
86
- global.RTCRtpSendParameters = RTCRtpSendParameters;
87
- global.RTCRtpReceiverParameters = RTCRtpReceiveParameters;
88
- global.RTCRtcpParameters = RTCRtcpParameters;
89
- global.RTCRtpHeaderExtension = RTCRtpHeaderExtension;
90
63
  }