@100mslive/react-native-hms 1.2.0 → 1.3.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 (267) hide show
  1. package/README.md +2 -2
  2. package/android/src/main/java/com/reactnativehmssdk/HMSDecoder.kt +121 -53
  3. package/android/src/main/java/com/reactnativehmssdk/HMSManager.kt +14 -0
  4. package/android/src/main/java/com/reactnativehmssdk/HMSRNSDK.kt +139 -31
  5. package/ios/HMSDecoder.swift +113 -50
  6. package/ios/HMSManager.m +4 -0
  7. package/ios/HMSManager.swift +15 -1
  8. package/ios/HMSRNSDK.swift +119 -26
  9. package/ios/HMSView.swift +1 -1
  10. package/lib/commonjs/classes/HMSAudioCodec.js +4 -4
  11. package/lib/commonjs/classes/HMSAudioCodec.js.map +1 -1
  12. package/lib/commonjs/classes/HMSAudioDevice.js +4 -4
  13. package/lib/commonjs/classes/HMSAudioDevice.js.map +1 -1
  14. package/lib/commonjs/classes/HMSAudioFilePlayerNode.js.map +1 -1
  15. package/lib/commonjs/classes/HMSAudioMixerSource.js.map +1 -1
  16. package/lib/commonjs/classes/HMSAudioMixingMode.js +4 -4
  17. package/lib/commonjs/classes/HMSAudioMixingMode.js.map +1 -1
  18. package/lib/commonjs/classes/HMSAudioMode.js +4 -4
  19. package/lib/commonjs/classes/HMSAudioMode.js.map +1 -1
  20. package/lib/commonjs/classes/HMSAudioNode.js +2 -1
  21. package/lib/commonjs/classes/HMSAudioNode.js.map +1 -1
  22. package/lib/commonjs/classes/HMSAudioSettings.js.map +1 -1
  23. package/lib/commonjs/classes/HMSAudioTrack.js.map +1 -1
  24. package/lib/commonjs/classes/HMSAudioTrackSettings.js.map +1 -1
  25. package/lib/commonjs/classes/HMSBrowserRecordingState.js.map +1 -1
  26. package/lib/commonjs/classes/HMSCameraFacing.js +4 -4
  27. package/lib/commonjs/classes/HMSCameraFacing.js.map +1 -1
  28. package/lib/commonjs/classes/HMSChangeTrackStateRequest.js.map +1 -1
  29. package/lib/commonjs/classes/HMSConfig.js.map +1 -1
  30. package/lib/commonjs/classes/HMSConstants.js +11 -0
  31. package/lib/commonjs/classes/HMSConstants.js.map +1 -0
  32. package/lib/commonjs/classes/HMSEncoder.js +21 -43
  33. package/lib/commonjs/classes/HMSEncoder.js.map +1 -1
  34. package/lib/commonjs/classes/HMSException.js.map +1 -1
  35. package/lib/commonjs/classes/HMSHLSConfig.js.map +1 -1
  36. package/lib/commonjs/classes/HMSHLSMeetingURLVariant.js.map +1 -1
  37. package/lib/commonjs/classes/HMSHLSRecordingConfig.js.map +1 -1
  38. package/lib/commonjs/classes/HMSHLSRecordingState.js.map +1 -1
  39. package/lib/commonjs/classes/HMSHLSStreamingState.js.map +1 -1
  40. package/lib/commonjs/classes/HMSHLSVariant.js.map +1 -1
  41. package/lib/commonjs/classes/HMSHelper.js.map +1 -1
  42. package/lib/commonjs/classes/HMSLocalAudioStats.js.map +1 -1
  43. package/lib/commonjs/classes/HMSLocalAudioTrack.js.map +1 -1
  44. package/lib/commonjs/classes/HMSLocalPeer.js +0 -1
  45. package/lib/commonjs/classes/HMSLocalPeer.js.map +1 -1
  46. package/lib/commonjs/classes/HMSLocalVideoStats.js.map +1 -1
  47. package/lib/commonjs/classes/HMSLocalVideoTrack.js.map +1 -1
  48. package/lib/commonjs/classes/HMSLogAlarmManager.js +4 -4
  49. package/lib/commonjs/classes/HMSLogAlarmManager.js.map +1 -1
  50. package/lib/commonjs/classes/HMSLogLevel.js +4 -4
  51. package/lib/commonjs/classes/HMSLogLevel.js.map +1 -1
  52. package/lib/commonjs/classes/HMSLogSettings.js.map +1 -1
  53. package/lib/commonjs/classes/HMSLogger.js +17 -25
  54. package/lib/commonjs/classes/HMSLogger.js.map +1 -1
  55. package/lib/commonjs/classes/HMSMessage.js.map +1 -1
  56. package/lib/commonjs/classes/HMSMessageRecipient.js.map +1 -1
  57. package/lib/commonjs/classes/HMSMessageRecipientType.js +4 -4
  58. package/lib/commonjs/classes/HMSMessageRecipientType.js.map +1 -1
  59. package/lib/commonjs/classes/HMSMessageType.js +4 -4
  60. package/lib/commonjs/classes/HMSMessageType.js.map +1 -1
  61. package/lib/commonjs/classes/HMSMicNode.js.map +1 -1
  62. package/lib/commonjs/classes/HMSNativeEventEmitter.js +0 -5
  63. package/lib/commonjs/classes/HMSNativeEventEmitter.js.map +1 -1
  64. package/lib/commonjs/classes/HMSNetworkQuality.js.map +1 -1
  65. package/lib/commonjs/classes/HMSPIPListenerActions.js +4 -4
  66. package/lib/commonjs/classes/HMSPIPListenerActions.js.map +1 -1
  67. package/lib/commonjs/classes/HMSPeer.js +66 -19
  68. package/lib/commonjs/classes/HMSPeer.js.map +1 -1
  69. package/lib/commonjs/classes/HMSPeerUpdate.js +7 -5
  70. package/lib/commonjs/classes/HMSPeerUpdate.js.map +1 -1
  71. package/lib/commonjs/classes/HMSPeersCache.js +229 -0
  72. package/lib/commonjs/classes/HMSPeersCache.js.map +1 -0
  73. package/lib/commonjs/classes/HMSPermissions.js.map +1 -1
  74. package/lib/commonjs/classes/HMSPublishSettings.js.map +1 -1
  75. package/lib/commonjs/classes/HMSRTCStats.js.map +1 -1
  76. package/lib/commonjs/classes/HMSRTCStatsReport.js.map +1 -1
  77. package/lib/commonjs/classes/HMSRTMPConfig.js.map +1 -1
  78. package/lib/commonjs/classes/HMSRemoteAudioStats.js.map +1 -1
  79. package/lib/commonjs/classes/HMSRemoteAudioTrack.js.map +1 -1
  80. package/lib/commonjs/classes/HMSRemotePeer.js +0 -1
  81. package/lib/commonjs/classes/HMSRemotePeer.js.map +1 -1
  82. package/lib/commonjs/classes/HMSRemoteVideoStats.js.map +1 -1
  83. package/lib/commonjs/classes/HMSRemoteVideoTrack.js.map +1 -1
  84. package/lib/commonjs/classes/HMSRole.js.map +1 -1
  85. package/lib/commonjs/classes/HMSRoleChangeRequest.js.map +1 -1
  86. package/lib/commonjs/classes/HMSRoom.js +79 -22
  87. package/lib/commonjs/classes/HMSRoom.js.map +1 -1
  88. package/lib/commonjs/classes/HMSRoomCache.js +128 -0
  89. package/lib/commonjs/classes/HMSRoomCache.js.map +1 -0
  90. package/lib/commonjs/classes/HMSRoomUpdate.js +4 -4
  91. package/lib/commonjs/classes/HMSRoomUpdate.js.map +1 -1
  92. package/lib/commonjs/classes/HMSRtmpStreamingState.js.map +1 -1
  93. package/lib/commonjs/classes/HMSRtmpVideoResolution.js.map +1 -1
  94. package/lib/commonjs/classes/HMSSDK.js +468 -21
  95. package/lib/commonjs/classes/HMSSDK.js.map +1 -1
  96. package/lib/commonjs/classes/HMSScreenBroadcastAudioReceiverNode.js.map +1 -1
  97. package/lib/commonjs/classes/HMSServerRecordingState.js.map +1 -1
  98. package/lib/commonjs/classes/HMSSimulcastLayerSettings.js.map +1 -1
  99. package/lib/commonjs/classes/HMSSimulcastSettings.js.map +1 -1
  100. package/lib/commonjs/classes/HMSSpeaker.js.map +1 -1
  101. package/lib/commonjs/classes/HMSSubscribeSettings.js.map +1 -1
  102. package/lib/commonjs/classes/HMSTrack.js.map +1 -1
  103. package/lib/commonjs/classes/HMSTrackSettings.js.map +1 -1
  104. package/lib/commonjs/classes/HMSTrackSettingsInitState.js +4 -4
  105. package/lib/commonjs/classes/HMSTrackSettingsInitState.js.map +1 -1
  106. package/lib/commonjs/classes/HMSTrackSource.js +4 -4
  107. package/lib/commonjs/classes/HMSTrackSource.js.map +1 -1
  108. package/lib/commonjs/classes/HMSTrackType.js +4 -4
  109. package/lib/commonjs/classes/HMSTrackType.js.map +1 -1
  110. package/lib/commonjs/classes/HMSTrackUpdate.js +4 -4
  111. package/lib/commonjs/classes/HMSTrackUpdate.js.map +1 -1
  112. package/lib/commonjs/classes/HMSUpdateListenerActions.js +5 -5
  113. package/lib/commonjs/classes/HMSUpdateListenerActions.js.map +1 -1
  114. package/lib/commonjs/classes/HMSVideoCodec.js +4 -4
  115. package/lib/commonjs/classes/HMSVideoCodec.js.map +1 -1
  116. package/lib/commonjs/classes/HMSVideoResolution.js.map +1 -1
  117. package/lib/commonjs/classes/HMSVideoSettings.js.map +1 -1
  118. package/lib/commonjs/classes/HMSVideoTrack.js.map +1 -1
  119. package/lib/commonjs/classes/HMSVideoTrackSettings.js.map +1 -1
  120. package/lib/commonjs/classes/HMSVideoViewMode.js +4 -4
  121. package/lib/commonjs/classes/HMSVideoViewMode.js.map +1 -1
  122. package/lib/commonjs/classes/HmsView.js +2 -1
  123. package/lib/commonjs/classes/HmsView.js.map +1 -1
  124. package/lib/commonjs/index.js.map +1 -1
  125. package/lib/module/classes/HMSAudioCodec.js +3 -3
  126. package/lib/module/classes/HMSAudioCodec.js.map +1 -1
  127. package/lib/module/classes/HMSAudioDevice.js +3 -3
  128. package/lib/module/classes/HMSAudioDevice.js.map +1 -1
  129. package/lib/module/classes/HMSAudioFilePlayerNode.js.map +1 -1
  130. package/lib/module/classes/HMSAudioMixerSource.js.map +1 -1
  131. package/lib/module/classes/HMSAudioMixingMode.js +3 -3
  132. package/lib/module/classes/HMSAudioMixingMode.js.map +1 -1
  133. package/lib/module/classes/HMSAudioMode.js +3 -3
  134. package/lib/module/classes/HMSAudioMode.js.map +1 -1
  135. package/lib/module/classes/HMSAudioNode.js +2 -1
  136. package/lib/module/classes/HMSAudioNode.js.map +1 -1
  137. package/lib/module/classes/HMSAudioSettings.js.map +1 -1
  138. package/lib/module/classes/HMSAudioTrack.js.map +1 -1
  139. package/lib/module/classes/HMSAudioTrackSettings.js.map +1 -1
  140. package/lib/module/classes/HMSBrowserRecordingState.js.map +1 -1
  141. package/lib/module/classes/HMSCameraFacing.js +3 -3
  142. package/lib/module/classes/HMSCameraFacing.js.map +1 -1
  143. package/lib/module/classes/HMSChangeTrackStateRequest.js.map +1 -1
  144. package/lib/module/classes/HMSConfig.js.map +1 -1
  145. package/lib/module/classes/HMSConstants.js +4 -0
  146. package/lib/module/classes/HMSConstants.js.map +1 -0
  147. package/lib/module/classes/HMSEncoder.js +21 -43
  148. package/lib/module/classes/HMSEncoder.js.map +1 -1
  149. package/lib/module/classes/HMSException.js.map +1 -1
  150. package/lib/module/classes/HMSHLSConfig.js.map +1 -1
  151. package/lib/module/classes/HMSHLSMeetingURLVariant.js.map +1 -1
  152. package/lib/module/classes/HMSHLSRecordingConfig.js.map +1 -1
  153. package/lib/module/classes/HMSHLSRecordingState.js.map +1 -1
  154. package/lib/module/classes/HMSHLSStreamingState.js.map +1 -1
  155. package/lib/module/classes/HMSHLSVariant.js.map +1 -1
  156. package/lib/module/classes/HMSHelper.js.map +1 -1
  157. package/lib/module/classes/HMSLocalAudioStats.js.map +1 -1
  158. package/lib/module/classes/HMSLocalAudioTrack.js.map +1 -1
  159. package/lib/module/classes/HMSLocalPeer.js +0 -1
  160. package/lib/module/classes/HMSLocalPeer.js.map +1 -1
  161. package/lib/module/classes/HMSLocalVideoStats.js.map +1 -1
  162. package/lib/module/classes/HMSLocalVideoTrack.js.map +1 -1
  163. package/lib/module/classes/HMSLogAlarmManager.js +3 -3
  164. package/lib/module/classes/HMSLogAlarmManager.js.map +1 -1
  165. package/lib/module/classes/HMSLogLevel.js +3 -3
  166. package/lib/module/classes/HMSLogLevel.js.map +1 -1
  167. package/lib/module/classes/HMSLogSettings.js.map +1 -1
  168. package/lib/module/classes/HMSLogger.js +17 -25
  169. package/lib/module/classes/HMSLogger.js.map +1 -1
  170. package/lib/module/classes/HMSMessage.js.map +1 -1
  171. package/lib/module/classes/HMSMessageRecipient.js.map +1 -1
  172. package/lib/module/classes/HMSMessageRecipientType.js +3 -3
  173. package/lib/module/classes/HMSMessageRecipientType.js.map +1 -1
  174. package/lib/module/classes/HMSMessageType.js +3 -3
  175. package/lib/module/classes/HMSMessageType.js.map +1 -1
  176. package/lib/module/classes/HMSMicNode.js.map +1 -1
  177. package/lib/module/classes/HMSNativeEventEmitter.js +1 -6
  178. package/lib/module/classes/HMSNativeEventEmitter.js.map +1 -1
  179. package/lib/module/classes/HMSNetworkQuality.js.map +1 -1
  180. package/lib/module/classes/HMSPIPListenerActions.js +3 -3
  181. package/lib/module/classes/HMSPIPListenerActions.js.map +1 -1
  182. package/lib/module/classes/HMSPeer.js +66 -19
  183. package/lib/module/classes/HMSPeer.js.map +1 -1
  184. package/lib/module/classes/HMSPeerUpdate.js +4 -3
  185. package/lib/module/classes/HMSPeerUpdate.js.map +1 -1
  186. package/lib/module/classes/HMSPeersCache.js +216 -0
  187. package/lib/module/classes/HMSPeersCache.js.map +1 -0
  188. package/lib/module/classes/HMSPermissions.js.map +1 -1
  189. package/lib/module/classes/HMSPublishSettings.js.map +1 -1
  190. package/lib/module/classes/HMSRTCStats.js.map +1 -1
  191. package/lib/module/classes/HMSRTCStatsReport.js.map +1 -1
  192. package/lib/module/classes/HMSRTMPConfig.js.map +1 -1
  193. package/lib/module/classes/HMSRemoteAudioStats.js.map +1 -1
  194. package/lib/module/classes/HMSRemoteAudioTrack.js.map +1 -1
  195. package/lib/module/classes/HMSRemotePeer.js +0 -1
  196. package/lib/module/classes/HMSRemotePeer.js.map +1 -1
  197. package/lib/module/classes/HMSRemoteVideoStats.js.map +1 -1
  198. package/lib/module/classes/HMSRemoteVideoTrack.js.map +1 -1
  199. package/lib/module/classes/HMSRole.js.map +1 -1
  200. package/lib/module/classes/HMSRoleChangeRequest.js.map +1 -1
  201. package/lib/module/classes/HMSRoom.js +79 -22
  202. package/lib/module/classes/HMSRoom.js.map +1 -1
  203. package/lib/module/classes/HMSRoomCache.js +115 -0
  204. package/lib/module/classes/HMSRoomCache.js.map +1 -0
  205. package/lib/module/classes/HMSRoomUpdate.js +3 -3
  206. package/lib/module/classes/HMSRoomUpdate.js.map +1 -1
  207. package/lib/module/classes/HMSRtmpStreamingState.js.map +1 -1
  208. package/lib/module/classes/HMSRtmpVideoResolution.js.map +1 -1
  209. package/lib/module/classes/HMSSDK.js +468 -21
  210. package/lib/module/classes/HMSSDK.js.map +1 -1
  211. package/lib/module/classes/HMSScreenBroadcastAudioReceiverNode.js.map +1 -1
  212. package/lib/module/classes/HMSServerRecordingState.js.map +1 -1
  213. package/lib/module/classes/HMSSimulcastLayerSettings.js.map +1 -1
  214. package/lib/module/classes/HMSSimulcastSettings.js.map +1 -1
  215. package/lib/module/classes/HMSSpeaker.js.map +1 -1
  216. package/lib/module/classes/HMSSubscribeSettings.js.map +1 -1
  217. package/lib/module/classes/HMSTrack.js.map +1 -1
  218. package/lib/module/classes/HMSTrackSettings.js.map +1 -1
  219. package/lib/module/classes/HMSTrackSettingsInitState.js +3 -3
  220. package/lib/module/classes/HMSTrackSettingsInitState.js.map +1 -1
  221. package/lib/module/classes/HMSTrackSource.js +3 -3
  222. package/lib/module/classes/HMSTrackSource.js.map +1 -1
  223. package/lib/module/classes/HMSTrackType.js +3 -3
  224. package/lib/module/classes/HMSTrackType.js.map +1 -1
  225. package/lib/module/classes/HMSTrackUpdate.js +3 -3
  226. package/lib/module/classes/HMSTrackUpdate.js.map +1 -1
  227. package/lib/module/classes/HMSUpdateListenerActions.js +4 -4
  228. package/lib/module/classes/HMSUpdateListenerActions.js.map +1 -1
  229. package/lib/module/classes/HMSVideoCodec.js +3 -3
  230. package/lib/module/classes/HMSVideoCodec.js.map +1 -1
  231. package/lib/module/classes/HMSVideoResolution.js.map +1 -1
  232. package/lib/module/classes/HMSVideoSettings.js.map +1 -1
  233. package/lib/module/classes/HMSVideoTrack.js.map +1 -1
  234. package/lib/module/classes/HMSVideoTrackSettings.js.map +1 -1
  235. package/lib/module/classes/HMSVideoViewMode.js +3 -3
  236. package/lib/module/classes/HMSVideoViewMode.js.map +1 -1
  237. package/lib/module/classes/HmsView.js +2 -1
  238. package/lib/module/classes/HmsView.js.map +1 -1
  239. package/lib/typescript/classes/HMSConstants.d.ts +3 -0
  240. package/lib/typescript/classes/HMSEncoder.d.ts +7 -6
  241. package/lib/typescript/classes/HMSLocalPeer.d.ts +0 -14
  242. package/lib/typescript/classes/HMSLogger.d.ts +1 -7
  243. package/lib/typescript/classes/HMSPeer.d.ts +12 -18
  244. package/lib/typescript/classes/HMSPeerUpdate.d.ts +1 -0
  245. package/lib/typescript/classes/HMSPeersCache.d.ts +17 -0
  246. package/lib/typescript/classes/HMSRemotePeer.d.ts +0 -14
  247. package/lib/typescript/classes/HMSRoom.d.ts +11 -22
  248. package/lib/typescript/classes/HMSRoomCache.d.ts +16 -0
  249. package/lib/typescript/classes/HMSSDK.d.ts +1 -1
  250. package/lib/typescript/classes/HMSUpdateListenerActions.d.ts +1 -1
  251. package/package.json +1 -1
  252. package/sdk-versions.json +3 -3
  253. package/src/classes/HMSAudioNode.ts +3 -1
  254. package/src/classes/HMSConstants.ts +3 -0
  255. package/src/classes/HMSEncoder.ts +24 -69
  256. package/src/classes/HMSLocalPeer.ts +0 -15
  257. package/src/classes/HMSLogger.ts +20 -19
  258. package/src/classes/HMSNativeEventEmitter.ts +35 -12
  259. package/src/classes/HMSPeer.ts +133 -34
  260. package/src/classes/HMSPeerUpdate.ts +9 -0
  261. package/src/classes/HMSPeersCache.ts +252 -0
  262. package/src/classes/HMSRemotePeer.ts +0 -16
  263. package/src/classes/HMSRoom.ts +141 -37
  264. package/src/classes/HMSRoomCache.ts +157 -0
  265. package/src/classes/HMSSDK.tsx +57 -24
  266. package/src/classes/HMSUpdateListenerActions.ts +1 -1
  267. package/src/classes/HmsView.tsx +2 -1
