@100mslive/react-native-hms 0.9.0 → 0.9.3

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 (206) hide show
  1. package/README.md +242 -21
  2. package/android/.gradle/6.9/fileHashes/fileHashes.bin +0 -0
  3. package/android/.gradle/6.9/fileHashes/fileHashes.lock +0 -0
  4. package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
  5. package/android/.gradle/buildOutputCleanup/outputFiles.bin +0 -0
  6. package/android/.gradle/checksums/checksums.lock +0 -0
  7. package/android/.gradle/checksums/md5-checksums.bin +0 -0
  8. package/android/.gradle/checksums/sha1-checksums.bin +0 -0
  9. package/android/.idea/gradle.xml +13 -0
  10. package/android/.idea/misc.xml +9 -0
  11. package/android/.idea/modules/android.iml +18 -0
  12. package/android/.idea/modules.xml +8 -0
  13. package/android/.idea/sonarlint/issuestore/f/0/f07866736216be0ee2aba49e392191aeae700a35 +0 -0
  14. package/android/.idea/sonarlint/issuestore/index.pb +3 -0
  15. package/android/.idea/vcs.xml +6 -0
  16. package/android/build.gradle +2 -2
  17. package/android/local.properties +8 -0
  18. package/android/src/main/java/com/reactnativehmssdk/HmsDecoder.kt +53 -4
  19. package/android/src/main/java/com/reactnativehmssdk/HmsHelper.kt +138 -64
  20. package/android/src/main/java/com/reactnativehmssdk/HmsModule.kt +19 -5
  21. package/android/src/main/java/com/reactnativehmssdk/HmsSDK.kt +133 -109
  22. package/android/src/main/java/com/reactnativehmssdk/HmsScreenshareActivity.kt +11 -0
  23. package/android/src/main/java/com/reactnativehmssdk/HmsView.kt +3 -27
  24. package/android/src/main/java/com/reactnativehmssdk/HmssdkViewManager.kt +0 -2
  25. package/ios/HmsDecoder.swift +218 -137
  26. package/ios/HmsHelper.swift +51 -40
  27. package/ios/HmsManager.m +7 -1
  28. package/ios/HmsManager.swift +111 -68
  29. package/ios/HmsSDK.swift +345 -203
  30. package/ios/HmsView.swift +45 -31
  31. package/ios/VideoCollectionViewCell.swift +4 -4
  32. package/lib/commonjs/classes/HMSBrowserRecordingState.js +6 -0
  33. package/lib/commonjs/classes/HMSBrowserRecordingState.js.map +1 -1
  34. package/lib/commonjs/classes/HMSConfig.js +3 -0
  35. package/lib/commonjs/classes/HMSConfig.js.map +1 -1
  36. package/lib/commonjs/classes/HMSEncoder.js +196 -5
  37. package/lib/commonjs/classes/HMSEncoder.js.map +1 -1
  38. package/lib/commonjs/classes/HMSHLSConfig.js +3 -0
  39. package/lib/commonjs/classes/HMSHLSConfig.js.map +1 -1
  40. package/lib/commonjs/classes/HMSHLSRecordingConfig.js +23 -0
  41. package/lib/commonjs/classes/HMSHLSRecordingConfig.js.map +1 -0
  42. package/lib/commonjs/classes/HMSHLSRecordingState.js +29 -0
  43. package/lib/commonjs/classes/HMSHLSRecordingState.js.map +1 -0
  44. package/lib/commonjs/classes/HMSHLSVariant.js.map +1 -1
  45. package/lib/commonjs/classes/HMSLocalAudioStats.js +26 -0
  46. package/lib/commonjs/classes/HMSLocalAudioStats.js.map +1 -0
  47. package/lib/commonjs/classes/HMSLocalPeer.js.map +1 -1
  48. package/lib/commonjs/classes/HMSLocalVideoStats.js +32 -0
  49. package/lib/commonjs/classes/HMSLocalVideoStats.js.map +1 -0
  50. package/lib/commonjs/classes/HMSLogger.js +21 -21
  51. package/lib/commonjs/classes/HMSLogger.js.map +1 -1
  52. package/lib/commonjs/classes/HMSMessage.js +4 -1
  53. package/lib/commonjs/classes/HMSMessage.js.map +1 -1
  54. package/lib/commonjs/classes/HMSMessageRecipient.js +26 -0
  55. package/lib/commonjs/classes/HMSMessageRecipient.js.map +1 -0
  56. package/lib/commonjs/classes/HMSMessageRecipientType.js +15 -0
  57. package/lib/commonjs/classes/HMSMessageRecipientType.js.map +1 -0
  58. package/lib/commonjs/classes/HMSNetworkQuality.js +20 -0
  59. package/lib/commonjs/classes/HMSNetworkQuality.js.map +1 -0
  60. package/lib/commonjs/classes/HMSPeer.js +3 -0
  61. package/lib/commonjs/classes/HMSPeer.js.map +1 -1
  62. package/lib/commonjs/classes/HMSPeerUpdate.js +2 -7
  63. package/lib/commonjs/classes/HMSPeerUpdate.js.map +1 -1
  64. package/lib/commonjs/classes/HMSPermissions.js +2 -2
  65. package/lib/commonjs/classes/HMSPermissions.js.map +1 -1
  66. package/lib/commonjs/classes/HMSRTCStats.js +38 -0
  67. package/lib/commonjs/classes/HMSRTCStats.js.map +1 -0
  68. package/lib/commonjs/classes/HMSRTCStatsReport.js +26 -0
  69. package/lib/commonjs/classes/HMSRTCStatsReport.js.map +1 -0
  70. package/lib/commonjs/classes/HMSRemoteAudioStats.js +32 -0
  71. package/lib/commonjs/classes/HMSRemoteAudioStats.js.map +1 -0
  72. package/lib/commonjs/classes/HMSRemotePeer.js.map +1 -1
  73. package/lib/commonjs/classes/HMSRemoteVideoStats.js +38 -0
  74. package/lib/commonjs/classes/HMSRemoteVideoStats.js.map +1 -0
  75. package/lib/commonjs/classes/HMSRoom.js +6 -0
  76. package/lib/commonjs/classes/HMSRoom.js.map +1 -1
  77. package/lib/commonjs/classes/HMSRoomUpdate.js +1 -0
  78. package/lib/commonjs/classes/HMSRoomUpdate.js.map +1 -1
  79. package/lib/commonjs/classes/HMSRtmpStreamingState.js +6 -0
  80. package/lib/commonjs/classes/HMSRtmpStreamingState.js.map +1 -1
  81. package/lib/commonjs/classes/HMSSDK.js +381 -114
  82. package/lib/commonjs/classes/HMSSDK.js.map +1 -1
  83. package/lib/commonjs/classes/HMSServerRecordingState.js +3 -0
  84. package/lib/commonjs/classes/HMSServerRecordingState.js.map +1 -1
  85. package/lib/commonjs/classes/HMSUpdateListenerActions.js +5 -0
  86. package/lib/commonjs/classes/HMSUpdateListenerActions.js.map +1 -1
  87. package/lib/commonjs/index.js +154 -0
  88. package/lib/commonjs/index.js.map +1 -1
  89. package/lib/module/classes/HMSBrowserRecordingState.js +6 -0
  90. package/lib/module/classes/HMSBrowserRecordingState.js.map +1 -1
  91. package/lib/module/classes/HMSConfig.js +3 -0
  92. package/lib/module/classes/HMSConfig.js.map +1 -1
  93. package/lib/module/classes/HMSEncoder.js +187 -5
  94. package/lib/module/classes/HMSEncoder.js.map +1 -1
  95. package/lib/module/classes/HMSHLSConfig.js +3 -0
  96. package/lib/module/classes/HMSHLSConfig.js.map +1 -1
  97. package/lib/module/classes/HMSHLSRecordingConfig.js +14 -0
  98. package/lib/module/classes/HMSHLSRecordingConfig.js.map +1 -0
  99. package/lib/module/classes/HMSHLSRecordingState.js +20 -0
  100. package/lib/module/classes/HMSHLSRecordingState.js.map +1 -0
  101. package/lib/module/classes/HMSHLSVariant.js.map +1 -1
  102. package/lib/module/classes/HMSLocalAudioStats.js +17 -0
  103. package/lib/module/classes/HMSLocalAudioStats.js.map +1 -0
  104. package/lib/module/classes/HMSLocalPeer.js.map +1 -1
  105. package/lib/module/classes/HMSLocalVideoStats.js +23 -0
  106. package/lib/module/classes/HMSLocalVideoStats.js.map +1 -0
  107. package/lib/module/classes/HMSLogger.js +21 -21
  108. package/lib/module/classes/HMSLogger.js.map +1 -1
  109. package/lib/module/classes/HMSMessage.js +4 -1
  110. package/lib/module/classes/HMSMessage.js.map +1 -1
  111. package/lib/module/classes/HMSMessageRecipient.js +17 -0
  112. package/lib/module/classes/HMSMessageRecipient.js.map +1 -0
  113. package/lib/module/classes/HMSMessageRecipientType.js +8 -0
  114. package/lib/module/classes/HMSMessageRecipientType.js.map +1 -0
  115. package/lib/module/classes/HMSNetworkQuality.js +11 -0
  116. package/lib/module/classes/HMSNetworkQuality.js.map +1 -0
  117. package/lib/module/classes/HMSPeer.js +3 -0
  118. package/lib/module/classes/HMSPeer.js.map +1 -1
  119. package/lib/module/classes/HMSPeerUpdate.js +2 -7
  120. package/lib/module/classes/HMSPeerUpdate.js.map +1 -1
  121. package/lib/module/classes/HMSPermissions.js +2 -2
  122. package/lib/module/classes/HMSPermissions.js.map +1 -1
  123. package/lib/module/classes/HMSRTCStats.js +29 -0
  124. package/lib/module/classes/HMSRTCStats.js.map +1 -0
  125. package/lib/module/classes/HMSRTCStatsReport.js +17 -0
  126. package/lib/module/classes/HMSRTCStatsReport.js.map +1 -0
  127. package/lib/module/classes/HMSRemoteAudioStats.js +23 -0
  128. package/lib/module/classes/HMSRemoteAudioStats.js.map +1 -0
  129. package/lib/module/classes/HMSRemotePeer.js.map +1 -1
  130. package/lib/module/classes/HMSRemoteVideoStats.js +29 -0
  131. package/lib/module/classes/HMSRemoteVideoStats.js.map +1 -0
  132. package/lib/module/classes/HMSRoom.js +6 -0
  133. package/lib/module/classes/HMSRoom.js.map +1 -1
  134. package/lib/module/classes/HMSRoomUpdate.js +1 -0
  135. package/lib/module/classes/HMSRoomUpdate.js.map +1 -1
  136. package/lib/module/classes/HMSRtmpStreamingState.js +6 -0
  137. package/lib/module/classes/HMSRtmpStreamingState.js.map +1 -1
  138. package/lib/module/classes/HMSSDK.js +368 -114
  139. package/lib/module/classes/HMSSDK.js.map +1 -1
  140. package/lib/module/classes/HMSServerRecordingState.js +3 -0
  141. package/lib/module/classes/HMSServerRecordingState.js.map +1 -1
  142. package/lib/module/classes/HMSUpdateListenerActions.js +5 -0
  143. package/lib/module/classes/HMSUpdateListenerActions.js.map +1 -1
  144. package/lib/module/index.js +11 -0
  145. package/lib/module/index.js.map +1 -1
  146. package/lib/typescript/classes/HMSBrowserRecordingState.d.ts +4 -0
  147. package/lib/typescript/classes/HMSConfig.d.ts +2 -0
  148. package/lib/typescript/classes/HMSEncoder.d.ts +25 -0
  149. package/lib/typescript/classes/HMSHLSConfig.d.ts +5 -2
  150. package/lib/typescript/classes/HMSHLSRecordingConfig.d.ts +8 -0
  151. package/lib/typescript/classes/HMSHLSRecordingState.d.ts +12 -0
  152. package/lib/typescript/classes/HMSHLSVariant.d.ts +8 -8
  153. package/lib/typescript/classes/HMSLocalAudioStats.d.ts +10 -0
  154. package/lib/typescript/classes/HMSLocalPeer.d.ts +2 -0
  155. package/lib/typescript/classes/HMSLocalVideoStats.d.ts +15 -0
  156. package/lib/typescript/classes/HMSMessage.d.ts +8 -4
  157. package/lib/typescript/classes/HMSMessageRecipient.d.ts +13 -0
  158. package/lib/typescript/classes/HMSMessageRecipientType.d.ts +5 -0
  159. package/lib/typescript/classes/HMSNetworkQuality.d.ts +6 -0
  160. package/lib/typescript/classes/HMSPeer.d.ts +3 -0
  161. package/lib/typescript/classes/HMSPeerUpdate.d.ts +3 -8
  162. package/lib/typescript/classes/HMSPermissions.d.ts +2 -2
  163. package/lib/typescript/classes/HMSRTCStats.d.ts +18 -0
  164. package/lib/typescript/classes/HMSRTCStatsReport.d.ts +11 -0
  165. package/lib/typescript/classes/HMSRemoteAudioStats.d.ts +14 -0
  166. package/lib/typescript/classes/HMSRemotePeer.d.ts +2 -0
  167. package/lib/typescript/classes/HMSRemoteVideoStats.d.ts +19 -0
  168. package/lib/typescript/classes/HMSRoom.d.ts +5 -0
  169. package/lib/typescript/classes/HMSRoomUpdate.d.ts +2 -1
  170. package/lib/typescript/classes/HMSRtmpStreamingState.d.ts +4 -0
  171. package/lib/typescript/classes/HMSSDK.d.ts +310 -8
  172. package/lib/typescript/classes/HMSServerRecordingState.d.ts +2 -0
  173. package/lib/typescript/classes/HMSUpdateListenerActions.d.ts +6 -1
  174. package/lib/typescript/index.d.ts +11 -0
  175. package/package.json +1 -1
  176. package/react-native-hms.podspec +1 -1
  177. package/src/classes/HMSBrowserRecordingState.ts +10 -1
  178. package/src/classes/HMSConfig.ts +3 -0
  179. package/src/classes/HMSEncoder.ts +208 -5
  180. package/src/classes/HMSHLSConfig.ts +8 -2
  181. package/src/classes/HMSHLSRecordingConfig.ts +9 -0
  182. package/src/classes/HMSHLSRecordingState.ts +18 -0
  183. package/src/classes/HMSHLSVariant.ts +8 -8
  184. package/src/classes/HMSLocalAudioStats.ts +15 -0
  185. package/src/classes/HMSLocalPeer.ts +2 -0
  186. package/src/classes/HMSLocalVideoStats.ts +23 -0
  187. package/src/classes/HMSLogger.ts +3 -3
  188. package/src/classes/HMSMessage.ts +11 -5
  189. package/src/classes/HMSMessageRecipient.ts +19 -0
  190. package/src/classes/HMSMessageRecipientType.ts +5 -0
  191. package/src/classes/HMSNetworkQuality.ts +7 -0
  192. package/src/classes/HMSPeer.ts +4 -2
  193. package/src/classes/HMSPeerUpdate.ts +2 -7
  194. package/src/classes/HMSPermissions.ts +3 -3
  195. package/src/classes/HMSRTCStats.ts +27 -0
  196. package/src/classes/HMSRTCStatsReport.ts +17 -0
  197. package/src/classes/HMSRemoteAudioStats.ts +21 -0
  198. package/src/classes/HMSRemotePeer.ts +2 -0
  199. package/src/classes/HMSRemoteVideoStats.ts +29 -0
  200. package/src/classes/HMSRoom.ts +7 -0
  201. package/src/classes/HMSRoomUpdate.ts +1 -0
  202. package/src/classes/HMSRtmpStreamingState.ts +10 -1
  203. package/src/classes/HMSSDK.tsx +530 -18
  204. package/src/classes/HMSServerRecordingState.ts +7 -1
  205. package/src/classes/HMSUpdateListenerActions.ts +5 -0
  206. package/src/index.ts +11 -0
