@100mslive/react-native-hms 1.4.0 → 1.6.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.
Files changed (205) hide show
  1. package/android/build.gradle +3 -2
  2. package/android/src/main/java/com/reactnativehmssdk/HMSDecoder.kt +189 -55
  3. package/android/src/main/java/com/reactnativehmssdk/HMSHelper.kt +1 -0
  4. package/android/src/main/java/com/reactnativehmssdk/HMSManager.kt +94 -38
  5. package/android/src/main/java/com/reactnativehmssdk/HMSRNSDK.kt +446 -107
  6. package/android/src/main/java/com/reactnativehmssdk/HMSSDKViewManager.kt +5 -0
  7. package/android/src/main/java/com/reactnativehmssdk/HMSView.kt +42 -25
  8. package/android/src/main/res/layout/hms_view.xml +2 -2
  9. package/ios/HMSConstants.swift +33 -0
  10. package/ios/HMSDecoder.swift +372 -157
  11. package/ios/HMSHelper.swift +44 -7
  12. package/ios/HMSManager.m +17 -2
  13. package/ios/HMSManager.swift +177 -75
  14. package/ios/HMSRNSDK.swift +641 -199
  15. package/ios/HMSView.m +1 -0
  16. package/ios/HMSView.swift +21 -19
  17. package/lib/commonjs/classes/HMSAudioTrackSettings.js +14 -0
  18. package/lib/commonjs/classes/HMSAudioTrackSettings.js.map +1 -1
  19. package/lib/commonjs/classes/HMSCameraControl.js +28 -0
  20. package/lib/commonjs/classes/HMSCameraControl.js.map +1 -0
  21. package/lib/commonjs/classes/HMSEncoder.js +97 -14
  22. package/lib/commonjs/classes/HMSEncoder.js.map +1 -1
  23. package/lib/commonjs/classes/HMSIOSAudioMode.js +13 -0
  24. package/lib/commonjs/classes/HMSIOSAudioMode.js.map +1 -0
  25. package/lib/commonjs/classes/HMSLayer.js +14 -0
  26. package/lib/commonjs/classes/HMSLayer.js.map +1 -0
  27. package/lib/commonjs/classes/HMSLocalVideoStats.js +11 -0
  28. package/lib/commonjs/classes/HMSLocalVideoStats.js.map +1 -1
  29. package/lib/commonjs/classes/HMSPeer.js +1 -1
  30. package/lib/commonjs/classes/HMSPeer.js.map +1 -1
  31. package/lib/commonjs/classes/HMSPublishSettings.js +2 -0
  32. package/lib/commonjs/classes/HMSPublishSettings.js.map +1 -1
  33. package/lib/commonjs/classes/HMSQualityLimitationReason.js +16 -0
  34. package/lib/commonjs/classes/HMSQualityLimitationReason.js.map +1 -0
  35. package/lib/commonjs/classes/HMSQualityLimitationReasons.js +27 -0
  36. package/lib/commonjs/classes/HMSQualityLimitationReasons.js.map +1 -0
  37. package/lib/commonjs/classes/HMSRemotePeer.js.map +1 -1
  38. package/lib/commonjs/classes/HMSRemoteVideoTrack.js +39 -3
  39. package/lib/commonjs/classes/HMSRemoteVideoTrack.js.map +1 -1
  40. package/lib/commonjs/classes/HMSRoom.js +4 -0
  41. package/lib/commonjs/classes/HMSRoom.js.map +1 -1
  42. package/lib/commonjs/classes/HMSRoomUpdate.js +1 -0
  43. package/lib/commonjs/classes/HMSRoomUpdate.js.map +1 -1
  44. package/lib/commonjs/classes/HMSSDK.js +82 -45
  45. package/lib/commonjs/classes/HMSSDK.js.map +1 -1
  46. package/lib/commonjs/classes/HMSSessionStore.js +173 -0
  47. package/lib/commonjs/classes/HMSSessionStore.js.map +1 -0
  48. package/lib/commonjs/classes/HMSSimulcastLayerDefinition.js +19 -0
  49. package/lib/commonjs/classes/HMSSimulcastLayerDefinition.js.map +1 -0
  50. package/lib/commonjs/classes/HMSSimulcastLayerSettingsPolicy.js +23 -0
  51. package/lib/commonjs/classes/HMSSimulcastLayerSettingsPolicy.js.map +1 -0
  52. package/lib/commonjs/classes/HMSSimulcastSettings.js +5 -4
  53. package/lib/commonjs/classes/HMSSimulcastSettings.js.map +1 -1
  54. package/lib/commonjs/classes/HMSSimulcastSettingsPolicy.js +17 -0
  55. package/lib/commonjs/classes/HMSSimulcastSettingsPolicy.js.map +1 -0
  56. package/lib/commonjs/classes/HMSSubscribeDegradationPolicy.js +21 -0
  57. package/lib/commonjs/classes/HMSSubscribeDegradationPolicy.js.map +1 -0
  58. package/lib/commonjs/classes/HMSSubscribeSettings.js +2 -0
  59. package/lib/commonjs/classes/HMSSubscribeSettings.js.map +1 -1
  60. package/lib/commonjs/classes/HMSUpdateListenerActions.js +8 -0
  61. package/lib/commonjs/classes/HMSUpdateListenerActions.js.map +1 -1
  62. package/lib/commonjs/classes/HMSVideoResolution.js.map +1 -1
  63. package/lib/commonjs/classes/HMSVideoTrackSettings.js +5 -0
  64. package/lib/commonjs/classes/HMSVideoTrackSettings.js.map +1 -1
  65. package/lib/commonjs/classes/HmsView.js +2 -0
  66. package/lib/commonjs/classes/HmsView.js.map +1 -1
  67. package/lib/commonjs/index.js +72 -0
  68. package/lib/commonjs/index.js.map +1 -1
  69. package/lib/commonjs/utils/emitter/EventEmitter.js +162 -0
  70. package/lib/commonjs/utils/emitter/EventEmitter.js.map +1 -0
  71. package/lib/commonjs/utils/emitter/_EmitterSubscription.js +46 -0
  72. package/lib/commonjs/utils/emitter/_EmitterSubscription.js.map +1 -0
  73. package/lib/commonjs/utils/emitter/_EventSubscription.js +36 -0
  74. package/lib/commonjs/utils/emitter/_EventSubscription.js.map +1 -0
  75. package/lib/commonjs/utils/emitter/_EventSubscriptionVendor.js +90 -0
  76. package/lib/commonjs/utils/emitter/_EventSubscriptionVendor.js.map +1 -0
  77. package/lib/commonjs/utils/index.js +17 -0
  78. package/lib/commonjs/utils/index.js.map +1 -0
  79. package/lib/module/classes/HMSAudioTrackSettings.js +14 -0
  80. package/lib/module/classes/HMSAudioTrackSettings.js.map +1 -1
  81. package/lib/module/classes/HMSCameraControl.js +21 -0
  82. package/lib/module/classes/HMSCameraControl.js.map +1 -0
  83. package/lib/module/classes/HMSEncoder.js +97 -14
  84. package/lib/module/classes/HMSEncoder.js.map +1 -1
  85. package/lib/module/classes/HMSIOSAudioMode.js +6 -0
  86. package/lib/module/classes/HMSIOSAudioMode.js.map +1 -0
  87. package/lib/module/classes/HMSLayer.js +7 -0
  88. package/lib/module/classes/HMSLayer.js.map +1 -0
  89. package/lib/module/classes/HMSLocalVideoStats.js +11 -0
  90. package/lib/module/classes/HMSLocalVideoStats.js.map +1 -1
  91. package/lib/module/classes/HMSPeer.js +1 -1
  92. package/lib/module/classes/HMSPeer.js.map +1 -1
  93. package/lib/module/classes/HMSPublishSettings.js +2 -0
  94. package/lib/module/classes/HMSPublishSettings.js.map +1 -1
  95. package/lib/module/classes/HMSQualityLimitationReason.js +9 -0
  96. package/lib/module/classes/HMSQualityLimitationReason.js.map +1 -0
  97. package/lib/module/classes/HMSQualityLimitationReasons.js +20 -0
  98. package/lib/module/classes/HMSQualityLimitationReasons.js.map +1 -0
  99. package/lib/module/classes/HMSRemotePeer.js.map +1 -1
  100. package/lib/module/classes/HMSRemoteVideoTrack.js +39 -3
  101. package/lib/module/classes/HMSRemoteVideoTrack.js.map +1 -1
  102. package/lib/module/classes/HMSRoom.js +4 -0
  103. package/lib/module/classes/HMSRoom.js.map +1 -1
  104. package/lib/module/classes/HMSRoomUpdate.js +1 -0
  105. package/lib/module/classes/HMSRoomUpdate.js.map +1 -1
  106. package/lib/module/classes/HMSSDK.js +83 -45
  107. package/lib/module/classes/HMSSDK.js.map +1 -1
  108. package/lib/module/classes/HMSSessionStore.js +166 -0
  109. package/lib/module/classes/HMSSessionStore.js.map +1 -0
  110. package/lib/module/classes/HMSSimulcastLayerDefinition.js +12 -0
  111. package/lib/module/classes/HMSSimulcastLayerDefinition.js.map +1 -0
  112. package/lib/module/classes/HMSSimulcastLayerSettingsPolicy.js +16 -0
  113. package/lib/module/classes/HMSSimulcastLayerSettingsPolicy.js.map +1 -0
  114. package/lib/module/classes/HMSSimulcastSettings.js +5 -4
  115. package/lib/module/classes/HMSSimulcastSettings.js.map +1 -1
  116. package/lib/module/classes/HMSSimulcastSettingsPolicy.js +10 -0
  117. package/lib/module/classes/HMSSimulcastSettingsPolicy.js.map +1 -0
  118. package/lib/module/classes/HMSSubscribeDegradationPolicy.js +14 -0
  119. package/lib/module/classes/HMSSubscribeDegradationPolicy.js.map +1 -0
  120. package/lib/module/classes/HMSSubscribeSettings.js +2 -0
  121. package/lib/module/classes/HMSSubscribeSettings.js.map +1 -1
  122. package/lib/module/classes/HMSUpdateListenerActions.js +8 -0
  123. package/lib/module/classes/HMSUpdateListenerActions.js.map +1 -1
  124. package/lib/module/classes/HMSVideoResolution.js.map +1 -1
  125. package/lib/module/classes/HMSVideoTrackSettings.js +5 -0
  126. package/lib/module/classes/HMSVideoTrackSettings.js.map +1 -1
  127. package/lib/module/classes/HmsView.js +2 -0
  128. package/lib/module/classes/HmsView.js.map +1 -1
  129. package/lib/module/index.js +6 -0
  130. package/lib/module/index.js.map +1 -1
  131. package/lib/module/utils/emitter/EventEmitter.js +151 -0
  132. package/lib/module/utils/emitter/EventEmitter.js.map +1 -0
  133. package/lib/module/utils/emitter/_EmitterSubscription.js +39 -0
  134. package/lib/module/utils/emitter/_EmitterSubscription.js.map +1 -0
  135. package/lib/module/utils/emitter/_EventSubscription.js +29 -0
  136. package/lib/module/utils/emitter/_EventSubscription.js.map +1 -0
  137. package/lib/module/utils/emitter/_EventSubscriptionVendor.js +83 -0
  138. package/lib/module/utils/emitter/_EventSubscriptionVendor.js.map +1 -0
  139. package/lib/module/utils/index.js +2 -0
  140. package/lib/module/utils/index.js.map +1 -0
  141. package/lib/typescript/classes/HMSAudioTrackSettings.d.ts +14 -0
  142. package/lib/typescript/classes/HMSCameraControl.d.ts +9 -0
  143. package/lib/typescript/classes/HMSEncoder.d.ts +13 -1
  144. package/lib/typescript/classes/HMSIOSAudioMode.d.ts +4 -0
  145. package/lib/typescript/classes/HMSLayer.d.ts +5 -0
  146. package/lib/typescript/classes/HMSLocalVideoStats.d.ts +6 -0
  147. package/lib/typescript/classes/HMSPeer.d.ts +1 -1
  148. package/lib/typescript/classes/HMSPublishSettings.d.ts +3 -0
  149. package/lib/typescript/classes/HMSQualityLimitationReason.d.ts +7 -0
  150. package/lib/typescript/classes/HMSQualityLimitationReasons.d.ts +17 -0
  151. package/lib/typescript/classes/HMSRemotePeer.d.ts +0 -1
  152. package/lib/typescript/classes/HMSRemoteVideoTrack.d.ts +6 -2
  153. package/lib/typescript/classes/HMSRoomUpdate.d.ts +2 -1
  154. package/lib/typescript/classes/HMSSDK.d.ts +21 -31
  155. package/lib/typescript/classes/HMSSessionStore.d.ts +63 -0
  156. package/lib/typescript/classes/HMSSimulcastLayerDefinition.d.ts +10 -0
  157. package/lib/typescript/classes/HMSSimulcastLayerSettingsPolicy.d.ts +12 -0
  158. package/lib/typescript/classes/HMSSimulcastSettings.d.ts +7 -3
  159. package/lib/typescript/classes/HMSSimulcastSettingsPolicy.d.ts +7 -0
  160. package/lib/typescript/classes/HMSSubscribeDegradationPolicy.d.ts +10 -0
  161. package/lib/typescript/classes/HMSSubscribeSettings.d.ts +5 -2
  162. package/lib/typescript/classes/HMSUpdateListenerActions.d.ts +9 -1
  163. package/lib/typescript/classes/HMSVideoResolution.d.ts +2 -2
  164. package/lib/typescript/classes/HMSVideoTrackSettings.d.ts +5 -0
  165. package/lib/typescript/classes/HmsView.d.ts +2 -2
  166. package/lib/typescript/index.d.ts +7 -0
  167. package/lib/typescript/utils/emitter/EventEmitter.d.ts +91 -0
  168. package/lib/typescript/utils/emitter/_EmitterSubscription.d.ts +29 -0
  169. package/lib/typescript/utils/emitter/_EventSubscription.d.ts +19 -0
  170. package/lib/typescript/utils/emitter/_EventSubscriptionVendor.d.ts +44 -0
  171. package/lib/typescript/utils/index.d.ts +1 -0
  172. package/package.json +21 -2
  173. package/sdk-versions.json +3 -3
  174. package/src/classes/HMSAudioTrackSettings.ts +16 -0
  175. package/src/classes/HMSCameraControl.ts +21 -0
  176. package/src/classes/HMSEncoder.ts +126 -11
  177. package/src/classes/HMSIOSAudioMode.ts +4 -0
  178. package/src/classes/HMSLayer.ts +5 -0
  179. package/src/classes/HMSLocalVideoStats.ts +21 -0
  180. package/src/classes/HMSPeer.ts +1 -1
  181. package/src/classes/HMSPublishSettings.ts +4 -0
  182. package/src/classes/HMSQualityLimitationReason.ts +7 -0
  183. package/src/classes/HMSQualityLimitationReasons.ts +27 -0
  184. package/src/classes/HMSRemotePeer.ts +0 -1
  185. package/src/classes/HMSRemoteVideoTrack.ts +52 -4
  186. package/src/classes/HMSRoom.ts +2 -0
  187. package/src/classes/HMSRoomUpdate.ts +1 -0
  188. package/src/classes/HMSSDK.tsx +124 -52
  189. package/src/classes/HMSSessionStore.ts +209 -0
  190. package/src/classes/HMSSimulcastLayerDefinition.ts +12 -0
  191. package/src/classes/HMSSimulcastLayerSettingsPolicy.ts +18 -0
  192. package/src/classes/HMSSimulcastSettings.ts +12 -3
  193. package/src/classes/HMSSimulcastSettingsPolicy.ts +9 -0
  194. package/src/classes/HMSSubscribeDegradationPolicy.ts +15 -0
  195. package/src/classes/HMSSubscribeSettings.ts +10 -2
  196. package/src/classes/HMSUpdateListenerActions.ts +8 -0
  197. package/src/classes/HMSVideoResolution.ts +1 -1
  198. package/src/classes/HMSVideoTrackSettings.ts +5 -0
  199. package/src/classes/HmsView.tsx +5 -1
  200. package/src/index.ts +10 -0
  201. package/src/utils/emitter/EventEmitter.ts +160 -0
  202. package/src/utils/emitter/_EmitterSubscription.ts +44 -0
  203. package/src/utils/emitter/_EventSubscription.ts +28 -0
  204. package/src/utils/emitter/_EventSubscriptionVendor.ts +89 -0
  205. package/src/utils/index.ts +1 -0
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
- import { ViewStyle } from 'react-native';
3
2
  import { HMSTrackType } from './HMSTrackType';