@@ -16,6 +16,9 @@ import { HmsViewComponent } from './HmsView';
16
16
  import { HMSMessageType } from './HMSMessageType';
17
17
  import { HMSPIPListenerActions } from './HMSPIPListenerActions';
18
18
  import { HMSNativeEventEmitter } from './HMSNativeEventEmitter';
19
+ import { clearHmsPeersCache, getHmsPeersCache, HMSPeersCache, setHmsPeersCache } from './HMSPeersCache';
20
+ import { clearHmsRoomCache, getHmsRoomCache, HMSRoomCache, setHmsRoomCache } from './HMSRoomCache';
21
+ import { HMSPeerUpdateOrdinals } from './HMSPeerUpdate';
19
22
  const {
20
23
  /**
21
24
  * @ignore
@@ -52,29 +55,61 @@ export class HMSSDK {
52
55
  _defineProperty(this, "onAudioDeviceChangedDelegate", void 0);
53
56
  _defineProperty(this, "onPIPRoomLeaveDelegate", void 0);
54
57
  _defineProperty(this, "emitterSubscriptions", {});
58
+ /**
59
+ * - Updates the logger for this instance of HMSSDK
60
+ * @param {HMSLogger} hmsLogger
61
+ * @memberof HMSSDK
62
+ */
55
63
  _defineProperty(this, "setLogger", hmsLogger => {
56
64
  setLogger(this.id, hmsLogger);
57
65
  });
66
+ /**
67
+ * - Calls removeListeners that in turn breaks all connections with native listeners.
68
+ *
69
+ * @memberof HMSSDK
70
+ */
58
71
  _defineProperty(this, "destroy", async () => {
59
72
  logger === null || logger === void 0 ? void 0 : logger.verbose('#Function destroy', {
60
73
  id: this.id
61
74
  });
75
+ clearHmsPeersCache();
76
+ clearHmsRoomCache();
62
77
  this.removeAllListeners();
63
78
  return await HMSManager.destroy({
64
79
  id: this.id
65
80
  });
66
81
  });
82
+ /**
83
+ * takes an instance of [HMSConfig]{@link HMSConfig} and joins the room.
84
+ * after joining the room user will start receiving the events and updates of the room.
85
+ *
86
+ * checkout {@link https://www.100ms.live/docs/react-native/v2/features/join} for more info
87
+ *
88
+ * @param {HMSConfig} config
89
+ * @memberof HMSSDK
90
+ */
67
91
  _defineProperty(this, "join", async config => {
68
92
  logger === null || logger === void 0 ? void 0 : logger.verbose('#Function join', {
69
93
  config,
70
94
  id: this.id
71
95
  });
72
96
  this.addAppStateListener();
97
+ setHmsPeersCache(new HMSPeersCache(this.id));
98
+ setHmsRoomCache(new HMSRoomCache(this.id));
73
99
  await HMSManager.join({
74
100
  ...config,
75
101
  id: this.id
76
102
  });
77
103
  });
104
+ /**
105
+ * - preview function is used to initiate a preview for the localPeer.
106
+ * - We can call this function and wait for a response in previewListener, the response will contain previewTracks for local peer.
107
+ *
108
+ * checkout {@link https://www.100ms.live/docs/react-native/v2/features/preview} for more info
109
+ *
110
+ * @param {HMSConfig} config
111
+ * @memberof HMSSDK
112
+ */
78
113
  _defineProperty(this, "preview", config => {
79
114
  logger === null || logger === void 0 ? void 0 : logger.verbose('#Function preview', {
80
115
  config,
@@ -85,6 +120,17 @@ export class HMSSDK {
85
120
  id: this.id
86
121
  });
87
122
  });
123
+ /**
124
+ * - previewForRole can be used when there is role change request for current localPeer and we want
125
+ * to show the localPeer how the tracks look before publishing them to room.
126
+ *
127
+ * - It requires a role of type [HMSRole]{@link HMSRole} for which we want to preview the tracks.
128
+ *
129
+ * checkout {@link https://www.100ms.live/docs/react-native} for more info
130
+ *
131
+ * @param {HMSRole}
132
+ * @memberof HMSSDK
133
+ */
88
134
  _defineProperty(this, "previewForRole", async role => {
89
135
  logger === null || logger === void 0 ? void 0 : logger.verbose('#Function previewForRole', {
90
136
  role,
@@ -100,6 +146,17 @@ export class HMSSDK {
100
146
  return 'API currently not available for android';
101
147
  }
102
148
  });
149
+ /**
150
+ * - HmsView is react component that takes trackId and starts showing that track on a tile.
151
+ * - The appearance of tile is completely customizable with style prop.
152
+ * - Scale type can determine how the incoming video will fit in the canvas check {@link HMSVideoViewMode} for more information.
153
+ * - Mirror to flip the video vertically.
154
+ *
155
+ * checkout {@link https://www.100ms.live/docs/react-native/v2/features/render-video} for more info
156
+ *
157
+ * @param {HmsViewProps}
158
+ * @memberof HMSSDK
159
+ */
103
160
  _defineProperty(this, "HmsView", /*#__PURE__*/React.forwardRef((props, ref) => {
104
161
  const {
105
162
  trackId,
@@ -122,8 +179,17 @@ export class HMSSDK {
122
179
  var _this$appStateSubscri;
123
180
  this.muteStatus = undefined;
124
181
  this === null || this === void 0 ? void 0 : (_this$appStateSubscri = this.appStateSubscription) === null || _this$appStateSubscri === void 0 ? void 0 : _this$appStateSubscri.remove();
182
+ clearHmsPeersCache();
183
+ clearHmsRoomCache();
125
184
  HMSEncoder.clearData(); // Clearing cached data in encoder
126
185
  });
186
+ /**
187
+ * Calls leave function of native sdk and session of current user is invalidated.
188
+ *
189
+ * checkout {@link https://www.100ms.live/docs/react-native/v2/features/leave} for more info
190
+ *
191
+ * @memberof HMSSDK
192
+ */
127
193
  _defineProperty(this, "leave", async () => {
128
194
  logger === null || logger === void 0 ? void 0 : logger.verbose('#Function leave', {
129
195
  id: this.id
@@ -135,6 +201,14 @@ export class HMSSDK {
135
201
  this.roomLeaveCleanup();
136
202
  return op;
137
203
  });
204
+ /**
205
+ * - This function sends message to all the peers in the room, the get the message in onMessage listener.
206
+ *
207
+ * checkout {@link https://www.100ms.live/docs/react-native/v2/features/chat} for more info
208
+ *
209
+ * @param {message: string} and @param {type: string}
210
+ * @memberof HMSSDK
211
+ */
138
212
  _defineProperty(this, "sendBroadcastMessage", async function (message) {
139
213
  let type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : HMSMessageType.CHAT;
140
214
  logger === null || logger === void 0 ? void 0 : logger.verbose('#Function sendBroadcastMessage', {
@@ -148,6 +222,14 @@ export class HMSSDK {
148
222
  id: _this.id
149
223
  });
150
224
  });
225
+ /**
226
+ * - sendGroupMessage sends a message to specific set of roles, whoever has any of those role in room
227
+ * will get the message in onMessage listener.
228
+ *
229
+ * checkout {@link https://www.100ms.live/docs/react-native/v2/features/chat} for more info
230
+ *
231
+ * @memberof HMSSDK
232
+ */
151
233
  _defineProperty(this, "sendGroupMessage", async function (message, roles) {
152
234
  let type = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : HMSMessageType.CHAT;
153
235
  logger === null || logger === void 0 ? void 0 : logger.verbose('#Function sendGroupMessage', {
@@ -163,6 +245,14 @@ export class HMSSDK {
163
245
  type: type || null
164
246
  });
165
247
  });
248
+ /**
249
+ * - sendDirectMessage sends a private message to a single peer, only that peer will get the message
250
+ * in onMessage Listener.
251
+ *
252
+ * checkout {@link https://www.100ms.live/docs/react-native/v2/features/chat} for more info
253
+ *
254
+ * @memberof HMSSDK
255
+ */
166
256
  _defineProperty(this, "sendDirectMessage", async function (message, peer) {
167
257
  let type = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : HMSMessageType.CHAT;
168
258
  logger === null || logger === void 0 ? void 0 : logger.verbose('#Function sendDirectMessage', {
@@ -178,6 +268,18 @@ export class HMSSDK {
178
268
  type: type || null
179
269
  });
180
270
  });
271
+ /**
272
+ * - changeMetadata changes a specific field in localPeer which is [metadata] it is a string that can
273
+ * be used for various functionalities like raiseHand, beRightBack and many more that explains the
274
+ * current status of the peer.
275
+ *
276
+ * - it is advised to use a json object in string format to store multiple dataPoints in metadata.
277
+ *
278
+ * checkout {@link https://www.100ms.live/docs/react-native/v2/advanced-features/change-metadata} for more info
279
+ *
280
+ * @param {string}
281
+ * @memberof HMSSDK
282
+ */
181
283
  _defineProperty(this, "changeMetadata", async metadata => {
182
284
  logger === null || logger === void 0 ? void 0 : logger.verbose('#Function changeMetadata', {
183
285
  metadata,
@@ -188,6 +290,15 @@ export class HMSSDK {
188
290
  id: this.id
189
291
  });
190
292
  });
293
+ /**
294
+ * - startRTMPOrRecording takes a configuration object {@link HMSRTMPConfig} and stats the RTMP recording
295
+ * - this object of {@link HMSRTMPConfig} sets the urls for streaming and weather to set recording on or not
296
+ * - we get the response of this function in onRoomUpdate as RTMP_STREAMING_STATE_UPDATED.
297
+ *
298
+ * checkout {@link https://www.100ms.live/docs/react-native/v2/features/recording} for more info
299
+ *
300
+ * @memberof HMSSDK
301
+ */
191
302
  _defineProperty(this, "startRTMPOrRecording", async data => {
192
303
  logger === null || logger === void 0 ? void 0 : logger.verbose('#Function startRTMPOrRecording', {
193
304
  ...data,
@@ -199,6 +310,14 @@ export class HMSSDK {
199
310
  });
200
311
  return op;
201
312
  });
313
+ /**
314
+ * - this function stops all the ongoing RTMP streaming and recording.
315
+ * - we get the response of this function in onRoomUpdate as RTMP_STREAMING_STATE_UPDATED.
316
+ *
317
+ * checkout {@link https://www.100ms.live/docs/react-native/v2/features/recording} for more info
318
+ *
319
+ * @memberof HMSSDK
320
+ */
202
321
  _defineProperty(this, "stopRtmpAndRecording", async () => {
203
322
  logger === null || logger === void 0 ? void 0 : logger.verbose('#Function stopRtmpAndRecording', {});
204
323
  const op = await HMSManager.stopRtmpAndRecording({
@@ -206,6 +325,15 @@ export class HMSSDK {
206
325
  });
207
326
  return op;
208
327
  });
328
+ /**
329
+ * - This function starts HLSStreaming.
330
+ * - we get the response of this function in onRoomUpdate as HLS_STREAMING_STATE_UPDATED.
331
+ *
332
+ * checkout {@link https://www.100ms.live/docs/react-native/v2/features/hls-streaming} for more info
333
+ *
334
+ * @param {HMSHLSConfig}
335
+ * @memberof HMSSDK
336
+ */
209
337
  _defineProperty(this, "startHLSStreaming", async data => {
210
338
  logger === null || logger === void 0 ? void 0 : logger.verbose('#Function startHLSStreaming', {
211
339
  ...data,
@@ -216,12 +344,36 @@ export class HMSSDK {
216
344
  id: this.id
217
345
  });
218
346
  });
347
+ /**
348
+ * - stopHLSStreaming function stops the ongoing HLSStreams.
349
+ * - we get the response of this function in onRoomUpdate as HLS_STREAMING_STATE_UPDATED.
350
+ *
351
+ * checkout {@link https://www.100ms.live/docs/react-native/v2/features/hls-streaming} for more info
352
+ *
353
+ * @memberof HMSSDK
354
+ */
219
355
  _defineProperty(this, "stopHLSStreaming", async () => {
220
356
  logger === null || logger === void 0 ? void 0 : logger.verbose('#Function stopHLSStreaming', {});
221
357
  return await HMSManager.stopHLSStreaming({
222
358
  id: this.id
223
359
  });
224
360
  });
361
+ /**
362
+ * @deprecated This function has been deprecated in favor of #Function changeRoleOfPeer
363
+ *
364
+ * - This function can be used in a situation when we want to change role hence manipulate their
365
+ * access and rights in the current room, it takes the peer {@link HMSPeer} whom role we want to change,
366
+ * role {@link HMSRole} which will be the new role for that peer and weather to forcefully change
367
+ * the role or ask the to accept the role change request using a boolean force.
368
+ *
369
+ * - if we change the role forcefully the peer's role will be updated without asking the peer
370
+ * otherwise the user will get the roleChangeRequest in roleChangeRequest listener.
371
+ * for more information on this checkout {@link onRoleChangeRequestListener}
372
+ *
373
+ * checkout {@link https://www.100ms.live/docs/react-native/v2/features/change-role} for more info
374
+ *
375
+ * @memberof HMSSDK
376
+ */
225
377
  _defineProperty(this, "changeRole", async function (peer, role) {
226
378
  let force = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
227
379
  const data = {
@@ -233,6 +385,20 @@ export class HMSSDK {
233
385
  logger === null || logger === void 0 ? void 0 : logger.verbose('#Function changeRole', data);
234
386
  return await HMSManager.changeRole(data);
235
387
  });
388
+ /**
389
+ * - This function can be used in a situation when we want to change role hence manipulate their
390
+ * access and rights in the current room, it takes the peer {@link HMSPeer} whom role we want to change,
391
+ * role {@link HMSRole} which will be the new role for that peer and weather to forcefully change
392
+ * the role or ask the to accept the role change request using a boolean force.
393
+ *
394
+ * - if we change the role forcefully the peer's role will be updated without asking the peer
395
+ * otherwise the user will get the roleChangeRequest in roleChangeRequest listener.
396
+ * for more information on this checkout {@link onRoleChangeRequestListener}
397
+ *
398
+ * checkout {@link https://www.100ms.live/docs/react-native/v2/features/change-role} for more info
399
+ *
400
+ * @memberof HMSSDK
401
+ */
236
402
  _defineProperty(this, "changeRoleOfPeer", async function (peer, role) {
237
403
  let force = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
238
404
  const data = {
@@ -244,6 +410,19 @@ export class HMSSDK {
244
410
  logger === null || logger === void 0 ? void 0 : logger.verbose('#Function changeRoleOfPeer', data);
245
411
  return HMSManager.changeRoleOfPeer(data);
246
412
  });
413
+ /**
414
+ * - This function can be used in a situation when we want to change role of multiple peers by specifying their roles.
415
+ * Hence manipulate their access and rights in the current room.
416
+ * It takes the list of roles {@link HMSRole} whom role we want to change
417
+ * and role {@link HMSRole} which will be the new role for peers.
418
+ *
419
+ * - Note that role will be updated without asking the peers.
420
+ * Meaning, Peers will not get the roleChangeRequest in roleChangeRequest listener.
421
+ *
422
+ * checkout {@link https://www.100ms.live/docs/react-native/v2/features/change-role} for more info
423
+ *
424
+ * @memberof HMSSDK
425
+ */
247
426
  _defineProperty(this, "changeRoleOfPeersWithRoles", async (ofRoles, toRole) => {
248
427
  const data = {
249
428
  ofRoles: ofRoles.map(ofRole => ofRole.name).filter(Boolean),
@@ -253,6 +432,15 @@ export class HMSSDK {
253
432
  logger === null || logger === void 0 ? void 0 : logger.verbose('#Function changeRoleOfPeersWithRoles', data);
254
433
  return HMSManager.changeRoleOfPeersWithRoles(data);
255
434
  });
435
+ /**
436
+ * - This function can be used to manipulate mute status of any track.
437
+ * - Targeted peer affected by this action will get a callback in onChangeTrackStateRequestListener.
438
+ *
439
+ * * checkout {@link https://www.100ms.live/docs/react-native/v2/features/change-track-state} for more info
440
+ *
441
+ * @param {HMSTrack}
442
+ * @memberof HMSSDK
443
+ */
256
444
  _defineProperty(this, "changeTrackState", async (track, mute) => {
257
445
  logger === null || logger === void 0 ? void 0 : logger.verbose('#Function changeTrackState', {
258
446
  track,
@@ -266,6 +454,14 @@ export class HMSSDK {
266
454
  };
267
455
  return await HMSManager.changeTrackState(data);
268
456
  });
457
+ /**
458
+ * - changeTrackStateForRoles is an enhancement on the functionality of {@link changeTrackState}.
459
+ * - We can change mute status for all the tracks of peers having a particular role.
460
+ * - @param source determines the source of the track ex. video, audio etc.
461
+ * - The peers affected by this action will get a callback in onChangeTrackStateRequestListener.
462
+ *
463
+ * @memberof HMSSDK
464
+ */
269
465
  _defineProperty(this, "changeTrackStateForRoles", async (mute, type, source, roles) => {
270
466
  let roleNames = null;
271
467
  if (roles) {
@@ -287,6 +483,14 @@ export class HMSSDK {
287
483
  };
288
484
  return await HMSManager.changeTrackStateForRoles(data);
289
485
  });
486
+ /**
487
+ * - removePeer can forcefully disconnect a Peer from the room.
488
+ * - the user who's removed from this action will get a callback in {@link onRemovedFromRoomListener}.
489
+ *
490
+ * checkout {@link https://www.100ms.live/docs/react-native/v2/features/remove-peer} for more info
491
+ *
492
+ * @memberof HMSSDK
493
+ */
290
494
  _defineProperty(this, "removePeer", async (peer, reason) => {
291
495
  logger === null || logger === void 0 ? void 0 : logger.verbose('#Function removePeer', {
292
496
  peerId: peer.peerID,
@@ -300,6 +504,15 @@ export class HMSSDK {
300
504
  };
301
505
  return await HMSManager.removePeer(data);
302
506
  });
507
+ /**
508
+ * - endRoom can be used in a situation where we want to disconnect all the peers from current room
509
+ * and end the call.
510
+ * - everyone in the room will get an update of this action in {@link onRemovedFromRoomListener}.
511
+ *
512
+ * checkout {@link https://www.100ms.live/docs/react-native/v2/features/end-room} for more info
513
+ *
514
+ * @memberof HMSSDK
515
+ */
303
516
  _defineProperty(this, "endRoom", async function (reason) {
304
517
  let lock = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
305
518
  logger === null || logger === void 0 ? void 0 : logger.verbose('#Function endRoom', {
@@ -314,6 +527,13 @@ export class HMSSDK {
314
527
  };
315
528
  return await HMSManager.endRoom(data);
316
529
  });
530
+ /**
531
+ * - This function can be used to change name of localPeer.
532
+ *
533
+ * checkout {@link https://www.100ms.live/docs/react-native/v2/features/change-name} for more info
534
+ *
535
+ * @memberof HMSSDK
536
+ */
317
537
  _defineProperty(this, "changeName", async name => {
318
538
  logger === null || logger === void 0 ? void 0 : logger.verbose('#Function changeName', {
319
539
  name,
@@ -325,6 +545,13 @@ export class HMSSDK {
325
545
  };
326
546
  return await HMSManager.changeName(data);
327
547
  });
548
+ /**
549
+ * - Calling this function will accept the most recent roleChange request made by anyone in the room
550
+ *
551
+ * checkout {@link https://www.100ms.live/docs/react-native/v2/features/change-role} for more info
552
+ *
553
+ * @memberof HMSSDK
554
+ */
328
555
  _defineProperty(this, "acceptRoleChange", async () => {
329
556
  logger === null || logger === void 0 ? void 0 : logger.verbose('#Function acceptRoleChange', {
330
557
  id: this.id
@@ -333,6 +560,14 @@ export class HMSSDK {
333
560
  id: this.id
334
561
  });
335
562
  });
563
+ /**
564
+ * - setPlaybackForAllAudio is an extension of the abilities of setPlaybackAllowed in
565
+ * HMSRemoteAudioTrack. It sets mute status for all peers in the room only for the local peer.
566
+ *
567
+ * checkout {@link https://www.100ms.live/docs/react-native/v2/features/playback-allowed} for more info
568
+ *
569
+ * @memberof HMSSDK
570
+ */
336
571
  _defineProperty(this, "setPlaybackForAllAudio", mute => {
337
572
  logger === null || logger === void 0 ? void 0 : logger.verbose('#Function setPlaybackForAllAudio', {
338
573
  mute,
@@ -344,6 +579,11 @@ export class HMSSDK {
344
579
  id: this.id
345
580
  });
346
581
  });
582
+ /**
583
+ * - This function mutes audio for all peers in the room.
584
+ *
585
+ * @memberof HMSSDK
586
+ */
347
587
  _defineProperty(this, "remoteMuteAllAudio", async () => {
348
588
  logger === null || logger === void 0 ? void 0 : logger.verbose('#Function remoteMuteAllAudio', {
349
589
  id: this.id
@@ -352,16 +592,34 @@ export class HMSSDK {
352
592
  id: this.id
353
593
  });
354
594
  });
595
+ /**
596
+ * - getRoom is a wrapper function on an existing native function also known as getRoom the returns
597
+ * current room object which is of type {@link HMSRoom}
598
+ *
599
+ * checkout {@link https://www.100ms.live/docs/react-native/v2/features/join#get-room} for more info
600
+ *
601
+ * @memberof HMSSDK
602
+ * @return Promise<HMSRoom>
603
+ */
355
604
  _defineProperty(this, "getRoom", async () => {
605
+ var _getHmsRoomCache;
356
606
  logger === null || logger === void 0 ? void 0 : logger.verbose('#Function getRoom', {
357
607
  id: this.id
358
608
  });
359
609
  const hmsRoom = await HMSManager.getRoom({
360
610
  id: this.id
361
611
  });
612
+ (_getHmsRoomCache = getHmsRoomCache()) === null || _getHmsRoomCache === void 0 ? void 0 : _getHmsRoomCache.updateRoomCache(hmsRoom);
362
613
  const encodedHmsRoom = HMSEncoder.encodeHmsRoom(hmsRoom, this.id);
363
614
  return encodedHmsRoom;
364
615
  });
616
+ /**
617
+ * - getLocalPeer is a wrapper function on an existing native function also known as getLocalPeer the returns
618
+ * current local peer object which is of type {@link HMSLocalPeer}
619
+ *
620
+ * @memberof HMSSDK
621
+ * @return Promise<HMSLocalPeer>
622
+ */
365
623
  _defineProperty(this, "getLocalPeer", async () => {
366
624
  logger === null || logger === void 0 ? void 0 : logger.verbose('#Function getLocalPeer', {
367
625
  id: this.id
@@ -372,6 +630,13 @@ export class HMSSDK {
372
630
  const encodedLocalPeer = HMSEncoder.encodeHmsLocalPeer(localPeer, this.id);
373
631
  return encodedLocalPeer;
374
632
  });
633
+ /**
634
+ * - getRemotePeers is a wrapper function on an existing native function also known as getRemotePeers the returns
635
+ * remote peers array which is of type {@link HMSRemotePeer}
636
+ *
637
+ * @memberof HMSSDK
638
+ * @return Promise<HMSRemotePeer[]>
639
+ */
375
640
  _defineProperty(this, "getRemotePeers", async () => {
376
641
  logger === null || logger === void 0 ? void 0 : logger.verbose('#Function getRemotePeers', {
377
642
  id: this.id
@@ -382,6 +647,13 @@ export class HMSSDK {
382
647
  const encodedRemotePeers = HMSEncoder.encodeHmsRemotePeers(remotePeers, this.id);
383
648
  return encodedRemotePeers;
384
649
  });
650
+ /**
651
+ * - getRoles is a wrapper function on an existing native function also known as getRoles the returns
652
+ * array of all present roles which is of type {@link HMSRole}
653
+ *
654
+ * @memberof HMSSDK
655
+ * @return Promise<HMSRole[]>
656
+ */
385
657
  _defineProperty(this, "getRoles", async () => {
386
658
  logger === null || logger === void 0 ? void 0 : logger.verbose('#Function getRoles', {
387
659
  id: this.id
@@ -392,6 +664,13 @@ export class HMSSDK {
392
664
  const encodedRoles = HMSEncoder.encodeHmsRoles(roles);
393
665
  return encodedRoles;
394
666
  });
667
+ /**
668
+ * - This function sets the volume of any peer in the room
669
+ *
670
+ * checkout {@link https://www.100ms.live/docs/react-native/v2/advanced-features/set-volume} for more info
671
+ *
672
+ * @memberof HMSSDK
673
+ */
395
674
  _defineProperty(this, "setVolume", (track, volume) => {
396
675
  logger === null || logger === void 0 ? void 0 : logger.verbose('#Function setVolume', {
397
676
  track,
@@ -412,6 +691,13 @@ export class HMSSDK {
412
691
  id: this.id
413
692
  });
414
693
  });
694
+ /**
695
+ * - This is a temporary solution for the situation when mic access is taken from the app and
696
+ * user returns to the app with no mic access. It will re-acquire the mic by setting the volume
697
+ * from native side
698
+ *
699
+ * @memberof HMSSDK
700
+ */
415
701
  _defineProperty(this, "addAppStateListener", () => {
416
702
  logger === null || logger === void 0 ? void 0 : logger.verbose('#Function addAppStateListener', {
417
703
  id: this.id
@@ -422,6 +708,13 @@ export class HMSSDK {
422
708
  }
423
709
  });
424
710
  });
711
+ /**
712
+ * - This function is used to start screenshare, currently available only for android
713
+ *
714
+ * checkout {@link https://www.100ms.live/docs/react-native/v2/features/screenshare} for more info
715
+ *
716
+ * @memberof HMSSDK
717
+ */
425
718
  _defineProperty(this, "startScreenshare", async () => {
426
719
  logger === null || logger === void 0 ? void 0 : logger.verbose('#Function startScreenshare', {
427
720
  id: this.id
@@ -430,6 +723,13 @@ export class HMSSDK {
430
723
  id: this.id
431
724
  });
432
725
  });
726
+ /**
727
+ * - Returns a boolean stating if the screen is currently shared or not
728
+ *
729
+ * checkout {@link https://www.100ms.live/docs/react-native/v2/features/screenshare} for more info
730
+ *
731
+ * @memberof HMSSDK
732
+ */
433
733
  _defineProperty(this, "isScreenShared", async () => {
434
734
  logger === null || logger === void 0 ? void 0 : logger.verbose('#Function isScreenShared', {
435
735
  id: this.id
@@ -438,6 +738,13 @@ export class HMSSDK {
438
738
  id: this.id
439
739
  });
440
740
  });
741
+ /**
742
+ * - stops the screenShare, currently available for android only.
743
+ *
744
+ * checkout {@link https://www.100ms.live/docs/react-native/v2/features/screenshare} for more info
745
+ *
746
+ * @memberof HMSSDK
747
+ */
441
748
  _defineProperty(this, "stopScreenshare", async () => {
442
749
  logger === null || logger === void 0 ? void 0 : logger.verbose('#Function stopScreenshare', {
443
750
  id: this.id
@@ -446,6 +753,18 @@ export class HMSSDK {
446
753
  id: this.id
447
754
  });
448
755
  });
756
+ /**
757
+ * - enableRTCStats sets a boolean in native side which in turn allows several events to be passed
758
+ * through the bridge these events are {@link RTCStatsListener}, {@link onRemoteVideoStatsListener},
759
+ * {@link onRemoteAudioStatsListener}, {@link onLocalAudioStatsListener} and {@link onLocalVideoStatsListener}
760
+ *
761
+ * - These listeners get various dataPoints for current peers and their connectivity to the room
762
+ * such as jitter, latency etc.
763
+ *
764
+ * - currently available for iOS only
765
+ *
766
+ * @memberof HMSSDK
767
+ */
449
768
  _defineProperty(this, "enableRTCStats", () => {
450
769
  logger === null || logger === void 0 ? void 0 : logger.verbose('#Function enableRTCStats', {
451
770
  id: this.id
@@ -454,6 +773,14 @@ export class HMSSDK {
454
773
  id: this.id
455
774
  });
456
775
  });
776
+ /**
777
+ * - disable RTCStats sets the same boolean to false that was set true by enableRTCStats.
778
+ * that activates a check which filters out the events acquired in native listeners and don't
779
+ * let them pass through bridge
780
+ *
781
+ * - currently available for iOS only.
782
+ * @memberof HMSSDK
783
+ */
457
784
  _defineProperty(this, "disableRTCStats", () => {
458
785
  logger === null || logger === void 0 ? void 0 : logger.verbose('#Function disableRTCStats', {
459
786
  id: this.id
@@ -478,6 +805,14 @@ export class HMSSDK {
478
805
  id: this.id
479
806
  });
480
807
  });
808
+ /**
809
+ * - This wrapper function is used to start streaming device audio, currently available only for android.
810
+ *
811
+ * checkout {@link https://www.100ms.live/docs/react-native/v2/features/audio-share#how-to-stream-device-audio-from-the-app} for more info.
812
+ *
813
+ * @param {HMSAudioMixingMode}
814
+ * @memberof HMSSDK
815
+ */
481
816
  _defineProperty(this, "startAudioshare", async audioMixingMode => {
482
817
  logger === null || logger === void 0 ? void 0 : logger.verbose('#Function startAudioshare', {
483
818
  id: this.id,
@@ -493,6 +828,13 @@ export class HMSSDK {
493
828
  return 'API currently not available for iOS';
494
829
  }
495
830
  });
831
+ /**
832
+ * - This wrapper function returns true if audio is being shared and vice versa, currently available only for android.
833
+ *
834
+ * checkout {@link https://www.100ms.live/docs/react-native/v2/features/audio-share#how-to-get-audio-share-status} for more info.
835
+ *
836
+ * @memberof HMSSDK
837
+ */
496
838
  _defineProperty(this, "isAudioShared", async () => {
497
839
  logger === null || logger === void 0 ? void 0 : logger.verbose('#Function isAudioShared', {
498
840
  id: this.id
@@ -506,6 +848,13 @@ export class HMSSDK {
506
848
  return 'API currently not available for iOS';
507
849
  }
508
850
  });
851
+ /**
852
+ * - This wrapper function is used to stop streaming device audio, currently available only for android.
853
+ *
854
+ * checkout {@link https://www.100ms.live/docs/react-native/v2/features/audio-share#how-to-stop-audio-sharing} for more info.
855
+ *
856
+ * @memberof HMSSDK
857
+ */
509
858
  _defineProperty(this, "stopAudioshare", async () => {
510
859
  logger === null || logger === void 0 ? void 0 : logger.verbose('#Function stopAudioshare', {
511
860
  id: this.id
@@ -519,6 +868,12 @@ export class HMSSDK {
519
868
  return 'API currently not available for iOS';
520
869
  }
521
870
  });
871
+ /**
872
+ * - This wrapper function returns the current audio mixing mode, currently available only for android.
873
+ *
874
+ * @memberof HMSSDK
875
+ * @return HMSAudioMixingMode
876
+ */
522
877
  _defineProperty(this, "getAudioMixingMode", async () => {
523
878
  logger === null || logger === void 0 ? void 0 : logger.verbose('#Function getAudioMixingMode', {
524
879
  id: this.id
@@ -532,6 +887,14 @@ export class HMSSDK {
532
887
  return 'API currently not available for iOS';
533
888
  }
534
889
  });
890
+ /**
891
+ * - This wrapper function used to change the mode while the user is streaming audio, currently available only for android.
892
+ *
893
+ * checkout {@link https://www.100ms.live/docs/react-native/v2/features/audio-share#how-to-change-mode} for more info
894
+ *
895
+ * @param {HMSAudioMixingMode}
896
+ * @memberof HMSSDK
897
+ */
535
898
  _defineProperty(this, "setAudioMixingMode", async audioMixingMode => {
536
899
  logger === null || logger === void 0 ? void 0 : logger.verbose('#Function setAudioMixingMode', {
537
900
  id: this.id,
@@ -547,6 +910,15 @@ export class HMSSDK {
547
910
  return 'API currently not available for iOS';
548
911
  }
549
912
  });
913
+ /**
914
+ * - This wrapper function returns the array of audio output devices which is of
915
+ * type {@link HMSAudioDevice[]}, currently available only for android.
916
+ *
917
+ * checkout {@link https://www.100ms.live/docs/react-native/v2/features/audio-output-routing#get-list-of-audio-device} for more info
918
+ *
919
+ * @memberof HMSSDK
920
+ * @return HMSAudioDevice[]
921
+ */
550
922
  _defineProperty(this, "getAudioDevicesList", async () => {
551
923
  logger === null || logger === void 0 ? void 0 : logger.verbose('#Function getAudioDevicesList', {
552
924
  id: this.id
@@ -560,6 +932,15 @@ export class HMSSDK {
560
932
  return 'API currently not available for iOS';
561
933
  }
562
934
  });
935
+ /**
936
+ * - This wrapper function returns the current audio output device which is of
937
+ * type {@link HMSAudioDevice}, currently available only for android.
938
+ *
939
+ * checkout {@link https://www.100ms.live/docs/react-native/v2/features/audio-output-routing#get-current-focussed-device} for more info
940
+ *
941
+ * @memberof HMSSDK
942
+ * @return HMSAudioDevice
943
+ */
563
944
  _defineProperty(this, "getAudioOutputRouteType", async () => {
564
945
  logger === null || logger === void 0 ? void 0 : logger.verbose('#Function getAudioOutputRouteType', {
565
946
  id: this.id
@@ -573,6 +954,14 @@ export class HMSSDK {
573
954
  return 'API currently not available for iOS';
574
955
  }
575
956
  });
957
+ /**
958
+ * - This wrapper function used to switch output to device other than the default, currently available only for android.
959
+ *
960
+ * checkout {@link https://www.100ms.live/docs/react-native/v2/features/audio-output-routing#switch-audio-focus-to-another-device} for more info
961
+ *
962
+ * @param {HMSAudioDevice}
963
+ * @memberof HMSSDK
964
+ */
576
965
  _defineProperty(this, "switchAudioOutput", audioDevice => {
577
966
  logger === null || logger === void 0 ? void 0 : logger.verbose('#Function switchAudioOutput', {
578
967
  id: this.id,
@@ -588,6 +977,14 @@ export class HMSSDK {
588
977
  return 'API currently not available for iOS';
589
978
  }
590
979
  });
980
+ /**
981
+ * - This wrapper function used to change Audio Mode manually, currently available only for android.
982
+ *
983
+ * checkout {@link https://www.100ms.live/docs/react-native/v2/features/audio-mode-change} for more info
984
+ *
985
+ * @param {HMSAudioMode}
986
+ * @memberof HMSSDK
987
+ */
591
988
  _defineProperty(this, "setAudioMode", audioMode => {
592
989
  logger === null || logger === void 0 ? void 0 : logger.verbose('#Function setAudioMode', {
593
990
  id: this.id,
@@ -603,6 +1000,14 @@ export class HMSSDK {
603
1000
  return 'API currently not available for iOS';
604
1001
  }
605
1002
  });
1003
+ /**
1004
+ * - This is a wrapper function which adds a listener which is triggered when audio output device is switched, currently available only for android.
1005
+ *
1006
+ * checkout {@link https://www.100ms.live/docs/react-native/v2/features/audio-output-routing#adding-a-listener} for more info
1007
+ *
1008
+ * @param {Function}
1009
+ * @memberof HMSSDK
1010
+ */
606
1011
  _defineProperty(this, "setAudioDeviceChangeListener", callback => {
607
1012
  logger === null || logger === void 0 ? void 0 : logger.verbose('#Function setAudioDeviceChangeListener', {
608
1013
  id: this.id
@@ -635,6 +1040,13 @@ export class HMSSDK {
635
1040
  id: this.id
636
1041
  });
637
1042
  });
1043
+ /**
1044
+ * - This is a prototype event listener that takes action and listens for updates related to that particular action
1045
+ *
1046
+ * @param {string} action
1047
+ * @param {*} callback
1048
+ * @memberof HMSSDK
1049
+ */
638
1050
  _defineProperty(this, "addEventListener", (action, callback) => {
639
1051
  logger === null || logger === void 0 ? void 0 : logger.verbose('#Function addEventListener', {
640
1052
  action,
@@ -886,6 +1298,13 @@ export class HMSSDK {
886
1298
  default:
887
1299
  }
888
1300
  });
1301
+ /**
1302
+ * - This is a prototype event listener that takes action and listens for updates related to that particular action
1303
+ *
1304
+ * @param {string} action
1305
+ * @param {*} callback
1306
+ * @memberof HMSSDK
1307
+ */
889
1308
  _defineProperty(this, "removeEventListener", action => {
890
1309
  logger === null || logger === void 0 ? void 0 : logger.verbose('#Function removeEventListener', {
891
1310
  action,
@@ -1137,6 +1556,11 @@ export class HMSSDK {
1137
1556
  default:
1138
1557
  }
1139
1558
  });
1559
+ /**
1560
+ * removes all the listeners
1561
+ *
1562
+ * @memberof HMSSDK
1563
+ */
1140
1564
  _defineProperty(this, "removeAllListeners", () => {
1141
1565
  this.onPreviewDelegate = null;
1142
1566
  this.onJoinDelegate = null;
@@ -1164,6 +1588,20 @@ export class HMSSDK {
1164
1588
  id: this.id
1165
1589
  });
1166
1590
  });
1591
+ /**
1592
+ * - Below are all the listeners that are connected to native side.
1593
+ *
1594
+ * - All of the are connected when build function is called, we can connect them to the app by
1595
+ * calling {@link addEventListener} with corresponding event type.
1596
+ *
1597
+ * - Before passing the data to the eventListener of the app these listeners encode the data in
1598
+ * ts classes for a proper structuring of the data.
1599
+ *
1600
+ * - Even When event listeners of the app are disconnected using {@link removeEventListener} or
1601
+ * {@link removeAllListeners} or not even connected in first place, these functions still run to
1602
+ * maintain the current state of the instance of {@link HMSSDK}.
1603
+ *
1604
+ */
1167
1605
  _defineProperty(this, "onPreviewListener", data => {
1168
1606
  if (data.id !== this.id) {
1169
1607
  return;
@@ -1196,11 +1634,13 @@ export class HMSSDK {
1196
1634
  }
1197
1635
  });
1198
1636
  _defineProperty(this, "onRoomListener", data => {
1637
+ var _getHmsRoomCache2;
1199
1638
  if (data.id !== this.id) {
1200
1639
  return;
1201
1640
  }
1202
1641
  const room = HMSEncoder.encodeHmsRoom(data.room, this.id);
1203
1642
  const type = data.type;
1643
+ (_getHmsRoomCache2 = getHmsRoomCache()) === null || _getHmsRoomCache2 === void 0 ? void 0 : _getHmsRoomCache2.updateRoomCache(data.room, data.type);
1204
1644
  if (this.onRoomDelegate) {
1205
1645
  logger === null || logger === void 0 ? void 0 : logger.verbose('#Listener ON_ROOM_LISTENER_CALL', {
1206
1646
  room,
@@ -1212,12 +1652,22 @@ export class HMSSDK {
1212
1652
  });
1213
1653
  }
1214
1654
  });
1215
- _defineProperty(this, "onPeerListener", data => {
1216
- if (data.id !== this.id) {
1217
- return;
1655
+ _defineProperty(this, "onPeerListener", peerData => {
1656
+ var _getHmsPeersCache;
1657
+ const data = {
1658
+ peer: peerData,
1659
+ type: null
1660
+ };
1661
+ for (const ordinal of HMSPeerUpdateOrdinals.keys()) {
1662
+ if (ordinal in peerData) {
1663
+ data.peer.peerID = peerData[ordinal];
1664
+ data.type = ordinal;
1665
+ break;
1666
+ }
1218
1667
  }
1219
- const peer = HMSEncoder.encodeHmsPeer(data.peer, this.id);
1220
- const type = data.type;
1668
+ const peer = HMSEncoder.encodeHmsPeer(data.peer);
1669
+ const type = HMSEncoder.encodeHmsPeerUpdate(data.type) || data.type;
1670
+ (_getHmsPeersCache = getHmsPeersCache()) === null || _getHmsPeersCache === void 0 ? void 0 : _getHmsPeersCache.updatePeerCache(data.peer.peerID, data.peer, type);
1221
1671
  if (this.onPeerDelegate) {
1222
1672
  logger === null || logger === void 0 ? void 0 : logger.verbose('#Listener ON_PEER_LISTENER_CALL', {
1223
1673
  peer,
@@ -1230,12 +1680,16 @@ export class HMSSDK {
1230
1680
  }
1231
1681
  });
1232
1682
  _defineProperty(this, "onTrackListener", data => {
1683
+ var _getHmsPeersCache2;
1233
1684
  if (data.id !== this.id) {
1234
1685
  return;
1235
1686
  }
1236
1687
  const track = HMSEncoder.encodeHmsTrack(data.track, this.id);
1237
- const peer = HMSEncoder.encodeHmsPeer(data.peer, this.id);
1688
+ const peer = HMSEncoder.encodeHmsPeer(data.peer);
1238
1689
  const type = data.type;
1690
+ (_getHmsPeersCache2 = getHmsPeersCache()) === null || _getHmsPeersCache2 === void 0 ? void 0 : _getHmsPeersCache2.updatePeerCache(data.peer.peerID, {
1691
+ track
1692
+ }, data.type);
1239
1693
  if (this.muteStatus && (data === null || data === void 0 ? void 0 : data.type) === 'TRACK_ADDED' && track.type === HMSTrackType.AUDIO) {
1240
1694
  this.setPlaybackForAllAudio(this.muteStatus);
1241
1695
  }
@@ -1256,7 +1710,7 @@ export class HMSSDK {
1256
1710
  if (data.id !== this.id) {
1257
1711
  return;
1258
1712
  }
1259
- const message = HMSEncoder.encodeHMSMessage(data, this.id);
1713
+ const message = HMSEncoder.encodeHMSMessage(data);
1260
1714
  if (this.onMessageDelegate) {
1261
1715
  logger === null || logger === void 0 ? void 0 : logger.verbose('#Listener ON_MESSAGE_LISTENER_CALL', message);
1262
1716
  this.onMessageDelegate(message);
@@ -1286,7 +1740,7 @@ export class HMSSDK {
1286
1740
  return;
1287
1741
  }
1288
1742
  if (this.onRoleChangeRequestDelegate) {
1289
- const encodedRoleChangeRequest = HMSEncoder.encodeHmsRoleChangeRequest(data, this.id);
1743
+ const encodedRoleChangeRequest = HMSEncoder.encodeHmsRoleChangeRequest(data);
1290
1744
  logger === null || logger === void 0 ? void 0 : logger.verbose('#Listener ON_ROLE_CHANGE_LISTENER_CALL', encodedRoleChangeRequest);
1291
1745
  this.onRoleChangeRequestDelegate(encodedRoleChangeRequest);
1292
1746
  }
@@ -1296,7 +1750,7 @@ export class HMSSDK {
1296
1750
  return;
1297
1751
  }
1298
1752
  if (this.onChangeTrackStateRequestDelegate) {
1299
- const encodedRoleChangeRequest = HMSEncoder.encodeHmsChangeTrackStateRequest(data, this.id);
1753
+ const encodedRoleChangeRequest = HMSEncoder.encodeHmsChangeTrackStateRequest(data);
1300
1754
  logger === null || logger === void 0 ? void 0 : logger.verbose('#Listener ON_CHANGE_TRACK_STATE_REQUEST_LISTENER_CALL', encodedRoleChangeRequest);
1301
1755
  this.onChangeTrackStateRequestDelegate(encodedRoleChangeRequest);
1302
1756
  }
@@ -1309,7 +1763,7 @@ export class HMSSDK {
1309
1763
  if (this.onRemovedFromRoomDelegate) {
1310
1764
  let requestedBy = null;
1311
1765
  if (data.requestedBy) {
1312
- requestedBy = HMSEncoder.encodeHmsPeer(data.requestedBy, this.id);
1766
+ requestedBy = HMSEncoder.encodeHmsPeer(data.requestedBy);
1313
1767
  }
1314
1768
  const reason = data.reason;
1315
1769
  const roomEnded = data.roomEnded;
@@ -1363,7 +1817,7 @@ export class HMSSDK {
1363
1817
  return;
1364
1818
  }
1365
1819
  let localAudioStats = new HMSLocalAudioStats(data.localAudioStats);
1366
- let peer = HMSEncoder.encodeHmsPeer(data.peer, this.id);
1820
+ let peer = HMSEncoder.encodeHmsPeer(data.peer);
1367
1821
  let track = HMSEncoder.encodeHmsLocalAudioTrack(data.track, this.id);
1368
1822
  if (this.onLocalAudioStatsDelegate) {
1369
1823
  logger === null || logger === void 0 ? void 0 : logger.verbose('#Listener onLocalAudioStatsListener_CALL', {
@@ -1385,7 +1839,7 @@ export class HMSSDK {
1385
1839
  return;
1386
1840
  }
1387
1841
  let localVideoStats = new HMSLocalVideoStats(data.localVideoStats);
1388
- let peer = HMSEncoder.encodeHmsPeer(data.peer, this.id);
1842
+ let peer = HMSEncoder.encodeHmsPeer(data.peer);
1389
1843
  let track = HMSEncoder.encodeHmsLocalVideoTrack(data.track, this.id);
1390
1844
  if (this.onLocalVideoStatsDelegate) {
1391
1845
  logger === null || logger === void 0 ? void 0 : logger.verbose('#Listener onLocalVideoStatsListener_CALL', {
@@ -1407,7 +1861,7 @@ export class HMSSDK {
1407
1861
  return;
1408
1862
  }
1409
1863
  let remoteAudioStats = new HMSRemoteAudioStats(data.remoteAudioStats);
1410
- let peer = HMSEncoder.encodeHmsPeer(data.peer, this.id);
1864
+ let peer = HMSEncoder.encodeHmsPeer(data.peer);
1411
1865
  let track = HMSEncoder.encodeHmsRemoteAudioTrack(data.track, this.id);
1412
1866
  if (this.onRemoteAudioStatsDelegate) {
1413
1867
  logger === null || logger === void 0 ? void 0 : logger.verbose('#Listener onRemoteAudioStatsListener_CALL', {
@@ -1429,7 +1883,7 @@ export class HMSSDK {
1429
1883
  return;
1430
1884
  }
1431
1885
  let remoteVideoStats = new HMSRemoteVideoStats(data.remoteVideoStats);
1432
- let peer = HMSEncoder.encodeHmsPeer(data.peer, this.id);
1886
+ let peer = HMSEncoder.encodeHmsPeer(data.peer);
1433
1887
  let track = HMSEncoder.encodeHmsRemoteVideoTrack(data.track, this.id);
1434
1888
  if (this.onRemoteVideoStatsDelegate) {
1435
1889
  logger === null || logger === void 0 ? void 0 : logger.verbose('#Listener onRemoteVideoStatsListener_CALL', {
@@ -1522,13 +1976,6 @@ export class HMSSDK {
1522
1976
  static getLogger() {
1523
1977
  return getLogger();
1524
1978
  }
1525
-
1526
- /**
1527
- * - Updates the logger for this instance of HMSSDK
1528
- * @param {HMSLogger} hmsLogger
1529
- * @memberof HMSSDK
1530
- */
1531
-
1532
1979
  async isPipModeSupported() {
1533
1980
  return HMSManager.handlePipActions('isPipModeSupported', {
1534
1981
  id: this.id