@100mslive/react-native-hms 1.8.0 → 1.9.1-beta.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 (214) hide show
  1. package/android/build.gradle +3 -3
  2. package/android/local.properties +8 -1
  3. package/android/src/main/java/com/reactnativehmssdk/HMSAudioshareActivity.kt +1 -1
  4. package/android/src/main/java/com/reactnativehmssdk/HMSDecoder.kt +15 -5
  5. package/android/src/main/java/com/reactnativehmssdk/HMSHLSPlayer.kt +4 -3
  6. package/android/src/main/java/com/reactnativehmssdk/HMSHelper.kt +43 -5
  7. package/android/src/main/java/com/reactnativehmssdk/HMSManager.kt +147 -47
  8. package/android/src/main/java/com/reactnativehmssdk/HMSRNSDK.kt +419 -248
  9. package/android/src/main/java/com/reactnativehmssdk/HMSView.kt +24 -4
  10. package/android/src/main/java/com/reactnativehmssdk/HmsScreenshareActivity.kt +1 -1
  11. package/ios/HMSConstants.swift +1 -0
  12. package/ios/HMSDecoder.swift +16 -5
  13. package/ios/HMSHLSPlayerManager.swift +20 -11
  14. package/ios/HMSHelper.swift +33 -4
  15. package/ios/HMSManager.m +66 -10
  16. package/ios/HMSManager.swift +65 -21
  17. package/ios/HMSRNSDK.swift +244 -100
  18. package/ios/Hmssdk.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
  19. package/ios/Hmssdk.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
  20. package/ios/Hmssdk.xcodeproj/project.xcworkspace/xcuserdata/jatinnagar.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
  21. package/ios/Hmssdk.xcodeproj/xcuserdata/jatinnagar.xcuserdatad/xcschemes/xcschememanagement.plist +14 -0
  22. package/lib/commonjs/classes/HMSAudioCodec.js +1 -2
  23. package/lib/commonjs/classes/HMSAudioCodec.js.map +1 -1
  24. package/lib/commonjs/classes/HMSAudioDevice.js +1 -2
  25. package/lib/commonjs/classes/HMSAudioDevice.js.map +1 -1
  26. package/lib/commonjs/classes/HMSAudioMixingMode.js +1 -2
  27. package/lib/commonjs/classes/HMSAudioMixingMode.js.map +1 -1
  28. package/lib/commonjs/classes/HMSAudioMode.js +1 -2
  29. package/lib/commonjs/classes/HMSAudioMode.js.map +1 -1
  30. package/lib/commonjs/classes/HMSCameraFacing.js +1 -2
  31. package/lib/commonjs/classes/HMSCameraFacing.js.map +1 -1
  32. package/lib/commonjs/classes/HMSConstants.js +1 -2
  33. package/lib/commonjs/classes/HMSConstants.js.map +1 -1
  34. package/lib/commonjs/classes/HMSEventEmitter.js +1 -2
  35. package/lib/commonjs/classes/HMSEventEmitter.js.map +1 -1
  36. package/lib/commonjs/classes/HMSIOSAudioMode.js +1 -2
  37. package/lib/commonjs/classes/HMSIOSAudioMode.js.map +1 -1
  38. package/lib/commonjs/classes/HMSLayer.js +1 -2
  39. package/lib/commonjs/classes/HMSLayer.js.map +1 -1
  40. package/lib/commonjs/classes/HMSLogAlarmManager.js +1 -2
  41. package/lib/commonjs/classes/HMSLogAlarmManager.js.map +1 -1
  42. package/lib/commonjs/classes/HMSLogLevel.js +1 -2
  43. package/lib/commonjs/classes/HMSLogLevel.js.map +1 -1
  44. package/lib/commonjs/classes/HMSLogger.js +1 -2
  45. package/lib/commonjs/classes/HMSLogger.js.map +1 -1
  46. package/lib/commonjs/classes/HMSManagerModule.js +1 -2
  47. package/lib/commonjs/classes/HMSManagerModule.js.map +1 -1
  48. package/lib/commonjs/classes/HMSMessageRecipientType.js +1 -2
  49. package/lib/commonjs/classes/HMSMessageRecipientType.js.map +1 -1
  50. package/lib/commonjs/classes/HMSNativeEventListener.js +1 -2
  51. package/lib/commonjs/classes/HMSNativeEventListener.js.map +1 -1
  52. package/lib/commonjs/classes/HMSPIPConfig.js +4 -0
  53. package/lib/commonjs/classes/HMSPIPConfig.js.map +1 -0
  54. package/lib/commonjs/classes/HMSPIPListenerActions.js +2 -2
  55. package/lib/commonjs/classes/HMSPIPListenerActions.js.map +1 -1
  56. package/lib/commonjs/classes/HMSPeer.js +15 -0
  57. package/lib/commonjs/classes/HMSPeer.js.map +1 -1
  58. package/lib/commonjs/classes/HMSPeerListIterator.js +64 -0
  59. package/lib/commonjs/classes/HMSPeerListIterator.js.map +1 -0
  60. package/lib/commonjs/classes/HMSPeerListIteratorOptions.js +2 -0
  61. package/lib/commonjs/classes/HMSPeerListIteratorOptions.js.map +1 -0
  62. package/lib/commonjs/classes/HMSPeerUpdate.js +3 -4
  63. package/lib/commonjs/classes/HMSPeerUpdate.js.map +1 -1
  64. package/lib/commonjs/classes/HMSPeersCache.js +8 -2
  65. package/lib/commonjs/classes/HMSPeersCache.js.map +1 -1
  66. package/lib/commonjs/classes/HMSQualityLimitationReason.js +1 -2
  67. package/lib/commonjs/classes/HMSQualityLimitationReason.js.map +1 -1
  68. package/lib/commonjs/classes/HMSRoomCache.js +1 -2
  69. package/lib/commonjs/classes/HMSRoomCache.js.map +1 -1
  70. package/lib/commonjs/classes/HMSRoomUpdate.js +1 -2
  71. package/lib/commonjs/classes/HMSRoomUpdate.js.map +1 -1
  72. package/lib/commonjs/classes/HMSSDK.js +152 -8
  73. package/lib/commonjs/classes/HMSSDK.js.map +1 -1
  74. package/lib/commonjs/classes/HMSTrackSettingsInitState.js +1 -2
  75. package/lib/commonjs/classes/HMSTrackSettingsInitState.js.map +1 -1
  76. package/lib/commonjs/classes/HMSTrackSource.js +1 -2
  77. package/lib/commonjs/classes/HMSTrackSource.js.map +1 -1
  78. package/lib/commonjs/classes/HMSTrackType.js +1 -2
  79. package/lib/commonjs/classes/HMSTrackType.js.map +1 -1
  80. package/lib/commonjs/classes/HMSTrackUpdate.js +1 -2
  81. package/lib/commonjs/classes/HMSTrackUpdate.js.map +1 -1
  82. package/lib/commonjs/classes/HMSUpdateListenerActions.js +2 -2
  83. package/lib/commonjs/classes/HMSUpdateListenerActions.js.map +1 -1
  84. package/lib/commonjs/classes/HMSVideoCodec.js +1 -2
  85. package/lib/commonjs/classes/HMSVideoCodec.js.map +1 -1
  86. package/lib/commonjs/classes/HMSVideoViewMode.js +1 -2
  87. package/lib/commonjs/classes/HMSVideoViewMode.js.map +1 -1
  88. package/lib/commonjs/classes/HmsView.js +17 -5
  89. package/lib/commonjs/classes/HmsView.js.map +1 -1
  90. package/lib/commonjs/components/HMSHLSPlayer/HMSHLSPlayer.js +11 -9
  91. package/lib/commonjs/components/HMSHLSPlayer/HMSHLSPlayer.js.map +1 -1
  92. package/lib/commonjs/components/HMSHLSPlayer/RCTHMSHLSPlayer.js +2 -4
  93. package/lib/commonjs/components/HMSHLSPlayer/RCTHMSHLSPlayer.js.map +1 -1
  94. package/lib/commonjs/components/HMSHLSPlayer/hooks.js +11 -11
  95. package/lib/commonjs/components/HMSHLSPlayer/hooks.js.map +1 -1
  96. package/lib/commonjs/components/HMSHLSPlayer/index.js +8 -1
  97. package/lib/commonjs/components/HMSHLSPlayer/index.js.map +1 -1
  98. package/lib/commonjs/hooks/hmsviews.js +17 -0
  99. package/lib/commonjs/hooks/hmsviews.js.map +1 -0
  100. package/lib/commonjs/hooks/useHMSPeerUpdates.js +2 -2
  101. package/lib/commonjs/hooks/useHMSPeerUpdates.js.map +1 -1
  102. package/lib/commonjs/index.js +10 -3
  103. package/lib/commonjs/index.js.map +1 -1
  104. package/lib/commonjs/stores/hls-player-playback-slice.js +4 -0
  105. package/lib/commonjs/stores/hls-player-playback-slice.js.map +1 -1
  106. package/lib/commonjs/stores/hls-player-stats-store.js +1 -2
  107. package/lib/commonjs/stores/hls-player-stats-store.js.map +1 -1
  108. package/lib/commonjs/stores/hms-store.js +4 -3
  109. package/lib/commonjs/stores/hms-store.js.map +1 -1
  110. package/lib/commonjs/stores/hmsviews-slice.js +19 -0
  111. package/lib/commonjs/stores/hmsviews-slice.js.map +1 -0
  112. package/lib/commonjs/stores/types.js +9 -0
  113. package/lib/commonjs/stores/types.js.map +1 -1
  114. package/lib/commonjs/types.js +4 -7
  115. package/lib/commonjs/types.js.map +1 -1
  116. package/lib/module/classes/HMSPIPConfig.js +2 -0
  117. package/lib/module/classes/HMSPIPConfig.js.map +1 -0
  118. package/lib/module/classes/HMSPIPListenerActions.js +1 -0
  119. package/lib/module/classes/HMSPIPListenerActions.js.map +1 -1
  120. package/lib/module/classes/HMSPeer.js +15 -0
  121. package/lib/module/classes/HMSPeer.js.map +1 -1
  122. package/lib/module/classes/HMSPeerListIterator.js +58 -0
  123. package/lib/module/classes/HMSPeerListIterator.js.map +1 -0
  124. package/lib/module/classes/HMSPeerListIteratorOptions.js +2 -0
  125. package/lib/module/classes/HMSPeerListIteratorOptions.js.map +1 -0
  126. package/lib/module/classes/HMSPeerUpdate.js +2 -1
  127. package/lib/module/classes/HMSPeerUpdate.js.map +1 -1
  128. package/lib/module/classes/HMSPeersCache.js +7 -0
  129. package/lib/module/classes/HMSPeersCache.js.map +1 -1
  130. package/lib/module/classes/HMSSDK.js +153 -10
  131. package/lib/module/classes/HMSSDK.js.map +1 -1
  132. package/lib/module/classes/HMSUpdateListenerActions.js +1 -0
  133. package/lib/module/classes/HMSUpdateListenerActions.js.map +1 -1
  134. package/lib/module/classes/HmsView.js +14 -1
  135. package/lib/module/classes/HmsView.js.map +1 -1
  136. package/lib/module/components/HMSHLSPlayer/HMSHLSPlayer.js +9 -6
  137. package/lib/module/components/HMSHLSPlayer/HMSHLSPlayer.js.map +1 -1
  138. package/lib/module/components/HMSHLSPlayer/hooks.js +4 -0
  139. package/lib/module/components/HMSHLSPlayer/hooks.js.map +1 -1
  140. package/lib/module/components/HMSHLSPlayer/index.js +1 -1
  141. package/lib/module/components/HMSHLSPlayer/index.js.map +1 -1
  142. package/lib/module/hooks/hmsviews.js +12 -0
  143. package/lib/module/hooks/hmsviews.js.map +1 -0
  144. package/lib/module/index.js +1 -0
  145. package/lib/module/index.js.map +1 -1
  146. package/lib/module/stores/hls-player-playback-slice.js +4 -0
  147. package/lib/module/stores/hls-player-playback-slice.js.map +1 -1
  148. package/lib/module/stores/hms-store.js +3 -1
  149. package/lib/module/stores/hms-store.js.map +1 -1
  150. package/lib/module/stores/hmsviews-slice.js +12 -0
  151. package/lib/module/stores/hmsviews-slice.js.map +1 -0
  152. package/lib/module/stores/types.js +9 -0
  153. package/lib/module/stores/types.js.map +1 -1
  154. package/lib/module/types.js +1 -1
  155. package/lib/module/types.js.map +1 -1
  156. package/lib/typescript/classes/HMSPIPConfig.d.ts +7 -0
  157. package/lib/typescript/classes/HMSPIPListenerActions.d.ts +1 -0
  158. package/lib/typescript/classes/HMSPeer.d.ts +3 -0
  159. package/lib/typescript/classes/HMSPeerListIterator.d.ts +9 -0
  160. package/lib/typescript/classes/HMSPeerListIteratorOptions.d.ts +24 -0
  161. package/lib/typescript/classes/HMSPeerUpdate.d.ts +2 -1
  162. package/lib/typescript/classes/HMSPeersCache.d.ts +1 -0
  163. package/lib/typescript/classes/HMSSDK.d.ts +47 -8
  164. package/lib/typescript/classes/HMSUpdateListenerActions.d.ts +2 -1
  165. package/lib/typescript/components/HMSHLSPlayer/hooks.d.ts +2 -0
  166. package/lib/typescript/components/HMSHLSPlayer/index.d.ts +1 -1
  167. package/lib/typescript/hooks/hmsviews.d.ts +3 -0
  168. package/lib/typescript/index.d.ts +2 -0
  169. package/lib/typescript/stores/hms-store.d.ts +4 -3
  170. package/lib/typescript/stores/hmsviews-slice.d.ts +5 -0
  171. package/lib/typescript/stores/types.d.ts +14 -2
  172. package/lib/typescript/types.d.ts +9 -5
  173. package/package.json +3 -1
  174. package/sdk-versions.json +2 -2
  175. package/src/classes/HMSPIPConfig.ts +7 -0
  176. package/src/classes/HMSPIPListenerActions.ts +1 -0
  177. package/src/classes/HMSPeer.ts +25 -0
  178. package/src/classes/HMSPeerListIterator.ts +60 -0
  179. package/src/classes/HMSPeerListIteratorOptions.ts +26 -0
  180. package/src/classes/HMSPeerUpdate.ts +2 -0
  181. package/src/classes/HMSPeersCache.ts +7 -0
  182. package/src/classes/HMSSDK.tsx +188 -13
  183. package/src/classes/HMSUpdateListenerActions.ts +1 -0
  184. package/src/classes/HmsView.tsx +16 -2
  185. package/src/components/HMSHLSPlayer/HMSHLSPlayer.tsx +11 -5
  186. package/src/components/HMSHLSPlayer/hooks.ts +7 -0
  187. package/src/components/HMSHLSPlayer/index.ts +1 -0
  188. package/src/hooks/hmsviews.ts +13 -0
  189. package/src/index.ts +2 -0
  190. package/src/stores/hls-player-playback-slice.ts +3 -0
  191. package/src/stores/hms-store.ts +2 -0
  192. package/src/stores/hmsviews-slice.ts +20 -0
  193. package/src/stores/types.ts +20 -1
  194. package/src/types.ts +13 -3
  195. package/android/.gradle/6.7.1/executionHistory/executionHistory.bin +0 -0
  196. package/android/.gradle/6.7.1/executionHistory/executionHistory.lock +0 -0
  197. package/android/.gradle/6.7.1/fileChanges/last-build.bin +0 -0
  198. package/android/.gradle/6.7.1/fileHashes/fileHashes.bin +0 -0
  199. package/android/.gradle/6.7.1/fileHashes/fileHashes.lock +0 -0
  200. package/android/.gradle/6.7.1/gc.properties +0 -0
  201. package/android/.gradle/6.9/executionHistory/executionHistory.bin +0 -0
  202. package/android/.gradle/6.9/executionHistory/executionHistory.lock +0 -0
  203. package/android/.gradle/6.9/fileChanges/last-build.bin +0 -0
  204. package/android/.gradle/6.9/fileHashes/fileHashes.bin +0 -0
  205. package/android/.gradle/6.9/fileHashes/fileHashes.lock +0 -0
  206. package/android/.gradle/6.9/gc.properties +0 -0
  207. package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
  208. package/android/.gradle/buildOutputCleanup/cache.properties +0 -2
  209. package/android/.gradle/buildOutputCleanup/outputFiles.bin +0 -0
  210. package/android/.gradle/checksums/checksums.lock +0 -0
  211. package/android/.gradle/checksums/md5-checksums.bin +0 -0
  212. package/android/.gradle/checksums/sha1-checksums.bin +0 -0
  213. package/android/.gradle/configuration-cache/gc.properties +0 -0
  214. package/android/.gradle/vcs-1/gc.properties +0 -0