4
3
  import { HMSUpdateListenerActions } from './HMSUpdateListenerActions';
4
+ import { HmsComponentProps } from './HmsView';
5
5
  import type { HMSConfig } from './HMSConfig';
6
6
  import type { HMSLocalPeer } from './HMSLocalPeer';
7
7
  import type { HMSRemotePeer } from './HMSRemotePeer';
@@ -10,7 +10,6 @@ import type { HMSRole } from './HMSRole';
10
10
  import type { HMSTrack } from './HMSTrack';
11
11
  import type { HMSLogger } from './HMSLogger';
12
12
  import type { HMSPeer } from './HMSPeer';
13
- import type { HMSVideoViewMode } from './HMSVideoViewMode';
14
13
  import type { HMSTrackSettings } from './HMSTrackSettings';
15
14
  import type { HMSRTMPConfig } from './HMSRTMPConfig';
16
15
  import type { HMSHLSConfig } from './HMSHLSConfig';
@@ -20,13 +19,7 @@ import type { HMSAudioMixingMode } from './HMSAudioMixingMode';
20
19
  import type { HMSLogSettings } from './HMSLogSettings';
21
20
  import { HMSMessageType } from './HMSMessageType';
22
21
  import { HMSPIPListenerActions } from './HMSPIPListenerActions';