@@ -0,0 +1,13 @@
1
+ import type { HMSMessageRecipientType } from './HMSMessageRecipientType';
2
+ import type { HMSPeer } from './HMSPeer';
3
+ import type { HMSRole } from './HMSRole';
4
+ export declare class HMSMessageRecipient {
5
+ recipientType?: HMSMessageRecipientType;
6
+ recipientPeer?: HMSPeer;
7
+ recipientRoles?: HMSRole[];
8
+ constructor(params: {
9
+ recipientType: HMSMessageRecipientType;
10
+ recipientPeer?: HMSPeer;
11
+ recipientRoles?: HMSRole[];
12
+ });
13
+ }
@@ -0,0 +1,5 @@
1
+ export declare enum HMSMessageRecipientType {
2
+ BROADCAST = "BROADCAST",
3
+ PEER = "PEER",
4
+ ROLES = "ROLES"
5
+ }
@@ -0,0 +1,6 @@
1
+ export declare class HMSNetworkQuality {
2
+ downlinkQuality: number;
3
+ constructor(params: {
4
+ downlinkQuality: number;
5
+ });
6
+ }
@@ -1,4 +1,5 @@
1
1
  import type { HMSAudioTrack } from './HMSAudioTrack';
2
+ import type { HMSNetworkQuality } from './HMSNetworkQuality';
2
3
  import type { HMSRole } from './HMSRole';
