@100mslive/react-native-hms 1.7.0 → 1.7.2

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/README.md +30 -39
  2. package/android/.gradle/6.7.1/executionHistory/executionHistory.bin +0 -0
  3. package/android/.gradle/6.7.1/executionHistory/executionHistory.lock +0 -0
  4. package/android/.gradle/6.7.1/fileChanges/last-build.bin +0 -0
  5. package/android/.gradle/6.7.1/fileHashes/fileHashes.bin +0 -0
  6. package/android/.gradle/6.7.1/fileHashes/fileHashes.lock +0 -0
  7. package/android/.gradle/6.7.1/gc.properties +0 -0
  8. package/android/.gradle/6.9/executionHistory/executionHistory.bin +0 -0
  9. package/android/.gradle/6.9/executionHistory/executionHistory.lock +0 -0
  10. package/android/.gradle/6.9/fileChanges/last-build.bin +0 -0
  11. package/android/.gradle/6.9/fileHashes/fileHashes.bin +0 -0
  12. package/android/.gradle/6.9/fileHashes/fileHashes.lock +0 -0
  13. package/android/.gradle/6.9/gc.properties +0 -0
  14. package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
  15. package/android/.gradle/buildOutputCleanup/cache.properties +2 -0
  16. package/android/.gradle/buildOutputCleanup/outputFiles.bin +0 -0
  17. package/android/.gradle/checksums/checksums.lock +0 -0
  18. package/android/.gradle/checksums/md5-checksums.bin +0 -0
  19. package/android/.gradle/checksums/sha1-checksums.bin +0 -0
  20. package/android/.gradle/configuration-cache/gc.properties +0 -0
  21. package/android/.gradle/vcs-1/gc.properties +0 -0
  22. package/android/build.gradle +16 -9
  23. package/android/gradle/wrapper/gradle-wrapper.jar +0 -0
  24. package/android/gradle/wrapper/gradle-wrapper.properties +1 -1
  25. package/android/gradlew +103 -104
  26. package/android/gradlew.bat +3 -18
  27. package/android/local.properties +0 -7
  28. package/android/src/main/java/com/reactnativehmssdk/HMSDecoder.kt +37 -9
  29. package/android/src/main/java/com/reactnativehmssdk/HMSHelper.kt +2 -1
  30. package/android/src/main/java/com/reactnativehmssdk/HMSManager.kt +7 -0
  31. package/android/src/main/java/com/reactnativehmssdk/HMSRNSDK.kt +39 -10
  32. package/ios/HMSDecoder.swift +9 -10
  33. package/ios/HMSHelper.swift +6 -2
  34. package/ios/HMSManager.m +4 -0
  35. package/ios/HMSManager.swift +8 -0
  36. package/ios/HMSRNSDK.swift +54 -24
  37. package/lib/commonjs/classes/HMSAudioTrack.js.map +1 -1
  38. package/lib/commonjs/classes/HMSBrowserRecordingState.js +2 -0
  39. package/lib/commonjs/classes/HMSBrowserRecordingState.js.map +1 -1
  40. package/lib/commonjs/classes/HMSCameraControl.js +3 -5
  41. package/lib/commonjs/classes/HMSCameraControl.js.map +1 -1
  42. package/lib/commonjs/classes/HMSEncoder.js +42 -40
  43. package/lib/commonjs/classes/HMSEncoder.js.map +1 -1
  44. package/lib/commonjs/classes/HMSEventEmitter.js +10 -0
  45. package/lib/commonjs/classes/HMSEventEmitter.js.map +1 -0
  46. package/lib/commonjs/classes/HMSHelper.js +1 -1
  47. package/lib/commonjs/classes/HMSHelper.js.map +1 -1
  48. package/lib/commonjs/classes/HMSLocalAudioTrack.js +2 -2
  49. package/lib/commonjs/classes/HMSLocalAudioTrack.js.map +1 -1
  50. package/lib/commonjs/classes/HMSLocalPeer.js.map +1 -1
  51. package/lib/commonjs/classes/HMSLocalVideoTrack.js +2 -2
  52. package/lib/commonjs/classes/HMSLocalVideoTrack.js.map +1 -1
  53. package/lib/commonjs/classes/HMSLogger.js +4 -4
  54. package/lib/commonjs/classes/HMSLogger.js.map +1 -1
  55. package/lib/commonjs/classes/HMSManagerModule.js +18 -0
  56. package/lib/commonjs/classes/HMSManagerModule.js.map +1 -0
  57. package/lib/commonjs/classes/HMSMessage.js.map +1 -1
  58. package/lib/commonjs/classes/HMSNativeEventEmitter.js +6 -6
  59. package/lib/commonjs/classes/HMSNativeEventEmitter.js.map +1 -1
  60. package/lib/commonjs/classes/HMSNativeEventListener.js +13 -0
  61. package/lib/commonjs/classes/HMSNativeEventListener.js.map +1 -0
  62. package/lib/commonjs/classes/HMSPeer.js +2 -15
  63. package/lib/commonjs/classes/HMSPeer.js.map +1 -1
  64. package/lib/commonjs/classes/HMSPeersCache.js +3 -5
  65. package/lib/commonjs/classes/HMSPeersCache.js.map +1 -1
  66. package/lib/commonjs/classes/HMSRemoteAudioTrack.js +2 -2
  67. package/lib/commonjs/classes/HMSRemoteAudioTrack.js.map +1 -1
  68. package/lib/commonjs/classes/HMSRemotePeer.js.map +1 -1
  69. package/lib/commonjs/classes/HMSRemoteVideoTrack.js +5 -5
  70. package/lib/commonjs/classes/HMSRemoteVideoTrack.js.map +1 -1
  71. package/lib/commonjs/classes/HMSRoom.js.map +1 -1
  72. package/lib/commonjs/classes/HMSRoomCache.js +10 -5
  73. package/lib/commonjs/classes/HMSRoomCache.js.map +1 -1
  74. package/lib/commonjs/classes/HMSSDK.js +165 -170
  75. package/lib/commonjs/classes/HMSSDK.js.map +1 -1
  76. package/lib/commonjs/classes/HMSSessionStore.js +9 -10
  77. package/lib/commonjs/classes/HMSSessionStore.js.map +1 -1
  78. package/lib/commonjs/classes/HMSTrack.js.map +1 -1
  79. package/lib/commonjs/classes/HMSVideoTrack.js.map +1 -1
  80. package/lib/commonjs/classes/HmsView.js +1 -1
  81. package/lib/commonjs/classes/HmsView.js.map +1 -1
  82. package/lib/commonjs/components/HMSHLSPlayer/HMSHLSPlayer.js +8 -8
  83. package/lib/commonjs/components/HMSHLSPlayer/HMSHLSPlayer.js.map +1 -1
  84. package/lib/commonjs/components/HMSHLSPlayer/RCTHMSHLSPlayer.js.map +1 -1
  85. package/lib/commonjs/components/HMSHLSPlayer/hooks.js.map +1 -1
  86. package/lib/commonjs/hooks/useHMSPeerUpdates.js +77 -0
  87. package/lib/commonjs/hooks/useHMSPeerUpdates.js.map +1 -0
  88. package/lib/commonjs/index.js +25 -13
  89. package/lib/commonjs/index.js.map +1 -1
  90. package/lib/module/classes/HMSAudioTrack.js.map +1 -1
  91. package/lib/module/classes/HMSBrowserRecordingState.js +2 -0
  92. package/lib/module/classes/HMSBrowserRecordingState.js.map +1 -1
  93. package/lib/module/classes/HMSCameraControl.js +1 -4
  94. package/lib/module/classes/HMSCameraControl.js.map +1 -1
  95. package/lib/module/classes/HMSEncoder.js +40 -39
  96. package/lib/module/classes/HMSEncoder.js.map +1 -1
  97. package/lib/module/classes/HMSEventEmitter.js +3 -0
  98. package/lib/module/classes/HMSEventEmitter.js.map +1 -0
  99. package/lib/module/classes/HMSHelper.js +1 -1
  100. package/lib/module/classes/HMSHelper.js.map +1 -1
  101. package/lib/module/classes/HMSLocalAudioTrack.js +2 -2
  102. package/lib/module/classes/HMSLocalAudioTrack.js.map +1 -1
  103. package/lib/module/classes/HMSLocalPeer.js.map +1 -1
  104. package/lib/module/classes/HMSLocalVideoTrack.js +2 -2
  105. package/lib/module/classes/HMSLocalVideoTrack.js.map +1 -1
  106. package/lib/module/classes/HMSLogger.js +4 -4
  107. package/lib/module/classes/HMSLogger.js.map +1 -1
  108. package/lib/module/classes/HMSManagerModule.js +11 -0
  109. package/lib/module/classes/HMSManagerModule.js.map +1 -0
  110. package/lib/module/classes/HMSMessage.js.map +1 -1
  111. package/lib/module/classes/HMSNativeEventEmitter.js +6 -6
  112. package/lib/module/classes/HMSNativeEventEmitter.js.map +1 -1
  113. package/lib/module/classes/HMSNativeEventListener.js +5 -0
  114. package/lib/module/classes/HMSNativeEventListener.js.map +1 -0
  115. package/lib/module/classes/HMSPeer.js +2 -15
  116. package/lib/module/classes/HMSPeer.js.map +1 -1
  117. package/lib/module/classes/HMSPeersCache.js +1 -4
  118. package/lib/module/classes/HMSPeersCache.js.map +1 -1
  119. package/lib/module/classes/HMSRemoteAudioTrack.js +2 -2
  120. package/lib/module/classes/HMSRemoteAudioTrack.js.map +1 -1
  121. package/lib/module/classes/HMSRemotePeer.js.map +1 -1
  122. package/lib/module/classes/HMSRemoteVideoTrack.js +5 -5
  123. package/lib/module/classes/HMSRemoteVideoTrack.js.map +1 -1
  124. package/lib/module/classes/HMSRoom.js.map +1 -1
  125. package/lib/module/classes/HMSRoomCache.js +8 -4
  126. package/lib/module/classes/HMSRoomCache.js.map +1 -1
  127. package/lib/module/classes/HMSSDK.js +113 -118
  128. package/lib/module/classes/HMSSDK.js.map +1 -1
  129. package/lib/module/classes/HMSSessionStore.js +5 -7
  130. package/lib/module/classes/HMSSessionStore.js.map +1 -1
  131. package/lib/module/classes/HMSTrack.js.map +1 -1
  132. package/lib/module/classes/HMSVideoTrack.js.map +1 -1
  133. package/lib/module/classes/HmsView.js +1 -1
  134. package/lib/module/classes/HmsView.js.map +1 -1
  135. package/lib/module/components/HMSHLSPlayer/HMSHLSPlayer.js +8 -8
  136. package/lib/module/components/HMSHLSPlayer/HMSHLSPlayer.js.map +1 -1
  137. package/lib/module/components/HMSHLSPlayer/RCTHMSHLSPlayer.js.map +1 -1
  138. package/lib/module/components/HMSHLSPlayer/hooks.js.map +1 -1
  139. package/lib/module/hooks/useHMSPeerUpdates.js +67 -0
  140. package/lib/module/hooks/useHMSPeerUpdates.js.map +1 -0
  141. package/lib/module/index.js +6 -1
  142. package/lib/module/index.js.map +1 -1
  143. package/lib/typescript/classes/HMSAudioTrack.d.ts +2 -1
  144. package/lib/typescript/classes/HMSBrowserRecordingState.d.ts +2 -0
  145. package/lib/typescript/classes/HMSEventEmitter.d.ts +2 -0
  146. package/lib/typescript/classes/HMSLocalAudioTrack.d.ts +2 -1
  147. package/lib/typescript/classes/HMSLocalPeer.d.ts +4 -2
  148. package/lib/typescript/classes/HMSLocalVideoTrack.d.ts +2 -1
  149. package/lib/typescript/classes/HMSManagerModule.d.ts +3 -0
  150. package/lib/typescript/classes/HMSMessage.d.ts +2 -3
  151. package/lib/typescript/classes/HMSNativeEventListener.d.ts +4 -0
  152. package/lib/typescript/classes/HMSPeer.d.ts +2 -3
  153. package/lib/typescript/classes/HMSRemoteAudioTrack.d.ts +2 -1
  154. package/lib/typescript/classes/HMSRemotePeer.d.ts +4 -2
  155. package/lib/typescript/classes/HMSRemoteVideoTrack.d.ts +2 -1
  156. package/lib/typescript/classes/HMSRoom.d.ts +1 -1
  157. package/lib/typescript/classes/HMSSDK.d.ts +8 -7
  158. package/lib/typescript/classes/HMSTrack.d.ts +3 -2
  159. package/lib/typescript/classes/HMSVideoTrack.d.ts +2 -1
  160. package/lib/typescript/classes/HmsView.d.ts +1 -1
  161. package/lib/typescript/components/HMSHLSPlayer/RCTHMSHLSPlayer.d.ts +1 -1
  162. package/lib/typescript/components/HMSHLSPlayer/hooks.d.ts +1 -1
  163. package/lib/typescript/hooks/useHMSPeerUpdates.d.ts +7 -0
  164. package/lib/typescript/index.d.ts +2 -1
  165. package/package.json +2 -2
  166. package/sdk-versions.json +2 -2
  167. package/src/classes/HMSAudioTrack.ts +2 -1
  168. package/src/classes/HMSBrowserRecordingState.ts +3 -0
  169. package/src/classes/HMSCameraControl.ts +1 -2
  170. package/src/classes/HMSEncoder.ts +7 -5
  171. package/src/classes/HMSEventEmitter.ts +3 -0
  172. package/src/classes/HMSLocalAudioTrack.ts +2 -1
  173. package/src/classes/HMSLocalPeer.ts +4 -2
  174. package/src/classes/HMSLocalVideoTrack.ts +2 -1
  175. package/src/classes/HMSManagerModule.ts +18 -0
  176. package/src/classes/HMSMessage.ts +2 -3
  177. package/src/classes/HMSNativeEventEmitter.ts +2 -1
  178. package/src/classes/HMSNativeEventListener.ts +8 -0
  179. package/src/classes/HMSPeer.ts +3 -26
  180. package/src/classes/HMSPeersCache.ts +2 -3
  181. package/src/classes/HMSRemoteAudioTrack.ts +2 -1
  182. package/src/classes/HMSRemotePeer.ts +4 -2
  183. package/src/classes/HMSRemoteVideoTrack.ts +2 -1
  184. package/src/classes/HMSRoom.ts +1 -1
  185. package/src/classes/HMSRoomCache.ts +11 -3
  186. package/src/classes/HMSSDK.tsx +47 -52
  187. package/src/classes/HMSSessionStore.ts +6 -8
  188. package/src/classes/HMSTrack.ts +3 -2
  189. package/src/classes/HMSVideoTrack.ts +2 -1
  190. package/src/classes/HmsView.tsx +4 -2
  191. package/src/components/HMSHLSPlayer/HMSHLSPlayer.tsx +36 -10
  192. package/src/components/HMSHLSPlayer/RCTHMSHLSPlayer.ts +2 -3
  193. package/src/components/HMSHLSPlayer/hooks.ts +3 -2
  194. package/src/hooks/useHMSPeerUpdates.ts +85 -0
  195. package/src/index.ts +6 -1
  196. package/ios/Hmssdk.xcodeproj/project.xcworkspace/contents.xcworkspacedata +0 -7
  197. package/ios/Hmssdk.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +0 -8
  198. package/ios/Hmssdk.xcodeproj/project.xcworkspace/xcuserdata/yogesh.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
  199. package/ios/Hmssdk.xcodeproj/xcuserdata/yogesh.xcuserdatad/xcschemes/xcschememanagement.plist +0 -14
  200. package/lib/commonjs/classes/HMSMessageType.js +0 -13
  201. package/lib/commonjs/classes/HMSMessageType.js.map +0 -1
  202. package/lib/module/classes/HMSMessageType.js +0 -6
  203. package/lib/module/classes/HMSMessageType.js.map +0 -1
  204. package/lib/typescript/classes/HMSMessageType.d.ts +0 -4
  205. package/src/classes/HMSMessageType.ts +0 -4