23
- interface HmsViewProps {
24
- trackId: string;
25
- style?: ViewStyle;
26
- mirror?: boolean;
27
- scaleType?: HMSVideoViewMode;
28
- setZOrderMediaOverlay?: boolean;
29
- }
22
+ type HmsViewProps = Omit<HmsComponentProps, 'id'>;
30
23
  interface PIPConfig {
31
24
  aspectRatio?: [number, number];
32
25
  endButton?: boolean;
@@ -56,6 +49,7 @@ export declare class HMSSDK {
56
49
  private onRemoteAudioStatsDelegate?;
57
50
  private onRemoteVideoStatsDelegate?;
58
51
  private onAudioDeviceChangedDelegate?;
52
+ private onSessionStoreAvailableDelegate?;
59
53
  private onPIPRoomLeaveDelegate?;
60
54
  private emitterSubscriptions;
61
55
  private constructor();
@@ -133,6 +127,7 @@ export declare class HMSSDK {
133
127
  * - The appearance of tile is completely customizable with style prop.
134
128
  * - Scale type can determine how the incoming video will fit in the canvas check {@link HMSVideoViewMode} for more information.
135
129
  * - Mirror to flip the video vertically.
130
+ * - Auto Simulcast to automatically select the best Streaming Quality of track if feature is enabled in Room.
136
131
  *
137
132
  * checkout {@link https://www.100ms.live/docs/react-native/v2/features/render-video} for more info
138
133
  *
@@ -417,28 +412,6 @@ export declare class HMSSDK {
417
412
  * @memberof HMSSDK
418
413
  */
419
414
  stopScreenshare: () => Promise<any>;
420
- /**
421
- * - enableRTCStats sets a boolean in native side which in turn allows several events to be passed
422
- * through the bridge these events are {@link RTCStatsListener}, {@link onRemoteVideoStatsListener},
423
- * {@link onRemoteAudioStatsListener}, {@link onLocalAudioStatsListener} and {@link onLocalVideoStatsListener}
424
- *
425
- * - These listeners get various dataPoints for current peers and their connectivity to the room
426
- * such as jitter, latency etc.
427
- *
428
- * - currently available for iOS only
429
- *
430
- * @memberof HMSSDK
431
- */
432
- enableRTCStats: () => void;
433
- /**
434
- * - disable RTCStats sets the same boolean to false that was set true by enableRTCStats.
435
- * that activates a check which filters out the events acquired in native listeners and don't
436
- * let them pass through bridge
437
- *
438
- * - currently available for iOS only.
439
- * @memberof HMSSDK
440
- */
441
- disableRTCStats: () => void;
442
415
  enableNetworkQualityUpdates: () => void;
443
416
  disableNetworkQualityUpdates: () => void;
444
417
  /**
@@ -529,8 +502,22 @@ export declare class HMSSDK {
529
502
  * @memberof HMSSDK
530
503
  */
531
504
  setAudioDeviceChangeListener: (callback: Function) => any;
505
+ /**
506
+ * @deprecated Older SessionMetaData APIs has been deprecated in favour of newer Session Store APIs.
507
+ * You can subscribe to `ON_SESSION_STORE_AVAILABLE` event to get notified when the `HMSSessionStore`
508
+ * is available and use `set` method on `HMSSessionStore` instance
509
+ * checkout {@link https://www.100ms.live/docs/react-native/v2/how-to-guides/}
510
+ */
532
511
  setSessionMetaData: (sessionMetaData: string | null) => Promise<any>;
512
+ /**
513
+ * @deprecated Older SessionMetaData APIs has been deprecated in favour of newer Session Store APIs.
514
+ * You can subscribe to `ON_SESSION_STORE_AVAILABLE` event to get notified when the `HMSSessionStore`
515
+ * is available and use `get` or `addKeyChangeListener` method on `HMSSessionStore` instance
516
+ * checkout {@link https://www.100ms.live/docs/react-native/v2/how-to-guides/}
517
+ */
533
518
  getSessionMetaData: () => Promise<any>;
519
+ getRemoteVideoTrackFromTrackId: (trackId: string) => Promise<import("./HMSRemoteVideoTrack").HMSRemoteVideoTrack>;
520
+ getRemoteAudioTrackFromTrackId: (trackId: string) => Promise<import("./HMSRemoteAudioTrack").HMSRemoteAudioTrack>;
534
521
  /**
535
522
  * - This is a prototype event listener that takes action and listens for updates related to that particular action
536
523
  *
@@ -590,6 +577,9 @@ export declare class HMSSDK {
590
577
  device: string;
591
578
  audioDevicesList: string[];
592
579
  }) => void;
580
+ onSessionStoreAvailableListener: (data: {
581
+ id: string;
582
+ }) => void;
593
583
  onPIPRoomLeaveListener: (data: {
594
584
  id: string;
595
585
  }) => void;
@@ -0,0 +1,63 @@
1
+ type Nullable<T> = T | null | undefined;
2
+ export type HMSSessionStoreValue = Nullable<string>;
3
+ /**
4
+ * Session store is a shared realtime key-value store that is accessible by everyone in the room.
5
+ * It can be utilized to implement features such as pinned text, spotlight (which brings a particular
6
+ * peer to the center stage for everyone in the room) and more.
7
+ *
8
+ * To get an instance of `HMSSessionStore` class, You can add an event listener for `ON_SESSION_STORE_AVAILABLE`
9
+ * event on the `HMSSDK` instance
10
+ *
11
+ * For example:
12
+ * ```
13
+ * hmsInstance.addEventListener(HMSUpdateListenerActions.ON_SESSION_STORE_AVAILABLE, <your callback function>);
14
+ * ```
15
+ *
16
+ * Checkout Session Store docs fore more details ${@link https://www.100ms.live/docs/react-native/v2/how-to-guides/interact-with-room/room/session-store}
17
+ */
18
+ export declare class HMSSessionStore {
19
+ private _deviceEventEmitterSubscription?;
20
+ private _eventEmitter?;
21
+ private _addedKeyChangeListenerCount;
22
+ /**
23
+ * This method sets a value for a specific key on session store.
24
+ * Once a value is assigned, it will be available for other peers in the room
25
+ * who are listening for changes in value for that specific key.
26
+ *
27
+ * @param {HMSSessionStoreValue} value
28
+ * @param {string} key
29
+ * @returns {Promise}
30
+ */
31
+ set(value: HMSSessionStoreValue, key: string): Promise<{
32
+ success: true;
33
+ finalValue: HMSSessionStoreValue;
34
+ }>;
35
+ /**
36
+ * This method returns the value of any specified key on session store.
37
+ * Note that you will not get updates for any change in value of the specified key,
38
+ * It returns the latest value at the time it was called.
39
+ *
40
+ * To listen to value change updates use `addKeyChangeListener` method instead.
41
+ *
42
+ * @param {string} key
43
+ * @returns {Promise}
44
+ */
45
+ get(key: string): Promise<HMSSessionStoreValue>;
46
+ /**
47
+ * This method registers a callback function for listening to value changes of a particular key.
48
+ * Registered Callback function will be called initially with latest value and whenever the value updates
49
+ *
50
+ * @param {string[]} forKeys
51
+ * @param {Function} callback
52
+ * @returns {Object} subscription object
53
+ */
54
+ addKeyChangeListener<T extends string[]>(forKeys: T, callback: (error: string | null, data: {
55
+ key: T[number];
56
+ value: HMSSessionStoreValue;
57
+ } | null) => void): {
58
+ remove: () => void;
59
+ };
60
+ private _cleanup;
61
+ private _deviceEventEmitterListener;
62
+ }
63
+ export {};
@@ -0,0 +1,10 @@
1
+ import type { HMSLayer } from './HMSLayer';
2
+ import type { HMSVideoResolution } from './HMSVideoResolution';
3
+ export declare class HMSSimulcastLayerDefinition {
4
+ layer: HMSLayer;
5
+ resolution: HMSVideoResolution;
6
+ constructor(params: {
7
+ layer: HMSLayer;
8
+ resolution: HMSVideoResolution;
9
+ });
10
+ }
@@ -0,0 +1,12 @@
1
+ export declare class HMSSimulcastLayerSettingsPolicy {
2
+ rid?: string;
3
+ scaleResolutionDownBy?: number;
4
+ maxBitrate?: number;
5
+ maxFramerate?: number;
6
+ constructor(params: {
7
+ rid?: string;
8
+ scaleResolutionDownBy?: number;
9
+ maxBitrate?: number;
10
+ maxFramerate?: number;
11
+ });
12
+ }
@@ -1,5 +1,9 @@
1
+ import type { HMSSimulcastSettingsPolicy } from './HMSSimulcastSettingsPolicy';
1
2
  export declare class HMSSimulcastSettings {
2
- low: any;
3
- med: any;
4
- high: any;
3
+ video?: HMSSimulcastSettingsPolicy;
4
+ screen?: HMSSimulcastSettingsPolicy;
5
+ constructor(params: {
6
+ video?: HMSSimulcastSettingsPolicy;
7
+ screen?: HMSSimulcastSettingsPolicy;
8
+ });
5
9
  }
@@ -0,0 +1,7 @@
1
+ import type { HMSSimulcastLayerSettingsPolicy } from './HMSSimulcastLayerSettingsPolicy';
2
+ export declare class HMSSimulcastSettingsPolicy {
3
+ layers?: HMSSimulcastLayerSettingsPolicy[];
4
+ constructor(params: {
5
+ layers?: HMSSimulcastLayerSettingsPolicy[];
6
+ });
7
+ }
@@ -0,0 +1,10 @@
1
+ export declare class HMSSubscribeDegradationPolicy {
2
+ packetLossThreshold?: number;
3
+ degradeGracePeriodSeconds?: number;
4
+ recoverGracePeriodSeconds?: number;
5
+ constructor(params: {
6
+ packetLossThreshold?: number;
7
+ degradeGracePeriodSeconds?: number;
8
+ recoverGracePeriodSeconds?: number;
9
+ });
10
+ }
@@ -1,8 +1,11 @@
1
+ import type { HMSSubscribeDegradationPolicy } from './HMSSubscribeDegradationPolicy';
1
2
  export declare class HMSSubscribeSettings {
2
- subscribeTo?: [string];
3
+ subscribeTo?: string[];
3
4
  maxSubsBitRate: number;
5
+ subscribeDegradation?: HMSSubscribeDegradationPolicy;
4
6
  constructor(params: {
5
- subscribeTo?: [string];
7
+ subscribeTo?: string[];
6
8
  maxSubsBitRate: number;
9
+ subscribeDegradation?: HMSSubscribeDegradationPolicy;
7
10
  });
8
11
  }
@@ -1,3 +1,9 @@
1
+ /**
2
+ * These are the available events emitted by the `HMSSDK`
3
+ *
4
+ * For more info about these events, checkout Event Listener docs
5
+ * {@link https://www.100ms.live/docs/react-native/v2/how-to-guides/listen-to-room-updates/event-listeners}
6
+ */
1
7
  export declare enum HMSUpdateListenerActions {
2
8
  ON_PREVIEW = "ON_PREVIEW",
3
9
  ON_JOIN = "ON_JOIN",
@@ -17,5 +23,7 @@ export declare enum HMSUpdateListenerActions {
17
23
  ON_LOCAL_VIDEO_STATS = "ON_LOCAL_VIDEO_STATS",
18
24
  ON_REMOTE_AUDIO_STATS = "ON_REMOTE_AUDIO_STATS",
19
25
  ON_REMOTE_VIDEO_STATS = "ON_REMOTE_VIDEO_STATS",
20
- ON_AUDIO_DEVICE_CHANGED = "ON_AUDIO_DEVICE_CHANGED"
26
+ ON_AUDIO_DEVICE_CHANGED = "ON_AUDIO_DEVICE_CHANGED",
27
+ ON_SESSION_STORE_AVAILABLE = "ON_SESSION_STORE_AVAILABLE",
28
+ ON_SESSION_STORE_CHANGED = "ON_SESSION_STORE_CHANGED"
21
29
  }
@@ -2,7 +2,7 @@ export declare class HMSVideoResolution {
2
2
  height?: number;
3
3
  width?: number;
4
4
  constructor(params: {
5
- height: number;
6
- width: number;
5
+ height?: number;
6
+ width?: number;
7
7
  });
8
8
  }
@@ -1,6 +1,11 @@
1
1
  import type { HMSSimulcastLayerSettings } from './HMSSimulcastLayerSettings';
2
2
  import type { HMSCameraFacing } from './HMSCameraFacing';
3
3
  import type { HMSTrackSettingsInitState } from './HMSTrackSettingsInitState';
4
+ /**
5
+ * Customize local peer's Video track settings before Joining the Room.
6
+ *
7
+ * Checkout Track Settings docs for more details {@link https://www.100ms.live/docs/react-native/v2/how-to-guides/interact-with-room/track/track-settings}
8
+ */
4
9
  export declare class HMSVideoTrackSettings {
5
10
  readonly simulcastSettings?: HMSSimulcastLayerSettings[];
6
11
  initialState?: HMSTrackSettingsInitState;
@@ -1,13 +1,13 @@
1
1
  import React from 'react';
2
2
  import { ViewStyle } from 'react-native';
3
3
  import { HMSVideoViewMode } from './HMSVideoViewMode';
4
- interface HmsComponentProps {
4
+ export interface HmsComponentProps {
5
5
  trackId: string;
6
6
  style?: ViewStyle;
7
7
  mirror?: boolean;
8
+ autoSimulcast?: boolean;
8
9
  scaleType?: HMSVideoViewMode;
9
10
  setZOrderMediaOverlay?: boolean;
10
11
  id: string;
11
12
  }
12
13
  export declare const HmsViewComponent: React.ForwardRefExoticComponent<HmsComponentProps & React.RefAttributes<any>>;
13
- export {};
@@ -75,6 +75,13 @@ export * from './classes/HMSLogSettings';
75
75
  export * from './classes/HMSLogAlarmManager';
76
76
  export * from './classes/HMSMessageType';
77
77
  export * from './classes/HMSPIPListenerActions';
78
+ export * from './classes/HMSLayer';
79
+ export * from './classes/HMSSimulcastLayerDefinition';
80
+ export * from './classes/HMSQualityLimitationReasons';
81
+ export * from './classes/HMSQualityLimitationReason';
82
+ export * from './classes/HMSCameraControl';
83
+ export * from './classes/HMSIOSAudioMode';
84
+ export type { HMSSessionStore, HMSSessionStoreValue, } from './classes/HMSSessionStore';
78
85
  export type { HmsViewComponent as HMSView } from './classes/HmsView';
79
86
  import { HMSSDK as HmsManager } from './classes/HMSSDK';
80
87
  export default HmsManager;
@@ -0,0 +1,91 @@
1
+ import { EmitterSubscription } from './_EmitterSubscription';
2
+ import { EventSubscriptionVendor } from './_EventSubscriptionVendor';
3
+ export { EmitterSubscription } from './_EmitterSubscription';
4
+ /**
5
+ * @class EventEmitter
6
+ * @description
7
+ * An EventEmitter is responsible for managing a set of listeners and publishing
8
+ * events to them when it is told that such events happened. In addition to the
9
+ * data for the given event it also sends a event control object which allows
10
+ * the listeners/handlers to prevent the default behavior of the given event.
11
+ *
12
+ * The emitter is designed to be generic enough to support all the different
13
+ * contexts in which one might want to emit events. It is a simple multicast
14
+ * mechanism on top of which extra functionality can be composed. For example, a
15
+ * more advanced emitter may use an EventHolder and EventFactory.
16
+ */
17
+ export declare class EventEmitter {
18
+ _subscriber: EventSubscriptionVendor;
19
+ /**
20
+ * @constructor
21
+ *
22
+ * @param {EventSubscriptionVendor} subscriber - Optional subscriber instance
23
+ * to use. If omitted, a new subscriber will be created for the emitter.
24
+ */
25
+ constructor(subscriber?: EventSubscriptionVendor | null);
26
+ /**
27
+ * Adds a listener to be invoked when events of the specified type are
28
+ * emitted. An optional calling context may be provided. The data arguments
29
+ * emitted will be passed to the listener function.
30
+ *
31
+ * TODO: Annotate the listener arg's type. This is tricky because listeners
32
+ * can be invoked with varargs.
33
+ *
34
+ * @param {string} eventType - Name of the event to listen to
35
+ * @param {function} listener - Function to invoke when the specified event is
36
+ * emitted
37
+ * @param {*} context - Optional context object to use when invoking the
38
+ * listener
39
+ */
40
+ addListener(eventType: string, listener: Function, context: Object | null | undefined): EmitterSubscription;
41
+ /**
42
+ * Removes all of the registered listeners, including those registered as
43
+ * listener maps.
44
+ *
45
+ * @param {?string} eventType - Optional name of the event whose registered
46
+ * listeners to remove
47
+ */
48
+ removeAllListeners(eventType: string | undefined | null): void;
49
+ /**
50
+ * Removes a specific subscription. Called by the `remove()` method of the
51
+ * subscription itself to ensure any necessary cleanup is performed.
52
+ */
53
+ removeSubscription(subscription: EmitterSubscription): void;
54
+ /**
55
+ * Returns the number of listeners that are currently registered for the given
56
+ * event.
57
+ *
58
+ * @param {string} eventType - Name of the event to query
59
+ * @returns {number}
60
+ */
61
+ listenerCount(eventType: string): number;
62
+ /**
63
+ * Emits an event of the given type with the given data. All handlers of that
64
+ * particular type will be notified.
65
+ *
66
+ * @param {string} eventType - Name of the event to emit
67
+ * @param {...*} Arbitrary arguments to be passed to each registered listener
68
+ *
69
+ * @example
70
+ * emitter.addListener('someEvent', function(message) {
71
+ * console.log(message);
72
+ * });
73
+ *
74
+ * emitter.emit('someEvent', 'abc'); // logs 'abc'
75
+ */
76
+ emit(eventType: string, ...args: any[]): void;
77
+ /**
78
+ * Removes the given listener for event of specific type.
79
+ *
80
+ * @param {string} eventType - Name of the event to emit
81
+ * @param {function} listener - Function to invoke when the specified event is
82
+ * emitted
83
+ *
84
+ * @example
85
+ * emitter.removeListener('someEvent', function(message) {
86
+ * console.log(message);
87
+ * }); // removes the listener if already registered
88
+ *
89
+ */
90
+ removeListener(eventType: string, listener: Function): void;
91
+ }
@@ -0,0 +1,29 @@
1
+ import { EventSubscription } from './_EventSubscription';
2
+ import type { EventEmitter } from './EventEmitter';
3
+ import type { EventSubscriptionVendor } from './_EventSubscriptionVendor';
4
+ /**
5
+ * EmitterSubscription represents a subscription with listener and context data.
6
+ */
7
+ export declare class EmitterSubscription extends EventSubscription {
8
+ emitter: EventEmitter;
9
+ listener: Function;
10
+ context: Object | null | undefined;
11
+ /**
12
+ * @param {EventEmitter} emitter - The event emitter that registered this
13
+ * subscription
14
+ * @param {EventSubscriptionVendor} subscriber - The subscriber that controls
15
+ * this subscription
16
+ * @param {function} listener - Function to invoke when the specified event is
17
+ * emitted
18
+ * @param {*} context - Optional context object to use when invoking the
19
+ * listener
20
+ */
21
+ constructor(emitter: EventEmitter, subscriber: EventSubscriptionVendor, listener: Function, context: Object | undefined | null);
22
+ /**
23
+ * Removes this subscription from the emitter that registered it.
24
+ * Note: we're overriding the `remove()` method of EventSubscription here
25
+ * but deliberately not calling `super.remove()` as the responsibility
26
+ * for removing the subscription lies with the EventEmitter.
27
+ */
28
+ remove(): void;
29
+ }
@@ -0,0 +1,19 @@
1
+ import type { EventSubscriptionVendor } from './_EventSubscriptionVendor';
2
+ /**
3
+ * EventSubscription represents a subscription to a particular event. It can
4
+ * remove its own subscription.
5
+ */
6
+ export declare class EventSubscription {
7
+ eventType: string;
8
+ key: number;
9
+ subscriber: EventSubscriptionVendor;
10
+ /**
11
+ * @param {EventSubscriptionVendor} subscriber the subscriber that controls
12
+ * this subscription.
13
+ */
14
+ constructor(subscriber: EventSubscriptionVendor);
15
+ /**
16
+ * Removes this subscription from the subscriber that controls it.
17
+ */
18
+ remove(): void;
19
+ }
@@ -0,0 +1,44 @@
1
+ import type { EventSubscription } from './_EventSubscription';
2
+ /**
3
+ * EventSubscriptionVendor stores a set of EventSubscriptions that are
4
+ * subscribed to a particular event type.
5
+ */
6
+ export declare class EventSubscriptionVendor {
7
+ _subscriptionsForType: Record<string, EventSubscription[] | null | undefined>;
8
+ _currentSubscription: EventSubscription | null | undefined;
9
+ constructor();
10
+ /**
11
+ * Adds a subscription keyed by an event type.
12
+ *
13
+ * @param {string} eventType
14
+ * @param {EventSubscription} subscription
15
+ */
16
+ addSubscription(eventType: string, subscription: EventSubscription): EventSubscription;
17
+ /**
18
+ * Removes a bulk set of the subscriptions.
19
+ *
20
+ * @param {?string} eventType - Optional name of the event type whose
21
+ * registered supscriptions to remove, if null or undefined remove all subscriptions.
22
+ */
23
+ removeAllSubscriptions(eventType: string | undefined | null): void;
24
+ /**
25
+ * Removes a specific subscription. Instead of calling this function, call
26
+ * `subscription.remove()` directly.
27
+ *
28
+ * @param {object} subscription
29
+ */
30
+ removeSubscription(subscription: EventSubscription): void;
31
+ /**
32
+ * Returns the array of subscriptions that are currently registered for the
33
+ * given event type.
34
+ *
35
+ * Note: This array can be potentially sparse as subscriptions are deleted
36
+ * from it when they are removed.
37
+ *
38
+ * TODO: This returns a nullable array. wat?
39
+ *
40
+ * @param {string} eventType
41
+ * @returns {?array}
42
+ */
43
+ getSubscriptionsForType(eventType: string): EventSubscription[] | null | undefined;
44
+ }
@@ -0,0 +1 @@
1
+ export * from './emitter/EventEmitter';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@100mslive/react-native-hms",
3
- "version": "1.4.0",
3
+ "version": "1.6.0",
4
4
  "description": "Integrate Real Time Audio and Video conferencing, Interactive Live Streaming, and Chat in your apps with 100ms React Native SDK. With support for HLS and RTMP Live Streaming and Recording, Picture-in-Picture (PiP), one-to-one Video Call Modes, Audio Rooms, Video Player and much more, add immersive real-time communications to your apps.",
5
5
  "main": "lib/commonjs/index",
6
6
  "module": "lib/module/index",
@@ -68,7 +68,26 @@
68
68
  "ios",
69
69
  "android",
70
70
  "web",
71
- "interactive"
71
+ "interactive",
72
+ "hls",
73
+ "rtmp",
74
+ "pip",
75
+ "voip",
76
+ "player",
77
+ "webrtc",
78
+ "stream",
79
+ "communication",
80
+ "conference",
81
+ "whiteboard",
82
+ "session",
83
+ "polls",
84
+ "quiz",
85
+ "call",
86
+ "callkit",
87
+ "connection",
88
+ "service",
89
+ "telecom",
90
+ "reaction"
72
91
  ],
73
92
  "repository": "https://github.com/100mslive/100ms-react-native",
74
93
  "author": "Yogesh <yogesh@100ms.live> (https://www.100ms.live/)",
package/sdk-versions.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "ios": "0.9.1",
3
- "iOSBroadcastExtension": "0.0.8",
4
- "android": "2.6.0"
2
+ "ios": "0.9.3",
3
+ "iOSBroadcastExtension": "0.0.9",
4
+ "android": "2.6.2"
5
5
  }
@@ -1,17 +1,33 @@
1
+ import type { HMSIOSAudioMode } from './HMSIOSAudioMode';
1
2
  import type { HMSTrackSettingsInitState } from './HMSTrackSettingsInitState';
2
3
 
4
+ /**
5
+ * Customize local peer's Audio track settings before Joining the Room.
6
+ *
7
+ * Checkout Track Settings docs for more details {@link https://www.100ms.live/docs/react-native/v2/how-to-guides/interact-with-room/track/track-settings}
8
+ */
3
9
  export class HMSAudioTrackSettings {
4
10
  initialState?: HMSTrackSettingsInitState;
5
11
  useHardwareEchoCancellation?: boolean; // android only
6
12
  audioSource?: string[]; // ios only
7
13
 
14
+ /**
15
+ * [iOS only] `audioMode` allows you to capture audio in its highest quality
16
+ * by disabling voice processing and increasing the maximum bandwidth limit
17
+ *
18
+ * Checkout Music Mode docs for more details {@link https://www.100ms.live/docs/react-native/v2/how-to-guides/configure-your-device/microphone/music-mode}
19
+ */
20
+ audioMode?: HMSIOSAudioMode; // ios only
21
+
8
22
  constructor(params: {
9
23
  initialState?: HMSTrackSettingsInitState;
10
24
  useHardwareEchoCancellation?: boolean;
11
25
  audioSource?: string[];
26
+ audioMode?: HMSIOSAudioMode;
12
27
  }) {
13
28
  this.useHardwareEchoCancellation = params.useHardwareEchoCancellation;
14
29
  this.initialState = params.initialState;
15
30
  this.audioSource = params.audioSource;
31
+ this.audioMode = params.audioMode;
16
32
  }
17
33
  }
@@ -0,0 +1,21 @@
1
+ import { NativeModules } from 'react-native';
2
+ import { HMSConstants } from './HMSConstants';
3
+
4
+ const { HMSManager } = NativeModules;
5
+
6
+ export class HMSCameraControl {
7
+ /**
8
+ * It captures the image from the device camera at max possible resolution.
9
+ *
10
+ * @param {boolean} [flash=false] flash - value indicating whether to use flash while capturing image or not
11
+ * @returns Promise - which is resolved with the file path of the captured image saved on the disk
12
+ */
13
+ static captureImageAtMaxSupportedResolution(
14
+ flash: boolean = false
15
+ ): Promise<string> {
16
+ return HMSManager.captureImageAtMaxSupportedResolution({
17
+ id: HMSConstants.DEFAULT_SDK_ID,
18
+ flash,
19
+ });
20
+ }
21
+ }