3
4
  import type { HMSTrack } from './HMSTrack';
4
5
  import type { HMSVideoTrack } from './HMSVideoTrack';
@@ -10,6 +11,7 @@ export declare class HMSPeer {
10
11
  customerDescription?: string;
11
12
  metadata?: string;
12
13
  role?: HMSRole;
14
+ networkQuality?: HMSNetworkQuality;
13
15
  audioTrack?: HMSAudioTrack;
14
16
  videoTrack?: HMSVideoTrack;
15
17
  auxiliaryTracks?: HMSTrack[];
@@ -21,6 +23,7 @@ export declare class HMSPeer {
21
23
  customerDescription?: string;
22
24
  metadata?: string;
23
25
  role?: HMSRole;
26
+ networkQuality?: HMSNetworkQuality;
24
27
  audioTrack?: HMSAudioTrack;
25
28
  videoTrack?: HMSVideoTrack;
26
29
  auxiliaryTracks?: HMSTrack[];
@@ -1,13 +1,8 @@
1
1
  export declare enum HMSPeerUpdate {
2
2
  PEER_JOINED = "PEER_JOINED",
3
3
  PEER_LEFT = "PEER_LEFT",
4
- AUDIO_TOGGLED = "AUDIO_TOGGLED",
5
- VIDEO_TOGGLED = "VIDEO_TOGGLED",
6
4
  METADATA_CHANGED = "METADATA_CHANGED",
7
- BECAME_DOMINANT_SPEAKER = "BECAME_DOMINANT_SPEAKER",
8
- NO_DOMINANT_SPEAKER = "NO_DOMINANT_SPEAKER",
9
- RESIGNED_DOMINANT_SPEAKER = "RESIGNED_DOMINANT_SPEAKER",
10
- STARTED_SPEAKING = "STARTED_SPEAKING",
11
- STOPPED_SPEAKING = "STOPPED_SPEAKING",
12
- ROLE_CHANGED = "ROLE_CHANGED"
5
+ ROLE_CHANGED = "ROLE_CHANGED",
6
+ NAME_CHANGED = "NAME_CHANGED",
7
+ NETWORK_QUALITY_UPDATED = "NETWORK_QUALITY_UPDATED"
13
8
  }
@@ -5,7 +5,7 @@ export declare class HMSPermissions {
5
5
  mute?: boolean;
6
6
  changeRole?: boolean;
7
7
  recording?: boolean;
8
- rtmp?: boolean;
8
+ streaming?: boolean;
9
9
  constructor(params?: {
10
10
  endRoom?: boolean;
11
11
  removeOthers?: boolean;
@@ -13,6 +13,6 @@ export declare class HMSPermissions {
13
13
  mute?: boolean;
14
14
  changeRole?: boolean;
15
15
  recording?: boolean;
16
- rtmp?: boolean;
16
+ streaming?: boolean;
17
17
  });
18
18
  }
@@ -0,0 +1,18 @@
1
+ export declare class HMSRTCStats {
2
+ bitrateReceived?: number;
3
+ bitrateSent?: number;
4
+ bytesReceived?: number;
5
+ bytesSent?: number;
6
+ packetsLost?: number;
7
+ packetsReceived?: number;
8
+ roundTripTime?: number;
9
+ constructor(params: {
10
+ bitrateReceived?: number;
11
+ bitrateSent?: number;
12
+ bytesReceived?: number;
13
+ bytesSent?: number;
14
+ packetsLost?: number;
15
+ packetsReceived?: number;
16
+ roundTripTime?: number;
17
+ });
18
+ }
@@ -0,0 +1,11 @@
1
+ import type { HMSRTCStats } from './HMSRTCStats';
2
+ export declare class HMSRTCStatsReport {
3
+ video?: HMSRTCStats;
4
+ audio?: HMSRTCStats;
5
+ combined?: HMSRTCStats;
6
+ constructor(params: {
7
+ video?: HMSRTCStats;
8
+ audio?: HMSRTCStats;
9
+ combined?: HMSRTCStats;
10
+ });
11
+ }
@@ -0,0 +1,14 @@
1
+ export declare class HMSRemoteAudioStats {
2
+ bitrate?: number;
3
+ packetsReceived?: number;
4
+ packetsLost?: number;
5
+ bytesReceived?: number;
6
+ jitter?: number;
7
+ constructor(params: {
8
+ bitrate?: number;
9
+ packetsReceived?: number;
10
+ packetsLost?: number;
11
+ bytesReceived?: number;
12
+ jitter?: number;
13
+ });
14
+ }
@@ -1,4 +1,5 @@
1
1
  import type { HMSAudioTrack } from './HMSAudioTrack';
2
+ import type { HMSNetworkQuality } from './HMSNetworkQuality';
2
3
  import { HMSPeer } from './HMSPeer';
3
4
  import { HMSRemoteAudioTrack } from './HMSRemoteAudioTrack';
4
5
  import { HMSRemoteVideoTrack } from './HMSRemoteVideoTrack';
@@ -20,6 +21,7 @@ export declare class HMSRemotePeer extends HMSPeer {
20
21
  audioTrack?: HMSAudioTrack;
21
22
  videoTrack?: HMSVideoTrack;
22
23
  role?: HMSRole;
24
+ networkQuality?: HMSNetworkQuality;
23
25
  auxiliaryTracks?: HMSTrack[];
24
26
  remoteAudioTrackData?: {
25
27
  trackId: string;
@@ -0,0 +1,19 @@
1
+ import type { HMSVideoResolution } from './HMSVideoResolution';
2
+ export declare class HMSRemoteVideoStats {
3
+ bitrate?: number;
4
+ packetsReceived?: number;
5
+ packetsLost?: number;
6
+ bytesReceived?: number;
7
+ jitter?: number;
8
+ resolution?: HMSVideoResolution;
9
+ frameRate?: number;
10
+ constructor(params: {
11
+ bitrate?: number;
12
+ packetsReceived?: number;
13
+ packetsLost?: number;
14
+ bytesReceived?: number;
15
+ jitter?: number;
16
+ resolution?: HMSVideoResolution;
17
+ frameRate?: number;
18
+ });
19
+ }
@@ -3,6 +3,7 @@ import type { HMSRtmpStreamingState } from './HMSRtmpStreamingState';
3
3
  import type { HMSServerRecordingState } from './HMSServerRecordingState';
4
4
  import type { HMSBrowserRecordingState } from './HMSBrowserRecordingState';
5
5
  import type { HMSHLSStreamingState } from './HMSHLSStreamingState';
6
+ import type { HMSHLSRecordingState } from './HMSHLSRecordingState';
6
7
  export declare class HMSRoom {
7
8
  id: string;
8
9
  name: string;
@@ -12,6 +13,8 @@ export declare class HMSRoom {
12
13
  rtmpHMSRtmpStreamingState: HMSRtmpStreamingState;
13
14
  serverRecordingState: HMSServerRecordingState;
14
15
  hlsStreamingState: HMSHLSStreamingState;
16
+ hlsRecordingState?: HMSHLSRecordingState;
17
+ peerCount: number;
15
18
  constructor(params: {
16
19
  id: string;
17
20
  name: string;
@@ -21,5 +24,7 @@ export declare class HMSRoom {
21
24
  rtmpHMSRtmpStreamingState: HMSRtmpStreamingState;
22
25
  serverRecordingState: HMSServerRecordingState;
23
26
  hlsStreamingState: HMSHLSStreamingState;
27
+ hlsRecordingState?: HMSHLSRecordingState;
28
+ peerCount: number;
24
29
  });
25
30
  }
@@ -6,5 +6,6 @@ export declare enum HMSRoomUpdate {
6
6
  SERVER_RECORDING_STATE_UPDATED = "SERVER_RECORDING_STATE_UPDATED",
7
7
  RTMP_STREAMING_STATE_UPDATED = "RTMP_STREAMING_STATE_UPDATED",
8
8
  BROWSER_RECORDING_STATE_UPDATED = "BROWSER_RECORDING_STATE_UPDATED",
9
- HLS_STREAMING_STATE_UPDATED = "HLS_STREAMING_STATE_UPDATED"
9
+ HLS_STREAMING_STATE_UPDATED = "HLS_STREAMING_STATE_UPDATED",
10
+ ROOM_ID_UPDATED = "ROOM_ID_UPDATED"
10
11
  }
@@ -2,8 +2,12 @@ import type { HMSException } from './HMSException';
2
2
  export declare class HMSRtmpStreamingState {
3
3
  running: string;
4
4
  error: HMSException;
5
+ startedAt: Date;
6
+ stoppedAt: Date;
5
7
  constructor(params: {
6
8
  running: string;
7
9
  error: HMSException;
10
+ startedAt: Date;
11
+ stoppedAt: Date;
8
12
  });
9
13
  }
@@ -43,10 +43,15 @@ export declare class HMSSDK {
43
43
  onRoleChangeRequestDelegate?: any;
44
44
  onChangeTrackStateRequestDelegate?: any;
45
45
  onRemovedFromRoomDelegate?: any;
46
+ onRtcStatsDelegate?: any;
47
+ onLocalAudioStatsDelegate?: any;
48
+ onLocalVideoStatsDelegate?: any;
49
+ onRemoteAudioStatsDelegate?: any;
50
+ onRemoteVideoStatsDelegate?: any;
46
51
  constructor(id: string);
47
52
  /**
48
53
  * - Returns an instance of [HMSSDK]{@link HMSSDK}
49
- * - This function must be called to get an instance of HMSSDK class and only then user can interact with its methods
54
+ * - This function must be called to get an instance of HMSSDK class and only then user can interact with its methods.
50
55
  *
51
56
  * @static
52
57
  * @returns
@@ -55,53 +60,332 @@ export declare class HMSSDK {
55
60
  static build(params?: {
56
61
  trackSettings: HMSTrackSettings;
57
62
  }): Promise<HMSSDK>;
63
+ /**
64
+ * - Returns the instance of logger which can be used to manipulate log levels.
65
+ * @returns @instance HMSLogger
66
+ * @memberof HMSSDK
67
+ */
58
68
  static getLogger(): HMSLogger | undefined;
69
+ /**
70
+ * - Updates the logger for this instance of HMSSDK
71
+ * @param {HMSLogger} hmsLogger
72
+ * @memberof HMSSDK
73
+ */
59
74
  setLogger: (hmsLogger: HMSLogger) => void;
75
+ /**
76
+ * - Calls removeListeners that in turn breaks all connections with native listeners.
77
+ *
78
+ * @memberof HMSSDK
79
+ */
60
80
  destroy: () => void;
81
+ /**
82
+ * - Attaches preview listener for native callbacks.
83
+ * Note:this function connects sdk to native side and not app to sdk.
84
+ *
85
+ * @memberof HMSSDK
86
+ */
61
87
  attachPreviewListener: () => void;
88
+ /**
89
+ * - Attaches all the listeners to native callbacks.
90
+ * Note: this function connects sdk to native side and not app to sdk.
91
+ * @memberof HMSSDK
92
+ */
62
93
  attachListeners: () => void;
94
+ /**
95
+ * Disconnects all the listeners of this sdk from native listeners.
96
+ * Note: this function is only called from destroy function and should only be called when the current instance of {@link HMSSDK} is not required anymore.
97
+ * @memberof HMSSDK
98
+ */
63
99
  removeListeners: () => void;
64
100
  /**
65
- * takes an instance of [HMSConfig]{@link HMSConfig} and joins the room
66
- * after joining the room user will start receiving the events and updates of the room
101
+ * takes an instance of [HMSConfig]{@link HMSConfig} and joins the room.
102
+ * after joining the room user will start receiving the events and updates of the room.
103
+ *
104
+ * checkout {@link https://www.100ms.live/docs/react-native/v2/features/join} for more info
67
105
  *
68
106
  * @param {HMSConfig} config
69
107
  * @memberof HMSSDK
70
108
  */
71
109
  join: (config: HMSConfig) => Promise<void>;
110
+ /**
111
+ * - preview function is used to initiate a preview for the localPeer.
112
+ * - We can call this function and wait for a response in previewListener, the response will contain previewTracks for local peer.
113
+ *
114
+ * checkout {@link https://www.100ms.live/docs/react-native/v2/features/preview} for more info
115
+ *
116
+ * @param {HMSConfig} config
117
+ * @memberof HMSSDK
118
+ */
72
119
  preview: (config: HMSConfig) => void;
120
+ /**
121
+ * - previewForRole can be used when there is role change request for current localPeer and we want
122
+ * to show the localPeer how the tracks look before publishing them to room.
123
+ *
124
+ * - It requires a role of type [HMSRole]{@link HMSRole} for which we want to preview the tracks.
125
+ *
126
+ * checkout {@link https://www.100ms.live/docs/react-native} for more info
127
+ *
128
+ * @param {HMSRole}
129
+ * @memberof HMSSDK
130
+ */
131
+ previewForRole: (role: HMSRole) => Promise<any>;
132
+ /**
133
+ * - HmsView is react component that takes one track and starts showing that track on a tile.
134
+ * - The appearance of tile is completely customizable with style prop.
135
+ * - setting sink true or false for a video tile will add or remove sink for a video.
136
+ * - scale type can determine how the incoming video will fit in the canvas check {@link HMSVideoViewMode} for more information.
137
+ *
138
+ * checkout {@link https://www.100ms.live/docs/react-native/v2/features/render-video} for more info
139
+ *
140
+ * @param {HmsComponentProps}
141
+ * @memberof HMSSDK
142
+ */
73
143
  HmsView: ({ sink, trackId, style, mirror, scaleType, }: HmsComponentProps) => JSX.Element;
74
144
  /**
75
- * Calls leave function of native sdk and session of current user is invalidated
145
+ * Calls leave function of native sdk and session of current user is invalidated.
146
+ *
147
+ * checkout {@link https://www.100ms.live/docs/react-native/v2/features/leave} for more info
76
148
  *
77
149
  * @memberof HMSSDK
78
150
  */
79
151
  leave: () => Promise<any>;
152
+ /**
153
+ * - This function sends message to all the peers in the room, the get the message in onMessage listener.
154
+ *
155
+ * checkout {@link https://www.100ms.live/docs/react-native/v2/features/chat} for more info
156
+ *
157
+ * @param {message: string} and @param {type: string}
158
+ * @memberof HMSSDK
159
+ */
80
160
  sendBroadcastMessage: (message: string, type?: string) => Promise<any>;
161
+ /**
162
+ * - sendGroupMessage sends a message to specific set of roles, whoever has any of those role in room
163
+ * will get the message in onMessage listener.
164
+ *
165
+ * checkout {@link https://www.100ms.live/docs/react-native/v2/features/chat} for more info
166
+ *
167
+ * @memberof HMSSDK
168
+ */
81
169
  sendGroupMessage: (message: string, roles: HMSRole[], type?: string) => Promise<any>;
170
+ /**
171
+ * - sendDirectMessage sends a private message to a single peer, only that peer will get the message
172
+ * in onMessage Listener.
173
+ *
174
+ * checkout {@link https://www.100ms.live/docs/react-native/v2/features/chat} for more info
175
+ *
176
+ * @memberof HMSSDK
177
+ */
82
178
  sendDirectMessage: (message: string, peer: HMSPeer, type?: string) => Promise<any>;
179
+ /**
180
+ * - changeMetadata changes a specific field in localPeer which is [metadata] it is a string that can
181
+ * be used for various functionalities like raiseHand, beRightBack and many more that explains the
182
+ * current status of the peer.
183
+ *
184
+ * - it is advised to use a json object in string format to store multiple dataPoints in metadata.
185
+ *
186
+ * checkout {@link https://www.100ms.live/docs/react-native/v2/features/change-metadata} for more info
187
+ *
188
+ * @param {string}
189
+ * @memberof HMSSDK
190
+ */
83
191
  changeMetadata: (metadata: string) => void;
192
+ /**
193
+ * - startRTMPOrRecording takes a configuration object {@link HMSRTMPConfig} and stats the RTMP recording
194
+ * - this object of {@link HMSRTMPConfig} sets the urls for streaming and weather to set recording on or not
195
+ * - we get the response of this function in onRoomUpdate as RTMP_STREAMING_STATE_UPDATED.
196
+ *
197
+ * checkout {@link https://www.100ms.live/docs/react-native/v2/features/recording} for more info
198
+ *
199
+ * @memberof HMSSDK
200
+ */
84
201
  startRTMPOrRecording: (data: HMSRTMPConfig) => Promise<any>;
202
+ /**
203
+ * - this function stops all the ongoing RTMP streaming and recording.
204
+ * - we get the response of this function in onRoomUpdate as RTMP_STREAMING_STATE_UPDATED.
205
+ *
206
+ * checkout {@link https://www.100ms.live/docs/react-native/v2/features/recording} for more info
207
+ *
208
+ * @memberof HMSSDK
209
+ */
85
210
  stopRtmpAndRecording: () => Promise<any>;
211
+ /**
212
+ * - This function starts HLSStreaming.
213
+ * - we get the response of this function in onRoomUpdate as HLS_STREAMING_STATE_UPDATED.
214
+ *
215
+ * checkout {@link https://www.100ms.live/docs/react-native/v2/features/hls-streaming} for more info
216
+ *
217
+ * @param {HMSHLSConfig}
218
+ * @memberof HMSSDK
219
+ */
86
220
  startHLSStreaming: (data: HMSHLSConfig) => Promise<any>;
221
+ /**
222
+ * - stopHLSStreaming function stops the ongoing HLSStreams.
223
+ * - we get the response of this function in onRoomUpdate as HLS_STREAMING_STATE_UPDATED.
224
+ *
225
+ * checkout {@link https://www.100ms.live/docs/react-native/v2/features/hls-streaming} for more info
226
+ *
227
+ * @memberof HMSSDK
228
+ */
87
229
  stopHLSStreaming: () => Promise<any>;
230
+ /**
231
+ * - This function can be used in a situation when we want to change role hence manipulate their
232
+ * access and rights in the current room, it takes the peer {@link HMSPeer} whom role we want to change,
233
+ * role {@link HMSRole} which will be the new role for that peer and weather to forcefully change
234
+ * the role or ask the to accept the role change request using a boolean force.
235
+ *
236
+ * - if we change the role forcefully the peer's role will be updated without asking the peer
237
+ * otherwise the user will get the roleChangeRequest in roleChangeRequest listener.
238
+ * for more information on this checkout {@link onRoleChangeRequestListener}
239
+ *
240
+ * checkout {@link https://www.100ms.live/docs/react-native/v2/features/change-role} for more info
241
+ *
242
+ * @memberof HMSSDK
243
+ */
88
244
  changeRole: (peer: HMSPeer, role: HMSRole, force?: boolean) => Promise<any>;
245
+ /**
246
+ * - This function can be used to manipulate mute status of any track.
247
+ * - Targeted peer affected by this action will get a callback in {@link onChangeTrackStateRequestListener}.
248
+ *
249
+ * * checkout {@link https://www.100ms.live/docs/react-native/v2/features/change-track-state} for more info
250
+ *
251
+ * @param {HMSTrack}
252
+ * @memberof HMSSDK
253
+ */
89
254
  changeTrackState: (track: HMSTrack, mute: boolean) => Promise<any>;
255
+ /**
256
+ * - changeTrackStateForRoles is an enhancement on the functionality of {@link changeTrackState}.
257
+ * - We can change mute status for all the tracks of peers having a particular role.
258
+ * - @param source determines the source of the track ex. video, audio etc.
259
+ * - The peers affected by this action will get a callback in {@link onChangeTrackStateRequestListener}.
260
+ *
261
+ * @memberof HMSSDK
262
+ */
90
263
  changeTrackStateForRoles: (mute: boolean, type?: HMSTrackType | undefined, source?: string | undefined, roles?: HMSRole[] | undefined) => Promise<any>;
264
+ /**
265
+ * - removePeer can forcefully disconnect a Peer from the room.
266
+ * - the user who's removed from this action will get a callback in {@link onRemovedFromRoomListener}.
267
+ *
268
+ * checkout {@link https://www.100ms.live/docs/react-native/v2/features/remove-peer} for more info
269
+ *
270
+ * @memberof HMSSDK
271
+ */
91
272
  removePeer: (peer: HMSPeer, reason: string) => Promise<any>;
273
+ /**
274
+ * - endRoom can be used in a situation where we want to disconnect all the peers from current room
275
+ * and end the call.
276
+ * - everyone in the room will get an update of this action in {@link onRemovedFromRoomListener}.
277
+ *
278
+ * checkout {@link https://www.100ms.live/docs/react-native/v2/features/end-room} for more info
279
+ *
280
+ * @memberof HMSSDK
281
+ */
92
282
  endRoom: (reason: string, lock?: boolean) => Promise<any>;
283
+ /**
284
+ * - This function can be used to change name of localPeer.
285
+ *
286
+ * checkout {@link https://www.100ms.live/docs/react-native/v2/features/change-name} for more info
287
+ *
288
+ * @memberof HMSSDK
289
+ */
290
+ changeName: (name: string) => Promise<any>;
291
+ /**
292
+ * - Calling this function will accept the most recent roleChange request made by anyone in the room
293
+ *
294
+ * checkout {@link https://www.100ms.live/docs/react-native/v2/features/change-role} for more info
295
+ *
296
+ * @memberof HMSSDK
297
+ */
93
298
  acceptRoleChange: () => Promise<any>;
94
- muteAllPeersAudio: (mute: boolean) => void;
299
+ /**
300
+ * - setPlaybackForAllAudio is an extension of the abilities of {@link setPlaybackAllowed} in
301
+ * {@link HMSRemoteAudioTrack}, it sets mute status for all peers in the room
302
+ *
303
+ * checkout {@link https://www.100ms.live/docs/react-native/v2/features/playback-allowed} for more info
304
+ *
305
+ * @memberof HMSSDK
306
+ */
307
+ setPlaybackForAllAudio: (mute: boolean) => void;
308
+ /**
309
+ * - This function mutes audio for all peers in the room.
310
+ *
311
+ * @memberof HMSSDK
312
+ */
313
+ remoteMuteAllAudio: () => void;
314
+ /**
315
+ * - getRoom is a wrapper function on an existing native function also known as getRoom the returns
316
+ * current room object which is of type {@link HMSRoom}
317
+ *
318
+ * checkout {@link https://www.100ms.live/docs/react-native/v2/features/room} for more info
319
+ *
320
+ * @memberof HMSSDK
321
+ * @return HMSRoom
322
+ */
95
323
  getRoom: () => Promise<HMSRoom>;
324
+ /**
325
+ * - This function sets the volume of any peer in the room
326
+ *
327
+ * checkout {@link https://www.100ms.live/docs/react-native/v2/features/set-volume} for more info
328
+ *
329
+ * @memberof HMSSDK
330
+ */
96
331
  setVolume: (track: HMSTrack, volume: number) => void;
97
332
  resetVolume: () => void;
333
+ /**
334
+ * - This is a temporary solution for the situation when mic access is taken from the app and
335
+ * user returns to the app with no mic access. It will re-acquire the mic by setting the volume
336
+ * from native side
337
+ *
338
+ * @memberof HMSSDK
339
+ */
98
340
  addAppStateListener: () => void;
99
- startScreenshare: () => void;
341
+ /**
342
+ * - This function is used to start screenshare, currently available only for android
343
+ *
344
+ * checkout {@link https://www.100ms.live/docs/react-native/v2/features/screenshare} for more info
345
+ *
346
+ * @memberof HMSSDK
347
+ */
348
+ startScreenshare: () => Promise<any>;
349
+ /**
350
+ * - Returns a boolean stating if the screen is currently shared or not
351
+ *
352
+ * checkout {@link https://www.100ms.live/docs/react-native/v2/features/screenshare} for more info
353
+ *
354
+ * @memberof HMSSDK
355
+ */
100
356
  isScreenShared: () => Promise<any>;
357
+ /**
358
+ * - stops the screenShare, currently available for android only.
359
+ *
360
+ * checkout {@link https://www.100ms.live/docs/react-native/v2/features/screenshare} for more info
361
+ *
362
+ * @memberof HMSSDK
363
+ */
101
364
  stopScreenshare: () => Promise<any>;
365
+ /**
366
+ * - enableRTCStats sets a boolean in native side which in turn allows several events to be passed
367
+ * through the bridge these events are {@link RTCStatsListener}, {@link onRemoteVideoStatsListener},
368
+ * {@link onRemoteAudioStatsListener}, {@link onLocalAudioStatsListener} and {@link onLocalVideoStatsListener}
369
+ *
370
+ * - These listeners get various dataPoints for current peers and their connectivity to the room
371
+ * such as jitter, latency etc.
372
+ *
373
+ * - currently available for iOS only
374
+ *
375
+ * @memberof HMSSDK
376
+ */
377
+ enableRTCStats: () => void;
378
+ /**
379
+ * - disable RTCStats sets the same boolean to false that was set true by enableRTCStats.
380
+ * that activates a check which filters out the events acquired in native listeners and don't
381
+ * let them pass through bridge
382
+ *
383
+ * - currently available for iOS only.
384
+ * @memberof HMSSDK
385
+ */
386
+ disableRTCStats: () => void;
102
387
  /**
103
388
  * - This is a prototype event listener that takes action and listens for updates related to that particular action
104
- * - This method will be @deprecated in future and event listener will be passed in join method
105
389
  *
106
390
  * @param {string} action
107
391
  * @param {*} callback
@@ -110,7 +394,6 @@ export declare class HMSSDK {
110
394
  addEventListener: (action: HMSUpdateListenerActions, callback: any) => void;
111
395
  /**
112
396
  * - This is a prototype event listener that takes action and listens for updates related to that particular action
113
- * - This method will be @deprecated in future and event listener will be passed in join method
114
397
  *
115
398
  * @param {string} action
116
399
  * @param {*} callback
@@ -123,6 +406,20 @@ export declare class HMSSDK {
123
406
  * @memberof HMSSDK
124
407
  */
125
408
  removeAllListeners: () => void;
409
+ /**
410
+ * - Below are all the listeners that are connected to native side.
411
+ *
412
+ * - All of the are connected when build function is called, we can connect them to the app by
413
+ * calling {@link addEventListener} with corresponding event type.
414
+ *
415
+ * - Before passing the data to the eventListener of the app these listeners encode the data in
416
+ * ts classes for a proper structuring of the data.
417
+ *
418
+ * - Even When event listeners of the app are disconnected using {@link removeEventListener} or
419
+ * {@link removeAllListeners} or not even connected in first place, these functions still run to
420
+ * maintain the current state of the instance of {@link HMSSDK}.
421
+ *
422
+ */
126
423
  onPreviewListener: (data: any) => void;
127
424
  onJoinListener: (data: any) => void;
128
425
  onRoomListener: (data: any) => void;
@@ -136,5 +433,10 @@ export declare class HMSSDK {
136
433
  onRemovedFromRoomListener: (data: any) => void;
137
434
  reconnectingListener: (data: any) => void;
138
435
  reconnectedListener: (data: any) => void;
436
+ RTCStatsListener: (data: any) => void;
437
+ onLocalAudioStatsListener: (data: any) => void;
438
+ onLocalVideoStatsListener: (data: any) => void;
439
+ onRemoteAudioStatsListener: (data: any) => void;
440
+ onRemoteVideoStatsListener: (data: any) => void;
139
441
  }
140
442
  export {};
@@ -2,8 +2,10 @@ import type { HMSException } from './HMSException';
2
2
  export declare class HMSServerRecordingState {
3
3
  running: string;
4
4
  error: HMSException;
5
+ startedAt: Date;
5
6
  constructor(params: {
6
7
  running: string;
7
8
  error: HMSException;
9
+ startedAt: Date;
8
10
  });
9
11
  }
@@ -11,5 +11,10 @@ export declare enum HMSUpdateListenerActions {
11
11
  RECONNECTED = "RECONNECTED",
12
12
  ON_ROLE_CHANGE_REQUEST = "ON_ROLE_CHANGE_REQUEST",
13
13
  ON_CHANGE_TRACK_STATE_REQUEST = "ON_CHANGE_TRACK_STATE_REQUEST",
14
- ON_REMOVED_FROM_ROOM = "ON_REMOVED_FROM_ROOM"
14
+ ON_REMOVED_FROM_ROOM = "ON_REMOVED_FROM_ROOM",
15
+ ON_RTC_STATS = "ON_RTC_STATS",
16
+ ON_LOCAL_AUDIO_STATS = "ON_LOCAL_AUDIO_STATS",
17
+ ON_LOCAL_VIDEO_STATS = "ON_LOCAL_VIDEO_STATS",
18
+ ON_REMOTE_AUDIO_STATS = "ON_REMOTE_AUDIO_STATS",
19
+ ON_REMOTE_VIDEO_STATS = "ON_REMOTE_VIDEO_STATS"
15
20
  }
@@ -51,5 +51,16 @@ export * from './classes/HMSHLSMeetingURLVariant';
51
51
  export * from './classes/HMSHLSVariant';
52
52
  export * from './classes/HMSHLSStreamingState';
53
53
  export * from './classes/HMSVideoResolution';
54
+ export * from './classes/HMSLocalAudioStats';
55
+ export * from './classes/HMSLocalVideoStats';
56
+ export * from './classes/HMSRTCStats';
57
+ export * from './classes/HMSRTCStatsReport';
58
+ export * from './classes/HMSRemoteAudioStats';
59
+ export * from './classes/HMSRemoteVideoStats';
60
+ export * from './classes/HMSHLSRecordingConfig';
61
+ export * from './classes/HMSHLSRecordingState';
62
+ export * from './classes/HMSMessageRecipient';
63
+ export * from './classes/HMSMessageRecipientType';
64
+ export * from './classes/HMSNetworkQuality';
54
65
  import { HMSSDK as HmsManager } from './classes/HMSSDK';
55
66
  export default HmsManager;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@100mslive/react-native-hms",
3
- "version": "0.9.0",
3
+ "version": "0.9.3",
4
4
  "description": "The React Native package for 100ms SDK",
5
5
  "main": "lib/commonjs/index",
6
6
  "module": "lib/module/index",
@@ -16,5 +16,5 @@ Pod::Spec.new do |s|
16
16
  s.source_files = "ios/**/*.{h,m,mm,swift}"
17
17
 
18
18
  s.dependency "React-Core"
19
- s.dependency "HMSSDK", "0.2.6"
19
+ s.dependency "HMSSDK", "0.2.9"
20
20
  end