@@ -18,13 +18,10 @@ import type { HMSAudioMode } from './HMSAudioMode';
18
18
  import type { HMSAudioMixingMode } from './HMSAudioMixingMode';
19
19
  import type { HMSLogSettings } from './HMSLogSettings';
20
20
  import { HMSPIPListenerActions } from './HMSPIPListenerActions';
21
+ import type { HMSPeerListIteratorOptions } from './HMSPeerListIteratorOptions';
22
+ import { HMSPeerListIterator } from './HMSPeerListIterator';
23
+ import type { HMSPIPConfig } from './HMSPIPConfig';
21
24
  type HmsViewProps = Omit<HmsComponentProps, 'id'>;
22
- interface PIPConfig {
23
- aspectRatio?: [number, number];
24
- endButton?: boolean;
25
- audioButton?: boolean;
26
- videoButton?: boolean;
27
- }
28
25
  export declare class HMSSDK {
29
26
  id: string;
30
27
  private muteStatus;
@@ -33,6 +30,7 @@ export declare class HMSSDK {
33
30
  private onJoinDelegate?;
34
31
  private onRoomDelegate?;
35
32
  private onPeerDelegate?;
33
+ private onPeerListUpdatedDelegate?;
36
34
  private onTrackDelegate?;
37
35
  private onErrorDelegate?;
38
36
  private onMessageDelegate?;
@@ -50,6 +48,7 @@ export declare class HMSSDK {
50
48
  private onAudioDeviceChangedDelegate?;
51
49
  private onSessionStoreAvailableDelegate?;
52
50
  private onPIPRoomLeaveDelegate?;
51
+ private onPIPModeChangedDelegate?;
53
52
  private emitterSubscriptions;
54
53
  private constructor();
55
54
  /**
@@ -525,6 +524,40 @@ export declare class HMSSDK {
525
524
  getRemoteVideoTrackFromTrackId: (trackId: string) => Promise<import("./HMSRemoteVideoTrack").HMSRemoteVideoTrack>;
526
525
  getRemoteAudioTrackFromTrackId: (trackId: string) => Promise<import("./HMSRemoteAudioTrack").HMSRemoteAudioTrack>;
527
526
  getPeerFromPeerId: (peerId: string) => HMSPeer | undefined;
527
+ /**
528
+ * - This function is used to raise hand for the local peer
529
+ * @memberof HMSSDK
530
+ */
531
+ raiseLocalPeerHand: () => Promise<any>;
532
+ /**
533
+ * - This function is used to lower hand for the local peer
534
+ * @memberof HMSSDK
535
+ */
536
+ lowerLocalPeerHand: () => Promise<any>;
537
+ /**
538
+ * - This function is used to lower hand for the remote peer
539
+ * @param peer
540
+ */
541
+ lowerRemotePeerHand: (peer: HMSPeer) => Promise<any>;
542
+ /**
543
+ * `getPeerListIterator` method returns an instance of `HMSPeerListIterator` class
544
+ *
545
+ * @param options options for configuring iterator
546
+ * @returns instance of HMSPeerListIterator class
547
+ *
548
+ * Example usage:
549
+ * ```
550
+ * const peerListIterator = hmsInstance.getPeerListIterator();
551
+ * ```
552
+ * OR
553
+ * ```
554
+ * const peerListIterator = hmsInstance.getPeerListIterator({
555
+ * limit: 10,
556
+ * byRoleName: 'viewer-realtime',
557
+ * });
558
+ * ```
559
+ */
560
+ getPeerListIterator: (options?: HMSPeerListIteratorOptions) => HMSPeerListIterator;
528
561
  /**
529
562
  * - This is a prototype event listener that takes action and listens for updates related to that particular action
530
563
  *
@@ -565,6 +598,9 @@ export declare class HMSSDK {
565
598
  onJoinListener: (data: any) => void;
566
599
  onRoomListener: (data: any) => void;
567
600
  onPeerListener: (peerData: any) => void;
601
+ private sendPeerUpdate;
602
+ private sendPeerUpdateWhenPeerLeaves;
603
+ onPeerListUpdatedListener: (data: any) => void;
568
604
  onTrackListener: (data: any) => void;
569
605
  onMessageListener: (data: any) => void;
570
606
  onSpeakerListener: (data: any) => void;
@@ -590,9 +626,12 @@ export declare class HMSSDK {
590
626
  onPIPRoomLeaveListener: (data: {
591
627
  id: string;
592
628
  }) => void;
629
+ onPIPModeChangedListener: (data: {
630
+ isInPictureInPictureMode: boolean;
631
+ }) => void;
593
632
  isPipModeSupported(): Promise<undefined | boolean>;
594
- enablePipMode(data?: PIPConfig): Promise<undefined | boolean>;
595
- setPipParams(data?: PIPConfig): Promise<undefined | boolean>;
633
+ enterPipMode(data?: HMSPIPConfig): Promise<undefined | boolean>;
634
+ setPipParams(data?: HMSPIPConfig): Promise<undefined | boolean>;
596
635
  /**
597
636
  * - Returns the instance of logger which can be used to manipulate log levels.
598
637
  * @returns @instance HMSLogger
@@ -25,5 +25,6 @@ export declare enum HMSUpdateListenerActions {
25
25
  ON_REMOTE_VIDEO_STATS = "ON_REMOTE_VIDEO_STATS",
26
26
  ON_AUDIO_DEVICE_CHANGED = "ON_AUDIO_DEVICE_CHANGED",
27
27
  ON_SESSION_STORE_AVAILABLE = "ON_SESSION_STORE_AVAILABLE",
28
- ON_SESSION_STORE_CHANGED = "ON_SESSION_STORE_CHANGED"
28
+ ON_SESSION_STORE_CHANGED = "ON_SESSION_STORE_CHANGED",
29
+ ON_PEER_LIST_UPDATED = "ON_PEER_LIST_UPDATED"
29
30
  }
@@ -2,6 +2,7 @@ import type { DependencyList } from 'react';
2
2
  import type { HMSHLSPlayerStatsUpdateEventData } from '../../types';
3
3
  import type { HMSHLSPlayerCue, HMSHLSPlayerPlaybackError, HMSHLSPlayerStatsError } from '../../stores/types';
4
4
  export declare const useHMSHLSPlayerPlaybackState: () => import("../../types").HMSHLSPlayerPlaybackState;
5
+ export declare const useHMSHLSPlayerResolution: () => import("../../stores/types").HMSHLSPlayerResolution;
5
6
  export declare const useHMSHLSPlayerStats: () => {
6
7
  stats: HMSHLSPlayerStatsUpdateEventData;
7
8
  error: HMSHLSPlayerStatsError;
@@ -11,6 +12,7 @@ export declare const useHMSHLSPlayerStatsError: (callback: (error: NonNullable<H
11
12
  export declare const useHMSHLSPlayerPlaybackError: (callback: (error: NonNullable<HMSHLSPlayerPlaybackError>) => void, deps: DependencyList) => void;
12
13
  export declare const useHMSHLSPlayerCue: (callback: (error: NonNullable<HMSHLSPlayerCue>) => void, deps: DependencyList) => void;
13
14
  export declare const setHMSHLSPlayerPlaybackState: (playbackState: import("../../types").HMSHLSPlayerPlaybackState) => void;
15
+ export declare const setHMSHLSPlayerResolution: (resolution: import("../../stores/types").HMSHLSPlayerResolution) => void;
14
16
  export declare const setHMSHLSPlayerCue: (cue: import("../../stores/types").HMSHLSPlayerPlaybackCue) => void;
15
17
  export declare const setHMSHLSPlayerPlaybackError: (error: HMSHLSPlayerPlaybackError) => void;
16
18
  export declare const setHMSHLSPlayerStats: (stats: HMSHLSPlayerStatsUpdateEventData) => void;
@@ -1,2 +1,2 @@
1
1
  export * from './HMSHLSPlayer';
2
- export { useHMSHLSPlayerPlaybackState, useHMSHLSPlayerCue, useHMSHLSPlayerPlaybackError, useHMSHLSPlayerStats, useHMSHLSPlayerStat, useHMSHLSPlayerStatsError, } from './hooks';
2
+ export { useHMSHLSPlayerPlaybackState, useHMSHLSPlayerCue, useHMSHLSPlayerPlaybackError, useHMSHLSPlayerStats, useHMSHLSPlayerStat, useHMSHLSPlayerStatsError, useHMSHLSPlayerResolution, } from './hooks';
@@ -0,0 +1,3 @@
1
+ import type { TrackId } from '../stores/types';
2
+ export declare const useHmsViewsResolutionsState: (trackId?: TrackId) => import("../stores/types").Resolution | undefined;
3
+ export declare const setHmsViewsResolutionsState: (trackId: string, resolution: import("../stores/types").Resolution) => void;
@@ -82,10 +82,12 @@ export * from './classes/HMSCameraControl';
82
82
  export * from './classes/HMSIOSAudioMode';
83
83
  export type { HMSSessionStore, HMSSessionStoreValue, } from './classes/HMSSessionStore';
84
84
  export type { HmsViewComponent as HMSView, HmsComponentProps as HMSViewProps, } from './classes/HmsView';
85
+ export type { HMSPIPConfig } from './classes/HMSPIPConfig';
85
86
  import { HMSSDK as HmsManager } from './classes/HMSSDK';
86
87
  export { default as HMSManagerModule } from './classes/HMSManagerModule';
87
88
  export * from './components/HMSHLSPlayer';
88
89
  export * from './hooks/useHMSPeerUpdates';
90
+ export { useHmsViewsResolutionsState } from './hooks/hmsviews';
89
91
  export * from './types';
90
92
  export * from './stores/types';
91
93
  export default HmsManager;
@@ -1,7 +1,8 @@
1
- export declare const useHMSStore: import("zustand").UseBoundStore<Omit<import("zustand").StoreApi<import("./types").HMSHLSPlayerPlaybackSlice>, "subscribe"> & {
1
+ import type { HMSStore } from './types';
2
+ export declare const useHMSStore: import("zustand").UseBoundStore<Omit<import("zustand").StoreApi<HMSStore>, "subscribe"> & {
2
3
  subscribe: {
3
- (listener: (selectedState: import("./types").HMSHLSPlayerPlaybackSlice, previousSelectedState: import("./types").HMSHLSPlayerPlaybackSlice) => void): () => void;
4
- <U>(selector: (state: import("./types").HMSHLSPlayerPlaybackSlice) => U, listener: (selectedState: U, previousSelectedState: U) => void, options?: {
4
+ (listener: (selectedState: HMSStore, previousSelectedState: HMSStore) => void): () => void;
5
+ <U>(selector: (state: HMSStore) => U, listener: (selectedState: U, previousSelectedState: U) => void, options?: {
5
6
  equalityFn?: ((a: U, b: U) => boolean) | undefined;
6
7
  fireImmediately?: boolean | undefined;
7
8
  } | undefined): () => void;
@@ -0,0 +1,5 @@
1
+ import type { StateCreator } from 'zustand';
2
+ import type { HMSViewsSlice, HMSStore } from './types';
3
+ export declare const createHMSViewsSlice: StateCreator<HMSStore, [
4
+ ], [
5
+ ], HMSViewsSlice>;
@@ -1,18 +1,30 @@
1
- import type { HMSHLSPlayerPlaybackState, HMSHLSPlayerPlaybackCueEventData, HMSHLSPlayerPlaybackFailureEventData, HMSHLSPlayerStatsErrorEventData, HMSHLSPlayerStatsUpdateEventData } from '../types';
2
- export type HMSStore = HMSHLSPlayerPlaybackSlice;
1
+ import type { HMSHLSPlayerPlaybackState, HMSHLSPlayerPlaybackCueEventData, HMSHLSPlayerPlaybackFailureEventData, HMSHLSPlayerPlaybackResolutionChangeEventData, HMSHLSPlayerStatsErrorEventData, HMSHLSPlayerStatsUpdateEventData } from '../types';
2
+ export type HMSStore = HMSHLSPlayerPlaybackSlice & HMSViewsSlice;
3
3
  export type HMSHLSPlayerStatsStore = HMSHLSPlayerStatsSlice;
4
+ export type TrackId = string;
5
+ export type Resolution = {
6
+ width: number;
7
+ height: number;
8
+ };
9
+ export interface HMSViewsSlice {
10
+ hmsviewsResolutions: Record<TrackId, Resolution | undefined>;
11
+ setHmsviewsResolutions(trackId: TrackId, resolution: Resolution): void;
12
+ }
4
13
  export interface HMSHLSPlayerPlaybackCue extends Omit<HMSHLSPlayerPlaybackCueEventData, 'endDate' | 'startDate'> {
5
14
  endDate?: Date;
6
15
  startDate: Date;
7
16
  }
8
17
  export type HMSHLSPlayerCue = HMSHLSPlayerPlaybackCue | undefined;
9
18
  export type HMSHLSPlayerPlaybackError = HMSHLSPlayerPlaybackFailureEventData['error'] | undefined;
19
+ export type HMSHLSPlayerResolution = HMSHLSPlayerPlaybackResolutionChangeEventData | undefined;
10
20
  export interface HMSHLSPlayerPlaybackSlice {
11
21
  cue: HMSHLSPlayerCue;
12
22
  playbackState: HMSHLSPlayerPlaybackState;
23
+ resolution: HMSHLSPlayerResolution;
13
24
  error: HMSHLSPlayerPlaybackError;
14
25
  setCue(cue: HMSHLSPlayerPlaybackCue): void;
15
26
  setPlaybackState(playbackState: HMSHLSPlayerPlaybackState): void;
27
+ setResolution(resolution: HMSHLSPlayerResolution): void;
16
28
  setPlaybackError(error: HMSHLSPlayerPlaybackError): void;
17
29
  }
18
30
  export type HMSHLSPlayerStats = HMSHLSPlayerStatsUpdateEventData;
@@ -5,7 +5,8 @@ type HMSHLSPlayerEvent<T extends string, U> = {
5
5
  export declare enum HMSHLSPlayerPlaybackEventTypes {
6
6
  ON_PLAYBACK_CUE_EVENT = "ON_PLAYBACK_CUE_EVENT",
7
7
  ON_PLAYBACK_FAILURE_EVENT = "ON_PLAYBACK_FAILURE_EVENT",
8
- ON_PLAYBACK_STATE_CHANGE_EVENT = "ON_PLAYBACK_STATE_CHANGE_EVENT"
8
+ ON_PLAYBACK_STATE_CHANGE_EVENT = "ON_PLAYBACK_STATE_CHANGE_EVENT",
9
+ ON_PLAYBACK_RESOLUTION_CHANGE_EVENT = "ON_PLAYBACK_RESOLUTION_CHANGE_EVENT"
9
10
  }
10
11
  export type HMSHLSPlayerPlaybackCueEventData = {
11
12
  id?: string;
@@ -26,17 +27,20 @@ export declare enum HMSHLSPlayerPlaybackState {
26
27
  PAUSED = "paused",
27
28
  PLAYING = "playing",
28
29
  STOPPED = "stopped",
29
- UNKNOWN = "unknown",
30
- onVideoSizeChanged = "onVideoSizeChanged"
30
+ UNKNOWN = "unknown"
31
31
  }
32
32
  export type HMSHLSPlayerPlaybackStateChangeEventData = {
33
33
  state: HMSHLSPlayerPlaybackState;
34
- aspectRatio: number | undefined;
34
+ };
35
+ export type HMSHLSPlayerPlaybackResolutionChangeEventData = {
36
+ width: number;
37
+ height: number;
35
38
  };
36
39
  type HMSHLSPlayerPlaybackCueEvent = HMSHLSPlayerEvent<HMSHLSPlayerPlaybackEventTypes.ON_PLAYBACK_CUE_EVENT, HMSHLSPlayerPlaybackCueEventData>;
37
40
  type HMSHLSPlayerPlaybackFailureEvent = HMSHLSPlayerEvent<HMSHLSPlayerPlaybackEventTypes.ON_PLAYBACK_FAILURE_EVENT, HMSHLSPlayerPlaybackFailureEventData>;
38
41
  type HMSHLSPlayerPlaybackStateChangeEvent = HMSHLSPlayerEvent<HMSHLSPlayerPlaybackEventTypes.ON_PLAYBACK_STATE_CHANGE_EVENT, HMSHLSPlayerPlaybackStateChangeEventData>;
39
- export type HMSHLSPlayerPlaybackEvent = HMSHLSPlayerPlaybackCueEvent | HMSHLSPlayerPlaybackFailureEvent | HMSHLSPlayerPlaybackStateChangeEvent;
42
+ type HMSHLSPLayerPlaybackResolutionChangeEvent = HMSHLSPlayerEvent<HMSHLSPlayerPlaybackEventTypes.ON_PLAYBACK_RESOLUTION_CHANGE_EVENT, HMSHLSPlayerPlaybackResolutionChangeEventData>;
43
+ export type HMSHLSPlayerPlaybackEvent = HMSHLSPlayerPlaybackCueEvent | HMSHLSPlayerPlaybackFailureEvent | HMSHLSPlayerPlaybackStateChangeEvent | HMSHLSPLayerPlaybackResolutionChangeEvent;
40
44
  export declare enum HMSHLSPlayerStatsEventTypes {
41
45
  ON_STATS_EVENT_ERROR = "ON_STATS_EVENT_ERROR",
42
46
  ON_STATS_EVENT_UPDATE = "ON_STATS_EVENT_UPDATE"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@100mslive/react-native-hms",
3
- "version": "1.8.0",
3
+ "version": "1.9.1-beta.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",
@@ -17,6 +17,8 @@
17
17
  "sdk-versions.json",
18
18
  "!lib/typescript/example",
19
19
  "!android/build",
20
+ "!android/.gradle",
21
+ "!android/.idea",
20
22
  "!ios/build",
21
23
  "!**/__tests__",
22
24
  "!**/__fixtures__",
package/sdk-versions.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
- "ios": "0.9.12",
2
+ "ios": "1.1.0",
3
3
  "iOSBroadcastExtension": "0.0.9",
4
4
  "iOSHMSHLSPlayer": "0.0.2",
5
- "android": "2.7.6"
5
+ "android": "2.7.9"
6
6
  }
@@ -0,0 +1,7 @@
1
+ export interface HMSPIPConfig {
2
+ autoEnterPipMode?: boolean;
3
+ aspectRatio?: [number, number];
4
+ endButton?: boolean;
5
+ audioButton?: boolean;
6
+ videoButton?: boolean;
7
+ };
@@ -1,3 +1,4 @@
1
1
  export enum HMSPIPListenerActions {
2
+ ON_PIP_MODE_CHANGED = 'ON_PIP_MODE_CHANGED',
2
3
  ON_PIP_ROOM_LEAVE = 'ON_PIP_ROOM_LEAVE',
3
4
  }
@@ -13,6 +13,7 @@ export class HMSPeer {
13
13
  private _customerUserID: string | undefined;
14
14
  private _metadata: string | undefined;
15
15
  private _role: HMSRole | undefined;
16
+ private _isHandRaised: boolean = false;
16
17
 
17
18
  private _updateIsLocal(value: boolean) {
18
19
  // If `_isLocal` is outdated, update it
@@ -21,6 +22,13 @@ export class HMSPeer {
21
22
  }
22
23
  }
23
24
 
25
+ private _updateIsHandRaised(value: boolean) {
26
+ // If `_isHandRaised` is outdated, update it
27
+ if (this._isHandRaised !== value) {
28
+ this._isHandRaised = value;
29
+ }
30
+ }
31
+
24
32
  private _updateCustomerUserID(value: string) {
25
33
  // If `_customerUserID` is outdated, update it
26
34
  if (this._customerUserID !== value) {
@@ -64,6 +72,23 @@ export class HMSPeer {
64
72
  return value ?? this._isLocal;
65
73
  }
66
74
 
75
+ get isHandRaised(): boolean {
76
+ const hmsPeersCache = getHmsPeersCache();
77
+
78
+ const value = hmsPeersCache
79
+ ? hmsPeersCache.getProperty(this.peerID, 'isHandRaised')
80
+ : getPeerPropertyFromNative(
81
+ HMSConstants.DEFAULT_SDK_ID,
82
+ this.peerID,
83
+ 'isHandRaised'
84
+ );
85
+
86
+ if (typeof value === 'boolean') {
87
+ this._updateIsHandRaised(value);
88
+ }
89
+ return value ?? this._isHandRaised;
90
+ }
91
+
67
92
  get networkQuality(): HMSNetworkQuality | undefined {
68
93
  const hmsPeersCache = getHmsPeersCache();
69
94
 
@@ -0,0 +1,60 @@
1
+ // import type { HMSException } from "./HMSException";
2
+ import type { HMSPeer } from './HMSPeer';
3
+ import HMSManagerModule from './HMSManagerModule';
4
+ import { HMSEncoder, logger } from '@100mslive/react-native-hms';
5
+ import { HMSConstants } from './HMSConstants';
6
+ import { getHmsPeersCache } from './HMSPeersCache';
7
+
8
+ export class HMSPeerListIterator {
9
+ private readonly uniqueId: string;
10
+ private _totalCount: number = 0;
11
+
12
+ get totalCount() {
13
+ return this._totalCount;
14
+ }
15
+
16
+ constructor(uniqueId: string, totalCount: number) {
17
+ this.uniqueId = uniqueId;
18
+ this._totalCount = totalCount;
19
+ }
20
+
21
+ async hasNext(): Promise<boolean> {
22
+ logger?.verbose('#Function HMSPeerListIterator#hasNext', this.uniqueId);
23
+ try {
24
+ return HMSManagerModule.peerListIteratorHasNext({
25
+ id: HMSConstants.DEFAULT_SDK_ID,
26
+ uniqueId: this.uniqueId,
27
+ });
28
+ } catch (e) {
29
+ logger?.error('#Error in #Function HMSPeerListIterator#hasNext ', e);
30
+ return Promise.reject(e);
31
+ }
32
+ }
33
+
34
+ async next(): Promise<HMSPeer[]> {
35
+ logger?.verbose('#Function HMSPeerListIterator#next', this.uniqueId);
36
+ try {
37
+ const { totalCount, peers } = await HMSManagerModule.peerListIteratorNext({
38
+ id: HMSConstants.DEFAULT_SDK_ID,
39
+ uniqueId: this.uniqueId,
40
+ });
41
+
42
+ this._totalCount = totalCount;
43
+
44
+ if (Array.isArray(peers) && peers.length > 0) {
45
+ const hmsPeersCache = getHmsPeersCache();
46
+
47
+ if (hmsPeersCache) {
48
+ peers.forEach(peer => {
49
+ hmsPeersCache.updatePeerCache(peer.peerID, peer);
50
+ });
51
+ }
52
+ }
53
+
54
+ return HMSEncoder.encodeHmsPeers(peers);
55
+ } catch (e) {
56
+ logger?.error('#Error in #Function HMSPeerListIterator#next ', e);
57
+ return Promise.reject(e);
58
+ }
59
+ }
60
+ }
@@ -0,0 +1,26 @@
1
+ /**
2
+ * options for creating `HMSPeerListIterator` instance
3
+ *
4
+ * ```
5
+ * const peerListIterator = hmsInstance.getPeerListIterator({
6
+ * limit: 10,
7
+ * byRoleName: 'viewer-realtime',
8
+ * });
9
+ * ```
10
+ */
11
+ export interface HMSPeerListIteratorOptions {
12
+ /**
13
+ * filter by role of the peers
14
+ */
15
+ byRoleName?: string;
16
+
17
+ /**
18
+ * `peerID`s of the peers you want to fetch with iterator.
19
+ */
20
+ byPeerIds?: string[];
21
+
22
+ /**
23
+ * number of peers fetched by the iterator in `next` method call. Default value is `10`
24
+ */
25
+ limit?: number;
26
+ }
@@ -5,6 +5,7 @@ export enum HMSPeerUpdate {
5
5
  ROLE_CHANGED = 'ROLE_CHANGED',
6
6
  NAME_CHANGED = 'NAME_CHANGED',
7
7
  NETWORK_QUALITY_UPDATED = 'NETWORK_QUALITY_UPDATED',
8
+ HAND_RAISED_CHANGED = 'HAND_RAISED_CHANGED',
8
9
  }
9
10
 
10
11
  export const HMSPeerUpdateOrdinals = new Map([
@@ -14,4 +15,5 @@ export const HMSPeerUpdateOrdinals = new Map([
14
15
  ['5', HMSPeerUpdate.NAME_CHANGED],
15
16
  ['6', HMSPeerUpdate.METADATA_CHANGED],
16
17
  ['7', HMSPeerUpdate.NETWORK_QUALITY_UPDATED],
18
+ ['8', HMSPeerUpdate.HAND_RAISED_CHANGED],
17
19
  ]);
@@ -39,6 +39,7 @@ export type HMSPeerCacheProps = {
39
39
  audioTrack?: HMSAudioTrack | undefined;
40
40
  videoTrack?: HMSVideoTrack | undefined;
41
41
  auxiliaryTracks?: HMSTrack[] | undefined;
42
+ isHandRaised?: boolean | undefined;
42
43
  };
43
44
 
44
45
  export class HMSPeersCache {
@@ -206,6 +207,10 @@ export class HMSPeersCache {
206
207
  updatedObj.name = data.name;
207
208
  break;
208
209
  }
210
+ case HMSPeerUpdate.HAND_RAISED_CHANGED: {
211
+ updatedObj.isHandRaised = data.isHandRaised;
212
+ break;
213
+ }
209
214
  default: {
210
215
  updatedObj = { ...updatedObj, ...data };
211
216
  break;
@@ -256,6 +261,8 @@ export function getPeerPropertyFromNative<T extends keyof HMSPeerCacheProps>(
256
261
  : undefined;
257
262
  } else if (property === 'name') {
258
263
  value = data?.[property];
264
+ } else if (property === 'isHandRaised') {
265
+ value = data ? data[property] : false;
259
266
  } else {
260
267
  value = data ? data[property] : undefined;
261
268
  }