@@ -0,0 +1,4 @@
1
+ import { HMSNativeEventEmitter } from './HMSNativeEventEmitter';
2
+ export type { HMSEventSubscription as HMSNativeEventSubscription } from './HMSNativeEventEmitter';
3
+ declare const HMSNativeEventListener: HMSNativeEventEmitter;
4
+ export default HMSNativeEventListener;
@@ -5,20 +5,19 @@ import type { HMSTrack } from './HMSTrack';
5
5
  import type { HMSVideoTrack } from './HMSVideoTrack';
6
6
  export declare class HMSPeer {
7
7
  peerID: string;
8
- private _name;
8
+ name: string;
9
9
  private _isLocal;
10
10
  private _customerUserID;
11
11
  private _metadata;
12
12
  private _role;
13
- private _updateName;
14
13
  private _updateIsLocal;
15
14
  private _updateCustomerUserID;
16
15
  private _updateMetadata;
17
16
  private _updateRole;
18
17
  constructor(params: {
19
18
  peerID: string;
19
+ name: string;
20
20
  });
21
- get name(): string;
22
21
  get isLocal(): boolean | undefined;
23
22
  get networkQuality(): HMSNetworkQuality | undefined;
24
23
  get customerUserID(): string | undefined;
@@ -1,5 +1,6 @@
1
1
  import type { HMSTrackType } from './HMSTrackType';
2
2
  import { HMSAudioTrack } from './HMSAudioTrack';
3
+ import type { HMSTrackSource } from './HMSTrackSource';
3
4
  export declare class HMSRemoteAudioTrack extends HMSAudioTrack {
4
5
  /**
5
6
  * Switches Audio of remote user on/off depending upon the value of playbackAllowed
@@ -11,7 +12,7 @@ export declare class HMSRemoteAudioTrack extends HMSAudioTrack {
11
12
  isPlaybackAllowed: () => Promise<any>;
12
13
  constructor(params: {
13
14
  trackId: string;
14
- source?: number | string;
15
+ source?: HMSTrackSource;
15
16
  isMute?: boolean;
16
17
  trackDescription?: string;
17
18
  playbackAllowed?: boolean;
@@ -1,6 +1,7 @@
1
1
  import { HMSPeer } from './HMSPeer';
2
2
  import { HMSRemoteAudioTrack } from './HMSRemoteAudioTrack';
3
3
  import { HMSRemoteVideoTrack } from './HMSRemoteVideoTrack';
4
+ import type { HMSTrackSource } from './HMSTrackSource';
4
5
  export declare class HMSRemotePeer extends HMSPeer {
5
6
  private remoteAudio?;
6
7
  private remoteVideo?;
@@ -8,9 +9,10 @@ export declare class HMSRemotePeer extends HMSPeer {
8
9
  remoteVideoTrack: () => HMSRemoteVideoTrack | undefined;
9
10
  constructor(params: {
10
11
  peerID: string;
12
+ name: string;
11
13
  remoteAudioTrackData?: {
12
14
  trackId: string;
13
- source?: number | string;
15
+ source?: HMSTrackSource;
14
16
  isMute?: boolean;
15
17
  trackDescription?: string;
16
18
  playbackAllowed?: boolean;
@@ -18,7 +20,7 @@ export declare class HMSRemotePeer extends HMSPeer {
18
20
  };
19
21
  remoteVideoTrackData?: {
20
22
  trackId: string;
21
- source?: number | string;
23
+ source?: HMSTrackSource;
22
24
  trackDescription?: string;
23
25
  isMute?: boolean;
24
26
  playbackAllowed?: boolean;
@@ -2,6 +2,7 @@ import { HMSVideoTrack } from './HMSVideoTrack';
2
2
  import type { HMSTrackType } from './HMSTrackType';
3
3
  import type { HMSLayer } from './HMSLayer';
4
4
  import type { HMSSimulcastLayerDefinition } from './HMSSimulcastLayerDefinition';
5
+ import type { HMSTrackSource } from './HMSTrackSource';
5
6
  export declare class HMSRemoteVideoTrack extends HMSVideoTrack {
6
7
  /**
7
8
  * Switches Video of remote user on/off depending upon the value of playbackAllowed
@@ -16,7 +17,7 @@ export declare class HMSRemoteVideoTrack extends HMSVideoTrack {
16
17
  setLayer(layer: HMSLayer): Promise<any>;
17
18
  constructor(params: {
18
19
  trackId: string;
19
- source?: number | string;
20
+ source?: HMSTrackSource;
20
21
  trackDescription?: string;
21
22
  isMute?: boolean;
22
23
  playbackAllowed?: boolean;
@@ -19,6 +19,6 @@ export declare class HMSRoom {
19
19
  get serverRecordingState(): HMSServerRecordingState;
20
20
  get hlsStreamingState(): HMSHLSStreamingState;
21
21
  get hlsRecordingState(): HMSHLSRecordingState | undefined;
22
- get peerCount(): number;
22
+ get peerCount(): number | null;
23
23
  get localPeer(): HMSLocalPeer;
24
24
  }
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import { HMSTrackType } from './HMSTrackType';
3
3
  import { HMSUpdateListenerActions } from './HMSUpdateListenerActions';
4
- import { HmsComponentProps } from './HmsView';
4
+ import type { HmsComponentProps } from './HmsView';
5
5
  import type { HMSConfig } from './HMSConfig';
6
6
  import type { HMSLocalPeer } from './HMSLocalPeer';
7
7
  import type { HMSRemotePeer } from './HMSRemotePeer';
@@ -17,7 +17,6 @@ import type { HMSAudioDevice } from './HMSAudioDevice';
17
17
  import type { HMSAudioMode } from './HMSAudioMode';
18
18
  import type { HMSAudioMixingMode } from './HMSAudioMixingMode';
19
19
  import type { HMSLogSettings } from './HMSLogSettings';
20
- import { HMSMessageType } from './HMSMessageType';
21
20
  import { HMSPIPListenerActions } from './HMSPIPListenerActions';
22
21
  type HmsViewProps = Omit<HmsComponentProps, 'id'>;
23
22
  interface PIPConfig {
@@ -75,6 +74,7 @@ export declare class HMSSDK {
75
74
  appGroup?: String;
76
75
  preferredExtension?: String;
77
76
  logSettings?: HMSLogSettings;
77
+ isPrebuilt?: boolean;
78
78
  }): Promise<HMSSDK>;
79
79
  /**
80
80
  * - Calls removeListeners that in turn breaks all connections with native listeners.
@@ -149,10 +149,11 @@ export declare class HMSSDK {
149
149
  *
150
150
  * checkout {@link https://www.100ms.live/docs/react-native/v2/features/chat} for more info
151
151
  *
152
- * @param {message: string} and @param {type: string}
153
152
  * @memberof HMSSDK
153
+ * @param message the message that is to be sent
154
+ * @param type the default type is set to CHAT. You can pass a custom type here for sending events like Emoji Reactions, Notifications, etc
154
155
  */
155
- sendBroadcastMessage: (message: string, type?: HMSMessageType) => Promise<{
156
+ sendBroadcastMessage: (message: string, type?: string) => Promise<{
156
157
  messageId: string | undefined;
157
158
  }>;
158
159
  /**
@@ -163,7 +164,7 @@ export declare class HMSSDK {
163
164
  *
164
165
  * @memberof HMSSDK
165
166
  */
166
- sendGroupMessage: (message: string, roles: HMSRole[], type?: HMSMessageType) => Promise<{
167
+ sendGroupMessage: (message: string, roles: HMSRole[], type?: string) => Promise<{
167
168
  messageId: string | undefined;
168
169
  }>;
169
170
  /**
@@ -174,7 +175,7 @@ export declare class HMSSDK {
174
175
  *
175
176
  * @memberof HMSSDK
176
177
  */
177
- sendDirectMessage: (message: string, peer: HMSPeer, type?: HMSMessageType) => Promise<{
178
+ sendDirectMessage: (message: string, peer: HMSPeer, type?: string) => Promise<{
178
179
  messageId: string | undefined;
179
180
  }>;
180
181
  /**
@@ -487,8 +488,8 @@ export declare class HMSSDK {
487
488
  *
488
489
  * checkout {@link https://www.100ms.live/docs/react-native/v2/features/audio-output-routing#switch-audio-focus-to-another-device} for more info
489
490
  *
490
- * @param {HMSAudioDevice}
491
491
  * @memberof HMSSDK
492
+ * @param audioDevice
492
493
  */
493
494
  switchAudioOutput: (audioDevice: HMSAudioDevice) => any;
494
495
  switchAudioOutputUsingIOSUI: () => any;
@@ -1,7 +1,8 @@
1
+ import type { HMSTrackSource } from './HMSTrackSource';
1
2
  import type { HMSTrackType } from './HMSTrackType';
2
3
  export declare class HMSTrack {
3
4
  trackId: string;
4
- source?: number | string;
5
+ source?: HMSTrackSource;
5
6
  trackDescription?: string;
6
7
  mute?: boolean;
7
8
  id: string;
@@ -9,7 +10,7 @@ export declare class HMSTrack {
9
10
  isMute: () => boolean | undefined;
10
11
  constructor(params: {
11
12
  trackId: string;
12
- source?: number | string;
13
+ source?: HMSTrackSource;
13
14
  trackDescription?: string;
14
15
  isMute?: boolean;
15
16
  id: string;
@@ -1,10 +1,11 @@
1
1
  import { HMSTrack } from './HMSTrack';
2
+ import type { HMSTrackSource } from './HMSTrackSource';
2
3
  import type { HMSTrackType } from './HMSTrackType';
3
4
  export declare class HMSVideoTrack extends HMSTrack {
4
5
  isDegraded?: boolean;
5
6
  constructor(params: {
6
7
  trackId: string;
7
- source?: number | string;
8
+ source?: HMSTrackSource;
8
9
  trackDescription?: string;
9
10
  isMute?: boolean;
10
11
  id: string;
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { ViewStyle } from 'react-native';
2
+ import type { ViewStyle } from 'react-native';
3
3
  import { HMSVideoViewMode } from './HMSVideoViewMode';
4
4
  export interface HmsComponentProps {
5
5
  trackId: string;
@@ -1,4 +1,4 @@
1
- import { StyleProp, NativeSyntheticEvent, ViewStyle, NativeMethods } from 'react-native';
1
+ import type { StyleProp, NativeSyntheticEvent, ViewStyle, NativeMethods } from 'react-native';
2
2
  import type { HMSHLSPlayerPlaybackEvent, HMSHLSPlayerStatsEvent } from '../../types';
3
3
  export type HmsHlsPlaybackEventHandler = (event: NativeSyntheticEvent<HMSHLSPlayerPlaybackEvent>) => void;
4
4
  export type HmsHlsStatsEventHandler = (event: NativeSyntheticEvent<HMSHLSPlayerStatsEvent>) => void;
@@ -1,4 +1,4 @@
1
- import { DependencyList } from 'react';
1
+ 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;
@@ -0,0 +1,7 @@
1
+ import * as React from 'react';
2
+ import type { HMSPeer } from '../classes/HMSPeer';
3
+ import { HMSPeerUpdate } from '../classes/HMSPeerUpdate';
4
+ export declare const useHMSPeerUpdates: (effect: (data: {
5
+ peer: HMSPeer;
6
+ type: HMSPeerUpdate;
7
+ }) => void, deps?: React.DependencyList | undefined) => void;
@@ -73,7 +73,6 @@ export * from './classes/HMSAudioMixerSource';
73
73
  export * from './classes/HMSTrackSettingsInitState';
74
74
  export * from './classes/HMSLogSettings';
75
75
  export * from './classes/HMSLogAlarmManager';
76
- export * from './classes/HMSMessageType';
77
76
  export * from './classes/HMSPIPListenerActions';
78
77
  export * from './classes/HMSLayer';
79
78
  export * from './classes/HMSSimulcastLayerDefinition';
@@ -84,7 +83,9 @@ export * from './classes/HMSIOSAudioMode';
84
83
  export type { HMSSessionStore, HMSSessionStoreValue, } from './classes/HMSSessionStore';
85
84
  export type { HmsViewComponent as HMSView } from './classes/HmsView';
86
85
  import { HMSSDK as HmsManager } from './classes/HMSSDK';
86
+ export { default as HMSManagerModule } from './classes/HMSManagerModule';
87
87
  export * from './components/HMSHLSPlayer';
88
+ export * from './hooks/useHMSPeerUpdates';
88
89
  export * from './types';
89
90
  export * from './stores/types';
90
91
  export default HmsManager;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@100mslive/react-native-hms",
3
- "version": "1.7.0",
3
+ "version": "1.7.2",
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",
@@ -26,7 +26,7 @@
26
26
  "test": "jest",
27
27
  "typescript": "tsc --noEmit",
28
28
  "lint": "eslint \"**/*.{js,ts,tsx}\"",
29
- "prepare": "bob build",
29
+ "prepack": "bob build",
30
30
  "release": "release-it",
31
31
  "example": "yarn --cwd example",
32
32
  "pods": "cd example && pod-install --quiet",
package/sdk-versions.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
- "ios": "0.9.5",
2
+ "ios": "0.9.10",
3
3
  "iOSBroadcastExtension": "0.0.9",
4
4
  "iOSHMSHLSPlayer": "0.0.2",
5
- "android": "2.6.7"
5
+ "android": "2.7.3"
6
6
  }
@@ -1,10 +1,11 @@
1
1
  import { HMSTrack } from './HMSTrack';
2
+ import type { HMSTrackSource } from './HMSTrackSource';
2
3
  import type { HMSTrackType } from './HMSTrackType';
3
4
 
4
5
  export class HMSAudioTrack extends HMSTrack {
5
6
  constructor(params?: {
6
7
  trackId: string;
7
- source?: number | string;
8
+ source?: HMSTrackSource;
8
9
  trackDescription?: string;
9
10
  isMute?: boolean;
10
11
  id: string;
@@ -1,17 +1,20 @@
1
1
  import type { HMSException } from './HMSException';
2
2
 
3
3
  export class HMSBrowserRecordingState {
4
+ initialising: boolean;
4
5
  running: boolean;
5
6
  error?: HMSException;
6
7
  startedAt?: Date;
7
8
  stoppedAt?: Date;
8
9
 
9
10
  constructor(params: {
11
+ initialising: boolean;
10
12
  running: boolean;
11
13
  error?: HMSException;
12
14
  startedAt?: Date;
13
15
  stoppedAt?: Date;
14
16
  }) {
17
+ this.initialising = params.initialising;
15
18
  this.running = params.running;
16
19
  this.error = params.error;
17
20
  this.startedAt = params.startedAt;
@@ -1,7 +1,6 @@
1
- import { NativeModules } from 'react-native';
2
1
  import { HMSConstants } from './HMSConstants';
3
2
 
4
- const { HMSManager } = NativeModules;
3
+ import HMSManager from './HMSManagerModule';
5
4
 
6
5
  export class HMSCameraControl {
7
6
  /**
@@ -1,4 +1,4 @@
1
- import { NativeModules } from 'react-native';
1
+ import HMSManager from './HMSManagerModule';
2
2
 
3
3
  import { HMSTrack } from './HMSTrack';
4
4
  import { HMSAudioTrack } from './HMSAudioTrack';
@@ -40,8 +40,6 @@ import { HMSLayer } from './HMSLayer';
40
40
  import { HMSSimulcastLayerDefinition } from './HMSSimulcastLayerDefinition';
41
41
  import { HMSQualityLimitationReasons } from './HMSQualityLimitationReasons';
42
42
 
43
- const { HMSManager } = NativeModules;
44
-
45
43
  interface InitialData {
46
44
  roles: Record<string, HMSRole>;
47
45
  }
@@ -95,6 +93,7 @@ export class HMSEncoder {
95
93
  static encodeHmsPeer(peer: any) {
96
94
  const encodedObj = {
97
95
  peerID: peer?.peerID,
96
+ name: peer?.name,
98
97
  };
99
98
 
100
99
  return new HMSPeer(encodedObj);
@@ -155,6 +154,7 @@ export class HMSEncoder {
155
154
  static encodeHmsLocalPeer(peer: any, id: string) {
156
155
  const encodedObj = {
157
156
  peerID: peer?.peerID,
157
+ name: peer?.name,
158
158
  localAudioTrackData: peer?.localAudioTrackData?.trackId
159
159
  ? {
160
160
  id: id,
@@ -268,6 +268,7 @@ export class HMSEncoder {
268
268
  static encodeHmsRemotePeer(peer: any, id: string) {
269
269
  const encodedObj = {
270
270
  peerID: peer?.peerID,
271
+ name: peer?.name,
271
272
  remoteAudioTrackData: peer?.remoteAudioTrackData?.trackId
272
273
  ? {
273
274
  id: id,
@@ -335,7 +336,7 @@ export class HMSEncoder {
335
336
  return encodedRoles;
336
337
  }
337
338
 
338
- static encodeHmsRole(role: any) {
339
+ static encodeHmsRole(role: any): HMSRole {
339
340
  if (!role) {
340
341
  return new HMSRole(role);
341
342
  }
@@ -362,7 +363,7 @@ export class HMSEncoder {
362
363
  }
363
364
  }
364
365
 
365
- return rolesCache[role.name];
366
+ return rolesCache[role.name]!;
366
367
  }
367
368
 
368
369
  static encodeHmsRoleChangeRequest(data: any) {
@@ -438,6 +439,7 @@ export class HMSEncoder {
438
439
 
439
440
  static encodeBrowserRecordingState(data: any) {
440
441
  return new HMSBrowserRecordingState({
442
+ initialising: data?.initialising || false,
441
443
  running: data?.running || false,
442
444
  startedAt: HMSEncoder.encodeDate(data?.startedAt),
443
445
  stoppedAt: HMSEncoder.encodeDate(data?.stoppedAt),
@@ -0,0 +1,3 @@
1
+ import { EventEmitter } from '../utils';
2
+
3
+ export const HMSEventEmitter = new EventEmitter();
@@ -3,6 +3,7 @@ import { HMSAudioTrack } from './HMSAudioTrack';
3
3
  import { getLogger } from './HMSLogger';
4
4
  import type { HMSAudioTrackSettings } from './HMSAudioTrackSettings';
5
5
  import type { HMSTrackType } from './HMSTrackType';
6
+ import type { HMSTrackSource } from './HMSTrackSource';
6
7
 
7
8
  const {
8
9
  /**
@@ -55,7 +56,7 @@ export class HMSLocalAudioTrack extends HMSAudioTrack {
55
56
  constructor(params: {
56
57
  id: string;
57
58
  trackId: string;
58
- source?: number | string;
59
+ source?: HMSTrackSource;
59
60
  trackDescription?: string;
60
61
  isMute?: boolean;
61
62
  settings?: HMSAudioTrackSettings;
@@ -4,6 +4,7 @@ import type { HMSAudioTrackSettings } from './HMSAudioTrackSettings';
4
4
  import { HMSLocalAudioTrack } from './HMSLocalAudioTrack';
5
5
  import { HMSLocalVideoTrack } from './HMSLocalVideoTrack';
6
6
  import type { HMSTrackType } from './HMSTrackType';
7
+ import type { HMSTrackSource } from './HMSTrackSource';
7
8
 
8
9
  export class HMSLocalPeer extends HMSPeer {
9
10
  private localAudio?: HMSLocalAudioTrack;
@@ -18,10 +19,11 @@ export class HMSLocalPeer extends HMSPeer {
18
19
 
19
20
  constructor(params: {
20
21
  peerID: string;
22
+ name: string;
21
23
  localAudioTrackData?: {
22
24
  id: string;
23
25
  trackId: string;
24
- source?: number | string;
26
+ source?: HMSTrackSource;
25
27
  trackDescription?: string;
26
28
  isMute?: boolean;
27
29
  settings?: HMSAudioTrackSettings;
@@ -30,7 +32,7 @@ export class HMSLocalPeer extends HMSPeer {
30
32
  localVideoTrackData?: {
31
33
  id: string;
32
34
  trackId: string;
33
- source?: number | string;
35
+ source?: HMSTrackSource;
34
36
  trackDescription?: string;
35
37
  isMute?: boolean;
36
38
  settings?: HMSVideoTrackSettings;
@@ -3,6 +3,7 @@ import { HMSVideoTrack } from './HMSVideoTrack';
3
3
  import { getLogger } from './HMSLogger';
4
4
  import type { HMSVideoTrackSettings } from './HMSVideoTrackSettings';
5
5
  import type { HMSTrackType } from './HMSTrackType';
6
+ import type { HMSTrackSource } from './HMSTrackSource';
6
7
 
7
8
  const {
8
9
  /**
@@ -51,7 +52,7 @@ export class HMSLocalVideoTrack extends HMSVideoTrack {
51
52
  constructor(params: {
52
53
  id: string;
53
54
  trackId: string;
54
- source?: number | string;
55
+ source?: HMSTrackSource;
55
56
  trackDescription?: string;
56
57
  isMute?: boolean;
57
58
  settings?: HMSVideoTrackSettings;
@@ -0,0 +1,18 @@
1
+ import { NativeModules } from 'react-native';
2
+
3
+ const { HMSManager } = NativeModules;
4
+
5
+ if (HMSManager == null) {
6
+ console.error(
7
+ `[@100mslive/react-native-hms] react-native-hms module was not found. Make sure you're running your app on the native platform and your code is linked properly (cd ios && pod install && cd ..).
8
+
9
+ For installation instructions, please refer to https://www.100ms.live/docs/react-native/v2/how-to-guides/install-the-sdk/integration`
10
+ .split('\n')
11
+ .map((line) => line.trim())
12
+ .join('\n')
13
+ );
14
+ }
15
+
16
+ export type HMSManagerProps = any;
17
+
18
+ export default HMSManager as HMSManagerProps;
@@ -1,11 +1,10 @@
1
1
  import type { HMSMessageRecipient } from './HMSMessageRecipient';
2
- import type { HMSMessageType } from './HMSMessageType';
3
2
  import type { HMSPeer } from './HMSPeer';
4
3
 
5
4
  export class HMSMessage {
6
5
  public message: string;
7
6
  public messageId: string;
8
- public type: HMSMessageType;
7
+ public type: string;
9
8
  public time: Date;
10
9
  public sender?: HMSPeer;
11
10
  public recipient: HMSMessageRecipient;
@@ -13,7 +12,7 @@ export class HMSMessage {
13
12
  constructor(params: {
14
13
  message: string;
15
14
  messageId: string;
16
- type: HMSMessageType;
15
+ type: string;
17
16
  time: Date;
18
17
  sender?: HMSPeer;
19
18
  recipient: HMSMessageRecipient;
@@ -1,4 +1,5 @@
1
- import { EventSubscription, NativeEventEmitter } from 'react-native';
1
+ import { NativeEventEmitter } from 'react-native';
2
+ import type { EventSubscription } from 'react-native';
2
3
  import { logger } from './HMSLogger';
3
4
 
4
5
  export type HMSEventSubscription = {
@@ -0,0 +1,8 @@
1
+ import HMSManager from './HMSManagerModule';
2
+ import { HMSNativeEventEmitter } from './HMSNativeEventEmitter';
3
+
4
+ export type { HMSEventSubscription as HMSNativeEventSubscription } from './HMSNativeEventEmitter';
5
+
6
+ const HMSNativeEventListener = new HMSNativeEventEmitter(HMSManager);
7
+
8
+ export default HMSNativeEventListener;
@@ -8,19 +8,12 @@ import { HMSConstants } from './HMSConstants';
8
8
 
9
9
  export class HMSPeer {
10
10
  peerID: string;
11
- private _name: string = '';
11
+ name: string;
12
12
  private _isLocal: boolean | undefined;
13
13
  private _customerUserID: string | undefined;
14
14
  private _metadata: string | undefined;
15
15
  private _role: HMSRole | undefined;
16
16
 
17
- private _updateName(value: string) {
18
- // If `_name` is outdated, update it
19
- if (this._name !== value) {
20
- this._name = value;
21
- }
22
- }
23
-
24
17
  private _updateIsLocal(value: boolean) {
25
18
  // If `_isLocal` is outdated, update it
26
19
  if (this._isLocal !== value) {
@@ -49,25 +42,9 @@ export class HMSPeer {
49
42
  }
50
43
  }
51
44
 
52
- constructor(params: { peerID: string }) {
45
+ constructor(params: { peerID: string; name: string }) {
53
46
  this.peerID = params.peerID;
54
- }
55
-
56
- get name(): string {
57
- const hmsPeersCache = getHmsPeersCache();
58
-
59
- const nameValue = hmsPeersCache
60
- ? hmsPeersCache.getProperty(this.peerID, 'name')
61
- : getPeerPropertyFromNative(
62
- HMSConstants.DEFAULT_SDK_ID,
63
- this.peerID,
64
- 'name'
65
- );
66
-
67
- if (nameValue) {
68
- this._updateName(nameValue);
69
- }
70
- return nameValue ?? this._name;
47
+ this.name = params.name;
71
48
  }
72
49
 
73
50
  get isLocal(): boolean | undefined {
@@ -1,4 +1,5 @@
1
- import { NativeModules } from 'react-native';
1
+ import HMSManager from './HMSManagerModule';
2
+
2
3
  import { HMSEncoder } from './HMSEncoder';
3
4
  import { HMSPeerUpdate } from './HMSPeerUpdate';
4
5
  import { HMSTrackUpdate } from './HMSTrackUpdate';
@@ -10,8 +11,6 @@ import type { HMSRole } from './HMSRole';
10
11
  import type { HMSAudioTrack } from './HMSAudioTrack';
11
12
  import type { HMSVideoTrack } from './HMSVideoTrack';
12
13
 
13
- const { HMSManager } = NativeModules;
14
-
15
14
  export let hmsPeersCache: HMSPeersCache | undefined;
16
15
 
17
16
  export const getHmsPeersCache = () => {
@@ -2,6 +2,7 @@ import { NativeModules } from 'react-native';
2
2
  import { getLogger } from './HMSLogger';
3
3
  import type { HMSTrackType } from './HMSTrackType';
4
4
  import { HMSAudioTrack } from './HMSAudioTrack';
5
+ import type { HMSTrackSource } from './HMSTrackSource';
5
6
 
6
7
  const {
7
8
  /**
@@ -54,7 +55,7 @@ export class HMSRemoteAudioTrack extends HMSAudioTrack {
54
55
 
55
56
  constructor(params: {
56
57
  trackId: string;
57
- source?: number | string;
58
+ source?: HMSTrackSource;
58
59
  isMute?: boolean;
59
60
  trackDescription?: string;
60
61
  playbackAllowed?: boolean;
@@ -1,6 +1,7 @@
1
1
  import { HMSPeer } from './HMSPeer';
2
2
  import { HMSRemoteAudioTrack } from './HMSRemoteAudioTrack';
3
3
  import { HMSRemoteVideoTrack } from './HMSRemoteVideoTrack';
4
+ import type { HMSTrackSource } from './HMSTrackSource';
4
5
 
5
6
  export class HMSRemotePeer extends HMSPeer {
6
7
  private remoteAudio?: HMSRemoteAudioTrack;
@@ -16,9 +17,10 @@ export class HMSRemotePeer extends HMSPeer {
16
17
 
17
18
  constructor(params: {
18
19
  peerID: string;
20
+ name: string;
19
21
  remoteAudioTrackData?: {
20
22
  trackId: string;
21
- source?: number | string;
23
+ source?: HMSTrackSource;
22
24
  isMute?: boolean;
23
25
  trackDescription?: string;
24
26
  playbackAllowed?: boolean;
@@ -26,7 +28,7 @@ export class HMSRemotePeer extends HMSPeer {
26
28
  };
27
29
  remoteVideoTrackData?: {
28
30
  trackId: string;
29
- source?: number | string;
31
+ source?: HMSTrackSource;
30
32
  trackDescription?: string;
31
33
  isMute?: boolean;
32
34
  playbackAllowed?: boolean;
@@ -5,6 +5,7 @@ import type { HMSTrackType } from './HMSTrackType';
5
5
  import type { HMSLayer } from './HMSLayer';
6
6
  import type { HMSSimulcastLayerDefinition } from './HMSSimulcastLayerDefinition';
7
7
  import { HMSEncoder } from './HMSEncoder';
8
+ import type { HMSTrackSource } from './HMSTrackSource';
8
9
 
9
10
  const {
10
11
  /**
@@ -105,7 +106,7 @@ export class HMSRemoteVideoTrack extends HMSVideoTrack {
105
106
 
106
107
  constructor(params: {
107
108
  trackId: string;
108
- source?: number | string;
109
+ source?: HMSTrackSource;
109
110
  trackDescription?: string;
110
111
  isMute?: boolean;
111
112
  playbackAllowed?: boolean;
@@ -128,7 +128,7 @@ export class HMSRoom {
128
128
  );
129
129
  }
130
130
 
131
- get peerCount(): number {
131
+ get peerCount(): number | null {
132
132
  const hmsRoomCache = getHmsRoomCache();
133
133
 
134
134
  if (hmsRoomCache) {