@100mslive/react-native-hms 1.1.1 → 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 (312) hide show
  1. package/README.md +145 -340
  2. package/android/build.gradle +1 -1
  3. package/android/src/main/java/com/reactnativehmssdk/HMSDecoder.kt +292 -94
  4. package/android/src/main/java/com/reactnativehmssdk/HMSHelper.kt +127 -127
  5. package/android/src/main/java/com/reactnativehmssdk/HMSManager.kt +167 -115
  6. package/android/src/main/java/com/reactnativehmssdk/HMSRNSDK.kt +283 -45
  7. package/android/src/main/java/com/reactnativehmssdk/HMSSDKViewManager.kt +7 -7
  8. package/ios/HMSDecoder.swift +276 -137
  9. package/ios/HMSHelper.swift +3 -3
  10. package/ios/HMSManager.m +7 -0
  11. package/ios/HMSManager.swift +37 -2
  12. package/ios/HMSRNSDK.swift +339 -97
  13. package/ios/HMSView.m +2 -0
  14. package/ios/HMSView.swift +35 -3
  15. package/ios/Hmssdk.xcodeproj/project.xcworkspace/xcuserdata/yogesh.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
  16. package/lib/commonjs/classes/HMSAudioCodec.js +4 -4
  17. package/lib/commonjs/classes/HMSAudioCodec.js.map +1 -1
  18. package/lib/commonjs/classes/HMSAudioDevice.js +4 -4
  19. package/lib/commonjs/classes/HMSAudioDevice.js.map +1 -1
  20. package/lib/commonjs/classes/HMSAudioFilePlayerNode.js.map +1 -1
  21. package/lib/commonjs/classes/HMSAudioMixerSource.js.map +1 -1
  22. package/lib/commonjs/classes/HMSAudioMixingMode.js +4 -4
  23. package/lib/commonjs/classes/HMSAudioMixingMode.js.map +1 -1
  24. package/lib/commonjs/classes/HMSAudioMode.js +4 -4
  25. package/lib/commonjs/classes/HMSAudioMode.js.map +1 -1
  26. package/lib/commonjs/classes/HMSAudioNode.js +2 -1
  27. package/lib/commonjs/classes/HMSAudioNode.js.map +1 -1
  28. package/lib/commonjs/classes/HMSAudioSettings.js.map +1 -1
  29. package/lib/commonjs/classes/HMSAudioTrack.js.map +1 -1
  30. package/lib/commonjs/classes/HMSAudioTrackSettings.js.map +1 -1
  31. package/lib/commonjs/classes/HMSBrowserRecordingState.js.map +1 -1
  32. package/lib/commonjs/classes/HMSCameraFacing.js +4 -4
  33. package/lib/commonjs/classes/HMSCameraFacing.js.map +1 -1
  34. package/lib/commonjs/classes/HMSChangeTrackStateRequest.js.map +1 -1
  35. package/lib/commonjs/classes/HMSConfig.js.map +1 -1
  36. package/lib/commonjs/classes/HMSConstants.js +11 -0
  37. package/lib/commonjs/classes/HMSConstants.js.map +1 -0
  38. package/lib/commonjs/classes/HMSEncoder.js +129 -102
  39. package/lib/commonjs/classes/HMSEncoder.js.map +1 -1
  40. package/lib/commonjs/classes/HMSException.js.map +1 -1
  41. package/lib/commonjs/classes/HMSHLSConfig.js.map +1 -1
  42. package/lib/commonjs/classes/HMSHLSMeetingURLVariant.js.map +1 -1
  43. package/lib/commonjs/classes/HMSHLSRecordingConfig.js.map +1 -1
  44. package/lib/commonjs/classes/HMSHLSRecordingState.js.map +1 -1
  45. package/lib/commonjs/classes/HMSHLSStreamingState.js.map +1 -1
  46. package/lib/commonjs/classes/HMSHLSVariant.js.map +1 -1
  47. package/lib/commonjs/classes/HMSHelper.js.map +1 -1
  48. package/lib/commonjs/classes/HMSLocalAudioStats.js.map +1 -1
  49. package/lib/commonjs/classes/HMSLocalAudioTrack.js.map +1 -1
  50. package/lib/commonjs/classes/HMSLocalPeer.js +0 -1
  51. package/lib/commonjs/classes/HMSLocalPeer.js.map +1 -1
  52. package/lib/commonjs/classes/HMSLocalVideoStats.js.map +1 -1
  53. package/lib/commonjs/classes/HMSLocalVideoTrack.js +0 -2
  54. package/lib/commonjs/classes/HMSLocalVideoTrack.js.map +1 -1
  55. package/lib/commonjs/classes/HMSLogAlarmManager.js +4 -4
  56. package/lib/commonjs/classes/HMSLogAlarmManager.js.map +1 -1
  57. package/lib/commonjs/classes/HMSLogLevel.js +4 -4
  58. package/lib/commonjs/classes/HMSLogLevel.js.map +1 -1
  59. package/lib/commonjs/classes/HMSLogSettings.js.map +1 -1
  60. package/lib/commonjs/classes/HMSLogger.js +17 -25
  61. package/lib/commonjs/classes/HMSLogger.js.map +1 -1
  62. package/lib/commonjs/classes/HMSMessage.js.map +1 -1
  63. package/lib/commonjs/classes/HMSMessageRecipient.js +1 -1
  64. package/lib/commonjs/classes/HMSMessageRecipient.js.map +1 -1
  65. package/lib/commonjs/classes/HMSMessageRecipientType.js +4 -4
  66. package/lib/commonjs/classes/HMSMessageRecipientType.js.map +1 -1
  67. package/lib/commonjs/classes/HMSMessageType.js +4 -4
  68. package/lib/commonjs/classes/HMSMessageType.js.map +1 -1
  69. package/lib/commonjs/classes/HMSMicNode.js.map +1 -1
  70. package/lib/commonjs/classes/HMSNativeEventEmitter.js +101 -0
  71. package/lib/commonjs/classes/HMSNativeEventEmitter.js.map +1 -0
  72. package/lib/commonjs/classes/HMSNetworkQuality.js.map +1 -1
  73. package/lib/commonjs/classes/HMSPIPListenerActions.js +4 -4
  74. package/lib/commonjs/classes/HMSPIPListenerActions.js.map +1 -1
  75. package/lib/commonjs/classes/HMSPeer.js +69 -18
  76. package/lib/commonjs/classes/HMSPeer.js.map +1 -1
  77. package/lib/commonjs/classes/HMSPeerUpdate.js +7 -5
  78. package/lib/commonjs/classes/HMSPeerUpdate.js.map +1 -1
  79. package/lib/commonjs/classes/HMSPeersCache.js +229 -0
  80. package/lib/commonjs/classes/HMSPeersCache.js.map +1 -0
  81. package/lib/commonjs/classes/HMSPermissions.js.map +1 -1
  82. package/lib/commonjs/classes/HMSPublishSettings.js +0 -6
  83. package/lib/commonjs/classes/HMSPublishSettings.js.map +1 -1
  84. package/lib/commonjs/classes/HMSRTCStats.js.map +1 -1
  85. package/lib/commonjs/classes/HMSRTCStatsReport.js.map +1 -1
  86. package/lib/commonjs/classes/HMSRTMPConfig.js.map +1 -1
  87. package/lib/commonjs/classes/HMSRemoteAudioStats.js.map +1 -1
  88. package/lib/commonjs/classes/HMSRemoteAudioTrack.js.map +1 -1
  89. package/lib/commonjs/classes/HMSRemotePeer.js +0 -1
  90. package/lib/commonjs/classes/HMSRemotePeer.js.map +1 -1
  91. package/lib/commonjs/classes/HMSRemoteVideoStats.js.map +1 -1
  92. package/lib/commonjs/classes/HMSRemoteVideoTrack.js.map +1 -1
  93. package/lib/commonjs/classes/HMSRole.js +0 -6
  94. package/lib/commonjs/classes/HMSRole.js.map +1 -1
  95. package/lib/commonjs/classes/HMSRoleChangeRequest.js +3 -1
  96. package/lib/commonjs/classes/HMSRoleChangeRequest.js.map +1 -1
  97. package/lib/commonjs/classes/HMSRoom.js +79 -22
  98. package/lib/commonjs/classes/HMSRoom.js.map +1 -1
  99. package/lib/commonjs/classes/HMSRoomCache.js +128 -0
  100. package/lib/commonjs/classes/HMSRoomCache.js.map +1 -0
  101. package/lib/commonjs/classes/HMSRoomUpdate.js +4 -4
  102. package/lib/commonjs/classes/HMSRoomUpdate.js.map +1 -1
  103. package/lib/commonjs/classes/HMSRtmpStreamingState.js.map +1 -1
  104. package/lib/commonjs/classes/HMSRtmpVideoResolution.js.map +1 -1
  105. package/lib/commonjs/classes/HMSSDK.js +933 -158
  106. package/lib/commonjs/classes/HMSSDK.js.map +1 -1
  107. package/lib/commonjs/classes/HMSScreenBroadcastAudioReceiverNode.js.map +1 -1
  108. package/lib/commonjs/classes/HMSServerRecordingState.js.map +1 -1
  109. package/lib/commonjs/classes/HMSSimulcastLayerSettings.js.map +1 -1
  110. package/lib/commonjs/classes/HMSSimulcastSettings.js.map +1 -1
  111. package/lib/commonjs/classes/HMSSpeaker.js.map +1 -1
  112. package/lib/commonjs/classes/HMSSubscribeSettings.js +0 -2
  113. package/lib/commonjs/classes/HMSSubscribeSettings.js.map +1 -1
  114. package/lib/commonjs/classes/HMSTrack.js.map +1 -1
  115. package/lib/commonjs/classes/HMSTrackSettings.js.map +1 -1
  116. package/lib/commonjs/classes/HMSTrackSettingsInitState.js +4 -4
  117. package/lib/commonjs/classes/HMSTrackSettingsInitState.js.map +1 -1
  118. package/lib/commonjs/classes/HMSTrackSource.js +4 -4
  119. package/lib/commonjs/classes/HMSTrackSource.js.map +1 -1
  120. package/lib/commonjs/classes/HMSTrackType.js +4 -4
  121. package/lib/commonjs/classes/HMSTrackType.js.map +1 -1
  122. package/lib/commonjs/classes/HMSTrackUpdate.js +4 -4
  123. package/lib/commonjs/classes/HMSTrackUpdate.js.map +1 -1
  124. package/lib/commonjs/classes/HMSUpdateListenerActions.js +5 -5
  125. package/lib/commonjs/classes/HMSUpdateListenerActions.js.map +1 -1
  126. package/lib/commonjs/classes/HMSVideoCodec.js +4 -4
  127. package/lib/commonjs/classes/HMSVideoCodec.js.map +1 -1
  128. package/lib/commonjs/classes/HMSVideoResolution.js.map +1 -1
  129. package/lib/commonjs/classes/HMSVideoSettings.js.map +1 -1
  130. package/lib/commonjs/classes/HMSVideoTrack.js.map +1 -1
  131. package/lib/commonjs/classes/HMSVideoTrackSettings.js.map +1 -1
  132. package/lib/commonjs/classes/HMSVideoViewMode.js +4 -4
  133. package/lib/commonjs/classes/HMSVideoViewMode.js.map +1 -1
  134. package/lib/commonjs/classes/HmsView.js +2 -1
  135. package/lib/commonjs/classes/HmsView.js.map +1 -1
  136. package/lib/commonjs/index.js.map +1 -1
  137. package/lib/module/classes/HMSAudioCodec.js +3 -3
  138. package/lib/module/classes/HMSAudioCodec.js.map +1 -1
  139. package/lib/module/classes/HMSAudioDevice.js +3 -3
  140. package/lib/module/classes/HMSAudioDevice.js.map +1 -1
  141. package/lib/module/classes/HMSAudioFilePlayerNode.js.map +1 -1
  142. package/lib/module/classes/HMSAudioMixerSource.js.map +1 -1
  143. package/lib/module/classes/HMSAudioMixingMode.js +3 -3
  144. package/lib/module/classes/HMSAudioMixingMode.js.map +1 -1
  145. package/lib/module/classes/HMSAudioMode.js +3 -3
  146. package/lib/module/classes/HMSAudioMode.js.map +1 -1
  147. package/lib/module/classes/HMSAudioNode.js +2 -1
  148. package/lib/module/classes/HMSAudioNode.js.map +1 -1
  149. package/lib/module/classes/HMSAudioSettings.js.map +1 -1
  150. package/lib/module/classes/HMSAudioTrack.js.map +1 -1
  151. package/lib/module/classes/HMSAudioTrackSettings.js.map +1 -1
  152. package/lib/module/classes/HMSBrowserRecordingState.js.map +1 -1
  153. package/lib/module/classes/HMSCameraFacing.js +3 -3
  154. package/lib/module/classes/HMSCameraFacing.js.map +1 -1
  155. package/lib/module/classes/HMSChangeTrackStateRequest.js.map +1 -1
  156. package/lib/module/classes/HMSConfig.js.map +1 -1
  157. package/lib/module/classes/HMSConstants.js +4 -0
  158. package/lib/module/classes/HMSConstants.js.map +1 -0
  159. package/lib/module/classes/HMSEncoder.js +129 -102
  160. package/lib/module/classes/HMSEncoder.js.map +1 -1
  161. package/lib/module/classes/HMSException.js.map +1 -1
  162. package/lib/module/classes/HMSHLSConfig.js.map +1 -1
  163. package/lib/module/classes/HMSHLSMeetingURLVariant.js.map +1 -1
  164. package/lib/module/classes/HMSHLSRecordingConfig.js.map +1 -1
  165. package/lib/module/classes/HMSHLSRecordingState.js.map +1 -1
  166. package/lib/module/classes/HMSHLSStreamingState.js.map +1 -1
  167. package/lib/module/classes/HMSHLSVariant.js.map +1 -1
  168. package/lib/module/classes/HMSHelper.js.map +1 -1
  169. package/lib/module/classes/HMSLocalAudioStats.js.map +1 -1
  170. package/lib/module/classes/HMSLocalAudioTrack.js.map +1 -1
  171. package/lib/module/classes/HMSLocalPeer.js +0 -1
  172. package/lib/module/classes/HMSLocalPeer.js.map +1 -1
  173. package/lib/module/classes/HMSLocalVideoStats.js.map +1 -1
  174. package/lib/module/classes/HMSLocalVideoTrack.js +0 -2
  175. package/lib/module/classes/HMSLocalVideoTrack.js.map +1 -1
  176. package/lib/module/classes/HMSLogAlarmManager.js +3 -3
  177. package/lib/module/classes/HMSLogAlarmManager.js.map +1 -1
  178. package/lib/module/classes/HMSLogLevel.js +3 -3
  179. package/lib/module/classes/HMSLogLevel.js.map +1 -1
  180. package/lib/module/classes/HMSLogSettings.js.map +1 -1
  181. package/lib/module/classes/HMSLogger.js +17 -25
  182. package/lib/module/classes/HMSLogger.js.map +1 -1
  183. package/lib/module/classes/HMSMessage.js.map +1 -1
  184. package/lib/module/classes/HMSMessageRecipient.js +1 -1
  185. package/lib/module/classes/HMSMessageRecipient.js.map +1 -1
  186. package/lib/module/classes/HMSMessageRecipientType.js +3 -3
  187. package/lib/module/classes/HMSMessageRecipientType.js.map +1 -1
  188. package/lib/module/classes/HMSMessageType.js +3 -3
  189. package/lib/module/classes/HMSMessageType.js.map +1 -1
  190. package/lib/module/classes/HMSMicNode.js.map +1 -1
  191. package/lib/module/classes/HMSNativeEventEmitter.js +94 -0
  192. package/lib/module/classes/HMSNativeEventEmitter.js.map +1 -0
  193. package/lib/module/classes/HMSNetworkQuality.js.map +1 -1
  194. package/lib/module/classes/HMSPIPListenerActions.js +3 -3
  195. package/lib/module/classes/HMSPIPListenerActions.js.map +1 -1
  196. package/lib/module/classes/HMSPeer.js +69 -18
  197. package/lib/module/classes/HMSPeer.js.map +1 -1
  198. package/lib/module/classes/HMSPeerUpdate.js +4 -3
  199. package/lib/module/classes/HMSPeerUpdate.js.map +1 -1
  200. package/lib/module/classes/HMSPeersCache.js +216 -0
  201. package/lib/module/classes/HMSPeersCache.js.map +1 -0
  202. package/lib/module/classes/HMSPermissions.js.map +1 -1
  203. package/lib/module/classes/HMSPublishSettings.js +0 -6
  204. package/lib/module/classes/HMSPublishSettings.js.map +1 -1
  205. package/lib/module/classes/HMSRTCStats.js.map +1 -1
  206. package/lib/module/classes/HMSRTCStatsReport.js.map +1 -1
  207. package/lib/module/classes/HMSRTMPConfig.js.map +1 -1
  208. package/lib/module/classes/HMSRemoteAudioStats.js.map +1 -1
  209. package/lib/module/classes/HMSRemoteAudioTrack.js.map +1 -1
  210. package/lib/module/classes/HMSRemotePeer.js +0 -1
  211. package/lib/module/classes/HMSRemotePeer.js.map +1 -1
  212. package/lib/module/classes/HMSRemoteVideoStats.js.map +1 -1
  213. package/lib/module/classes/HMSRemoteVideoTrack.js.map +1 -1
  214. package/lib/module/classes/HMSRole.js +0 -6
  215. package/lib/module/classes/HMSRole.js.map +1 -1
  216. package/lib/module/classes/HMSRoleChangeRequest.js +3 -1
  217. package/lib/module/classes/HMSRoleChangeRequest.js.map +1 -1
  218. package/lib/module/classes/HMSRoom.js +79 -22
  219. package/lib/module/classes/HMSRoom.js.map +1 -1
  220. package/lib/module/classes/HMSRoomCache.js +115 -0
  221. package/lib/module/classes/HMSRoomCache.js.map +1 -0
  222. package/lib/module/classes/HMSRoomUpdate.js +3 -3
  223. package/lib/module/classes/HMSRoomUpdate.js.map +1 -1
  224. package/lib/module/classes/HMSRtmpStreamingState.js.map +1 -1
  225. package/lib/module/classes/HMSRtmpVideoResolution.js.map +1 -1
  226. package/lib/module/classes/HMSSDK.js +934 -159
  227. package/lib/module/classes/HMSSDK.js.map +1 -1
  228. package/lib/module/classes/HMSScreenBroadcastAudioReceiverNode.js.map +1 -1
  229. package/lib/module/classes/HMSServerRecordingState.js.map +1 -1
  230. package/lib/module/classes/HMSSimulcastLayerSettings.js.map +1 -1
  231. package/lib/module/classes/HMSSimulcastSettings.js.map +1 -1
  232. package/lib/module/classes/HMSSpeaker.js.map +1 -1
  233. package/lib/module/classes/HMSSubscribeSettings.js +0 -2
  234. package/lib/module/classes/HMSSubscribeSettings.js.map +1 -1
  235. package/lib/module/classes/HMSTrack.js.map +1 -1
  236. package/lib/module/classes/HMSTrackSettings.js.map +1 -1
  237. package/lib/module/classes/HMSTrackSettingsInitState.js +3 -3
  238. package/lib/module/classes/HMSTrackSettingsInitState.js.map +1 -1
  239. package/lib/module/classes/HMSTrackSource.js +3 -3
  240. package/lib/module/classes/HMSTrackSource.js.map +1 -1
  241. package/lib/module/classes/HMSTrackType.js +3 -3
  242. package/lib/module/classes/HMSTrackType.js.map +1 -1
  243. package/lib/module/classes/HMSTrackUpdate.js +3 -3
  244. package/lib/module/classes/HMSTrackUpdate.js.map +1 -1
  245. package/lib/module/classes/HMSUpdateListenerActions.js +4 -4
  246. package/lib/module/classes/HMSUpdateListenerActions.js.map +1 -1
  247. package/lib/module/classes/HMSVideoCodec.js +3 -3
  248. package/lib/module/classes/HMSVideoCodec.js.map +1 -1
  249. package/lib/module/classes/HMSVideoResolution.js.map +1 -1
  250. package/lib/module/classes/HMSVideoSettings.js.map +1 -1
  251. package/lib/module/classes/HMSVideoTrack.js.map +1 -1
  252. package/lib/module/classes/HMSVideoTrackSettings.js.map +1 -1
  253. package/lib/module/classes/HMSVideoViewMode.js +3 -3
  254. package/lib/module/classes/HMSVideoViewMode.js.map +1 -1
  255. package/lib/module/classes/HmsView.js +2 -1
  256. package/lib/module/classes/HmsView.js.map +1 -1
  257. package/lib/module/index.js.map +1 -1
  258. package/lib/typescript/classes/HMSBrowserRecordingState.d.ts +4 -4
  259. package/lib/typescript/classes/HMSChangeTrackStateRequest.d.ts +2 -2
  260. package/lib/typescript/classes/HMSConstants.d.ts +3 -0
  261. package/lib/typescript/classes/HMSEncoder.d.ts +10 -6
  262. package/lib/typescript/classes/HMSHLSStreamingState.d.ts +2 -2
  263. package/lib/typescript/classes/HMSLocalPeer.d.ts +0 -14
  264. package/lib/typescript/classes/HMSLocalVideoTrack.d.ts +0 -2
  265. package/lib/typescript/classes/HMSLogger.d.ts +1 -7
  266. package/lib/typescript/classes/HMSMessageRecipient.d.ts +2 -2
  267. package/lib/typescript/classes/HMSNativeEventEmitter.d.ts +13 -0
  268. package/lib/typescript/classes/HMSPeer.d.ts +12 -18
  269. package/lib/typescript/classes/HMSPeerUpdate.d.ts +1 -0
  270. package/lib/typescript/classes/HMSPeersCache.d.ts +17 -0
  271. package/lib/typescript/classes/HMSPublishSettings.d.ts +8 -15
  272. package/lib/typescript/classes/HMSRemotePeer.d.ts +0 -14
  273. package/lib/typescript/classes/HMSRole.d.ts +0 -6
  274. package/lib/typescript/classes/HMSRoleChangeRequest.d.ts +2 -2
  275. package/lib/typescript/classes/HMSRoom.d.ts +11 -22
  276. package/lib/typescript/classes/HMSRoomCache.d.ts +16 -0
  277. package/lib/typescript/classes/HMSRtmpStreamingState.d.ts +4 -4
  278. package/lib/typescript/classes/HMSSDK.d.ts +3 -13
  279. package/lib/typescript/classes/HMSServerRecordingState.d.ts +2 -2
  280. package/lib/typescript/classes/HMSSubscribeSettings.d.ts +0 -2
  281. package/lib/typescript/classes/HMSUpdateListenerActions.d.ts +1 -1
  282. package/lib/typescript/index.d.ts +1 -0
  283. package/package.json +5 -4
  284. package/react-native-hms.podspec +1 -1
  285. package/sdk-versions.json +3 -2
  286. package/src/classes/HMSAudioNode.ts +3 -1
  287. package/src/classes/HMSBrowserRecordingState.ts +4 -4
  288. package/src/classes/HMSChangeTrackStateRequest.ts +2 -2
  289. package/src/classes/HMSConstants.ts +3 -0
  290. package/src/classes/HMSEncoder.ts +162 -120
  291. package/src/classes/HMSHLSStreamingState.ts +2 -2
  292. package/src/classes/HMSLocalPeer.ts +0 -15
  293. package/src/classes/HMSLocalVideoTrack.ts +0 -2
  294. package/src/classes/HMSLogger.ts +20 -19
  295. package/src/classes/HMSMessageRecipient.ts +3 -3
  296. package/src/classes/HMSNativeEventEmitter.ts +109 -0
  297. package/src/classes/HMSPeer.ts +135 -32
  298. package/src/classes/HMSPeerUpdate.ts +9 -0
  299. package/src/classes/HMSPeersCache.ts +252 -0
  300. package/src/classes/HMSPublishSettings.ts +8 -18
  301. package/src/classes/HMSRemotePeer.ts +0 -16
  302. package/src/classes/HMSRole.ts +0 -9
  303. package/src/classes/HMSRoleChangeRequest.ts +5 -3
  304. package/src/classes/HMSRoom.ts +141 -37
  305. package/src/classes/HMSRoomCache.ts +157 -0
  306. package/src/classes/HMSRtmpStreamingState.ts +4 -4
  307. package/src/classes/HMSSDK.tsx +685 -292
  308. package/src/classes/HMSServerRecordingState.ts +2 -2
  309. package/src/classes/HMSSubscribeSettings.ts +1 -7
  310. package/src/classes/HMSUpdateListenerActions.ts +1 -1
  311. package/src/classes/HmsView.tsx +2 -1
  312. package/src/index.ts +1 -0
@@ -18,6 +18,10 @@ var _HMSUpdateListenerActions = require("./HMSUpdateListenerActions");
18
18
  var _HmsView = require("./HmsView");
19
19
  var _HMSMessageType = require("./HMSMessageType");
20
20
  var _HMSPIPListenerActions = require("./HMSPIPListenerActions");
21
+ var _HMSNativeEventEmitter = require("./HMSNativeEventEmitter");
22
+ var _HMSPeersCache = require("./HMSPeersCache");
23
+ var _HMSRoomCache = require("./HMSRoomCache");
24
+ var _HMSPeerUpdate = require("./HMSPeerUpdate");
21
25
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
22
26
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
23
27
  function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
@@ -29,7 +33,7 @@ const {
29
33
  HMSManager
30
34
  } = _reactNative.NativeModules;
31
35
  const ReactNativeVersion = require('react-native/Libraries/Core/ReactNativeVersion');
32
- const HmsEventEmitter = new _reactNative.NativeEventEmitter(HMSManager);
36
+ const HmsEventEmitter = new _HMSNativeEventEmitter.HMSNativeEventEmitter(HMSManager);
33
37
  let HmsSdk;
34
38
  class HMSSDK {
35
39
  constructor(id) {
@@ -57,77 +61,62 @@ class HMSSDK {
57
61
  _defineProperty(this, "onRemoteVideoStatsDelegate", void 0);
58
62
  _defineProperty(this, "onAudioDeviceChangedDelegate", void 0);
59
63
  _defineProperty(this, "onPIPRoomLeaveDelegate", void 0);
64
+ _defineProperty(this, "emitterSubscriptions", {});
65
+ /**
66
+ * - Updates the logger for this instance of HMSSDK
67
+ * @param {HMSLogger} hmsLogger
68
+ * @memberof HMSSDK
69
+ */
60
70
  _defineProperty(this, "setLogger", hmsLogger => {
61
71
  (0, _HMSLogger.setLogger)(this.id, hmsLogger);
62
72
  });
73
+ /**
74
+ * - Calls removeListeners that in turn breaks all connections with native listeners.
75
+ *
76
+ * @memberof HMSSDK
77
+ */
63
78
  _defineProperty(this, "destroy", async () => {
64
79
  _HMSLogger.logger === null || _HMSLogger.logger === void 0 ? void 0 : _HMSLogger.logger.verbose('#Function destroy', {
65
80
  id: this.id
66
81
  });
67
- this.removeListeners();
82
+ (0, _HMSPeersCache.clearHmsPeersCache)();
83
+ (0, _HMSRoomCache.clearHmsRoomCache)();
84
+ this.removeAllListeners();
68
85
  return await HMSManager.destroy({
69
86
  id: this.id
70
87
  });
71
88
  });
72
- _defineProperty(this, "attachListeners", () => {
73
- HmsEventEmitter.addListener(_HMSUpdateListenerActions.HMSUpdateListenerActions.ON_PREVIEW, this.onPreviewListener);
74
- HmsEventEmitter.addListener(_HMSUpdateListenerActions.HMSUpdateListenerActions.ON_JOIN, this.onJoinListener);
75
- HmsEventEmitter.addListener(_HMSUpdateListenerActions.HMSUpdateListenerActions.ON_ROOM_UPDATE, this.onRoomListener);
76
- HmsEventEmitter.addListener(_HMSUpdateListenerActions.HMSUpdateListenerActions.ON_PEER_UPDATE, this.onPeerListener);
77
- HmsEventEmitter.addListener(_HMSUpdateListenerActions.HMSUpdateListenerActions.ON_TRACK_UPDATE, this.onTrackListener);
78
- HmsEventEmitter.addListener(_HMSUpdateListenerActions.HMSUpdateListenerActions.ON_ERROR, this.onErrorListener);
79
- HmsEventEmitter.addListener(_HMSUpdateListenerActions.HMSUpdateListenerActions.ON_MESSAGE, this.onMessageListener);
80
- HmsEventEmitter.addListener(_HMSUpdateListenerActions.HMSUpdateListenerActions.ON_SPEAKER, this.onSpeakerListener);
81
- HmsEventEmitter.addListener(_HMSUpdateListenerActions.HMSUpdateListenerActions.RECONNECTING, this.reconnectingListener);
82
- HmsEventEmitter.addListener(_HMSUpdateListenerActions.HMSUpdateListenerActions.RECONNECTED, this.reconnectedListener);
83
- HmsEventEmitter.addListener(_HMSUpdateListenerActions.HMSUpdateListenerActions.ON_ROLE_CHANGE_REQUEST, this.onRoleChangeRequestListener);
84
- HmsEventEmitter.addListener(_HMSUpdateListenerActions.HMSUpdateListenerActions.ON_CHANGE_TRACK_STATE_REQUEST, this.onChangeTrackStateRequestListener);
85
- HmsEventEmitter.addListener(_HMSUpdateListenerActions.HMSUpdateListenerActions.ON_REMOVED_FROM_ROOM, this.onRemovedFromRoomListener);
86
- HmsEventEmitter.addListener(_HMSUpdateListenerActions.HMSUpdateListenerActions.ON_RTC_STATS, this.RTCStatsListener);
87
- HmsEventEmitter.addListener(_HMSUpdateListenerActions.HMSUpdateListenerActions.ON_LOCAL_AUDIO_STATS, this.onLocalAudioStatsListener);
88
- HmsEventEmitter.addListener(_HMSUpdateListenerActions.HMSUpdateListenerActions.ON_LOCAL_VIDEO_STATS, this.onLocalVideoStatsListener);
89
- HmsEventEmitter.addListener(_HMSUpdateListenerActions.HMSUpdateListenerActions.ON_REMOTE_AUDIO_STATS, this.onRemoteAudioStatsListener);
90
- HmsEventEmitter.addListener(_HMSUpdateListenerActions.HMSUpdateListenerActions.ON_REMOTE_VIDEO_STATS, this.onRemoteVideoStatsListener);
91
- HmsEventEmitter.addListener(_HMSUpdateListenerActions.HMSUpdateListenerActions.ON_AUDIO_DEVICE_CHANGED, this.onAudioDeviceChangedListener);
92
- if (_reactNative.Platform.OS === 'android') {
93
- HmsEventEmitter.addListener(_HMSPIPListenerActions.HMSPIPListenerActions.ON_PIP_ROOM_LEAVE, this.onPIPRoomLeaveListener);
94
- }
95
- });
96
- _defineProperty(this, "removeListeners", () => {
97
- HmsEventEmitter.removeListener(_HMSUpdateListenerActions.HMSUpdateListenerActions.ON_JOIN, this.onJoinListener);
98
- HmsEventEmitter.removeListener(_HMSUpdateListenerActions.HMSUpdateListenerActions.ON_PREVIEW, this.onPreviewListener);
99
- HmsEventEmitter.removeListener(_HMSUpdateListenerActions.HMSUpdateListenerActions.ON_ROOM_UPDATE, this.onRoomListener);
100
- HmsEventEmitter.removeListener(_HMSUpdateListenerActions.HMSUpdateListenerActions.ON_PEER_UPDATE, this.onPeerListener);
101
- HmsEventEmitter.removeListener(_HMSUpdateListenerActions.HMSUpdateListenerActions.ON_TRACK_UPDATE, this.onTrackListener);
102
- HmsEventEmitter.removeListener(_HMSUpdateListenerActions.HMSUpdateListenerActions.ON_ERROR, this.onErrorListener);
103
- HmsEventEmitter.removeListener(_HMSUpdateListenerActions.HMSUpdateListenerActions.ON_MESSAGE, this.onMessageListener);
104
- HmsEventEmitter.removeListener(_HMSUpdateListenerActions.HMSUpdateListenerActions.ON_SPEAKER, this.onSpeakerListener);
105
- HmsEventEmitter.removeListener(_HMSUpdateListenerActions.HMSUpdateListenerActions.RECONNECTING, this.reconnectingListener);
106
- HmsEventEmitter.removeListener(_HMSUpdateListenerActions.HMSUpdateListenerActions.RECONNECTED, this.reconnectedListener);
107
- HmsEventEmitter.removeListener(_HMSUpdateListenerActions.HMSUpdateListenerActions.ON_ROLE_CHANGE_REQUEST, this.onRoleChangeRequestListener);
108
- HmsEventEmitter.removeListener(_HMSUpdateListenerActions.HMSUpdateListenerActions.ON_CHANGE_TRACK_STATE_REQUEST, this.onChangeTrackStateRequestListener);
109
- HmsEventEmitter.removeListener(_HMSUpdateListenerActions.HMSUpdateListenerActions.ON_REMOVED_FROM_ROOM, this.onRemovedFromRoomListener);
110
- HmsEventEmitter.removeListener(_HMSUpdateListenerActions.HMSUpdateListenerActions.ON_RTC_STATS, this.RTCStatsListener);
111
- HmsEventEmitter.removeListener(_HMSUpdateListenerActions.HMSUpdateListenerActions.ON_LOCAL_AUDIO_STATS, this.onLocalAudioStatsListener);
112
- HmsEventEmitter.removeListener(_HMSUpdateListenerActions.HMSUpdateListenerActions.ON_LOCAL_VIDEO_STATS, this.onLocalVideoStatsListener);
113
- HmsEventEmitter.removeListener(_HMSUpdateListenerActions.HMSUpdateListenerActions.ON_REMOTE_AUDIO_STATS, this.onRemoteAudioStatsListener);
114
- HmsEventEmitter.removeListener(_HMSUpdateListenerActions.HMSUpdateListenerActions.ON_REMOTE_VIDEO_STATS, this.onRemoteVideoStatsListener);
115
- HmsEventEmitter.removeListener(_HMSUpdateListenerActions.HMSUpdateListenerActions.ON_AUDIO_DEVICE_CHANGED, this.onAudioDeviceChangedListener);
116
- if (_reactNative.Platform.OS === 'android') {
117
- HmsEventEmitter.removeListener(_HMSPIPListenerActions.HMSPIPListenerActions.ON_PIP_ROOM_LEAVE, this.onPIPRoomLeaveListener);
118
- }
119
- });
89
+ /**
90
+ * takes an instance of [HMSConfig]{@link HMSConfig} and joins the room.
91
+ * after joining the room user will start receiving the events and updates of the room.
92
+ *
93
+ * checkout {@link https://www.100ms.live/docs/react-native/v2/features/join} for more info
94
+ *
95
+ * @param {HMSConfig} config
96
+ * @memberof HMSSDK
97
+ */
120
98
  _defineProperty(this, "join", async config => {
121
99
  _HMSLogger.logger === null || _HMSLogger.logger === void 0 ? void 0 : _HMSLogger.logger.verbose('#Function join', {
122
100
  config,
123
101
  id: this.id
124
102
  });
125
103
  this.addAppStateListener();
104
+ (0, _HMSPeersCache.setHmsPeersCache)(new _HMSPeersCache.HMSPeersCache(this.id));
105
+ (0, _HMSRoomCache.setHmsRoomCache)(new _HMSRoomCache.HMSRoomCache(this.id));
126
106
  await HMSManager.join({
127
107
  ...config,
128
108
  id: this.id
129
109
  });
130
110
  });
111
+ /**
112
+ * - preview function is used to initiate a preview for the localPeer.
113
+ * - We can call this function and wait for a response in previewListener, the response will contain previewTracks for local peer.
114
+ *
115
+ * checkout {@link https://www.100ms.live/docs/react-native/v2/features/preview} for more info
116
+ *
117
+ * @param {HMSConfig} config
118
+ * @memberof HMSSDK
119
+ */
131
120
  _defineProperty(this, "preview", config => {
132
121
  _HMSLogger.logger === null || _HMSLogger.logger === void 0 ? void 0 : _HMSLogger.logger.verbose('#Function preview', {
133
122
  config,
@@ -138,6 +127,17 @@ class HMSSDK {
138
127
  id: this.id
139
128
  });
140
129
  });
130
+ /**
131
+ * - previewForRole can be used when there is role change request for current localPeer and we want
132
+ * to show the localPeer how the tracks look before publishing them to room.
133
+ *
134
+ * - It requires a role of type [HMSRole]{@link HMSRole} for which we want to preview the tracks.
135
+ *
136
+ * checkout {@link https://www.100ms.live/docs/react-native} for more info
137
+ *
138
+ * @param {HMSRole}
139
+ * @memberof HMSSDK
140
+ */
141
141
  _defineProperty(this, "previewForRole", async role => {
142
142
  _HMSLogger.logger === null || _HMSLogger.logger === void 0 ? void 0 : _HMSLogger.logger.verbose('#Function previewForRole', {
143
143
  role,
@@ -153,6 +153,17 @@ class HMSSDK {
153
153
  return 'API currently not available for android';
154
154
  }
155
155
  });
156
+ /**
157
+ * - HmsView is react component that takes trackId and starts showing that track on a tile.
158
+ * - The appearance of tile is completely customizable with style prop.
159
+ * - Scale type can determine how the incoming video will fit in the canvas check {@link HMSVideoViewMode} for more information.
160
+ * - Mirror to flip the video vertically.
161
+ *
162
+ * checkout {@link https://www.100ms.live/docs/react-native/v2/features/render-video} for more info
163
+ *
164
+ * @param {HmsViewProps}
165
+ * @memberof HMSSDK
166
+ */
156
167
  _defineProperty(this, "HmsView", /*#__PURE__*/_react.default.forwardRef((props, ref) => {
157
168
  const {
158
169
  trackId,
@@ -171,8 +182,22 @@ class HMSSDK {
171
182
  id: this.id
172
183
  });
173
184
  }));
174
- _defineProperty(this, "leave", async () => {
185
+ _defineProperty(this, "roomLeaveCleanup", () => {
175
186
  var _this$appStateSubscri;
187
+ this.muteStatus = undefined;
188
+ this === null || this === void 0 ? void 0 : (_this$appStateSubscri = this.appStateSubscription) === null || _this$appStateSubscri === void 0 ? void 0 : _this$appStateSubscri.remove();
189
+ (0, _HMSPeersCache.clearHmsPeersCache)();
190
+ (0, _HMSRoomCache.clearHmsRoomCache)();
191
+ _HMSEncoder.HMSEncoder.clearData(); // Clearing cached data in encoder
192
+ });
193
+ /**
194
+ * Calls leave function of native sdk and session of current user is invalidated.
195
+ *
196
+ * checkout {@link https://www.100ms.live/docs/react-native/v2/features/leave} for more info
197
+ *
198
+ * @memberof HMSSDK
199
+ */
200
+ _defineProperty(this, "leave", async () => {
176
201
  _HMSLogger.logger === null || _HMSLogger.logger === void 0 ? void 0 : _HMSLogger.logger.verbose('#Function leave', {
177
202
  id: this.id
178
203
  });
@@ -180,10 +205,17 @@ class HMSSDK {
180
205
  id: this.id
181
206
  };
182
207
  const op = await HMSManager.leave(data);
183
- this.muteStatus = undefined;
184
- this === null || this === void 0 ? void 0 : (_this$appStateSubscri = this.appStateSubscription) === null || _this$appStateSubscri === void 0 ? void 0 : _this$appStateSubscri.remove();
208
+ this.roomLeaveCleanup();
185
209
  return op;
186
210
  });
211
+ /**
212
+ * - This function sends message to all the peers in the room, the get the message in onMessage listener.
213
+ *
214
+ * checkout {@link https://www.100ms.live/docs/react-native/v2/features/chat} for more info
215
+ *
216
+ * @param {message: string} and @param {type: string}
217
+ * @memberof HMSSDK
218
+ */
187
219
  _defineProperty(this, "sendBroadcastMessage", async function (message) {
188
220
  let type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _HMSMessageType.HMSMessageType.CHAT;
189
221
  _HMSLogger.logger === null || _HMSLogger.logger === void 0 ? void 0 : _HMSLogger.logger.verbose('#Function sendBroadcastMessage', {
@@ -197,6 +229,14 @@ class HMSSDK {
197
229
  id: _this.id
198
230
  });
199
231
  });
232
+ /**
233
+ * - sendGroupMessage sends a message to specific set of roles, whoever has any of those role in room
234
+ * will get the message in onMessage listener.
235
+ *
236
+ * checkout {@link https://www.100ms.live/docs/react-native/v2/features/chat} for more info
237
+ *
238
+ * @memberof HMSSDK
239
+ */
200
240
  _defineProperty(this, "sendGroupMessage", async function (message, roles) {
201
241
  let type = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : _HMSMessageType.HMSMessageType.CHAT;
202
242
  _HMSLogger.logger === null || _HMSLogger.logger === void 0 ? void 0 : _HMSLogger.logger.verbose('#Function sendGroupMessage', {
@@ -212,6 +252,14 @@ class HMSSDK {
212
252
  type: type || null
213
253
  });
214
254
  });
255
+ /**
256
+ * - sendDirectMessage sends a private message to a single peer, only that peer will get the message
257
+ * in onMessage Listener.
258
+ *
259
+ * checkout {@link https://www.100ms.live/docs/react-native/v2/features/chat} for more info
260
+ *
261
+ * @memberof HMSSDK
262
+ */
215
263
  _defineProperty(this, "sendDirectMessage", async function (message, peer) {
216
264
  let type = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : _HMSMessageType.HMSMessageType.CHAT;
217
265
  _HMSLogger.logger === null || _HMSLogger.logger === void 0 ? void 0 : _HMSLogger.logger.verbose('#Function sendDirectMessage', {
@@ -227,6 +275,18 @@ class HMSSDK {
227
275
  type: type || null
228
276
  });
229
277
  });
278
+ /**
279
+ * - changeMetadata changes a specific field in localPeer which is [metadata] it is a string that can
280
+ * be used for various functionalities like raiseHand, beRightBack and many more that explains the
281
+ * current status of the peer.
282
+ *
283
+ * - it is advised to use a json object in string format to store multiple dataPoints in metadata.
284
+ *
285
+ * checkout {@link https://www.100ms.live/docs/react-native/v2/advanced-features/change-metadata} for more info
286
+ *
287
+ * @param {string}
288
+ * @memberof HMSSDK
289
+ */
230
290
  _defineProperty(this, "changeMetadata", async metadata => {
231
291
  _HMSLogger.logger === null || _HMSLogger.logger === void 0 ? void 0 : _HMSLogger.logger.verbose('#Function changeMetadata', {
232
292
  metadata,
@@ -237,6 +297,15 @@ class HMSSDK {
237
297
  id: this.id
238
298
  });
239
299
  });
300
+ /**
301
+ * - startRTMPOrRecording takes a configuration object {@link HMSRTMPConfig} and stats the RTMP recording
302
+ * - this object of {@link HMSRTMPConfig} sets the urls for streaming and weather to set recording on or not
303
+ * - we get the response of this function in onRoomUpdate as RTMP_STREAMING_STATE_UPDATED.
304
+ *
305
+ * checkout {@link https://www.100ms.live/docs/react-native/v2/features/recording} for more info
306
+ *
307
+ * @memberof HMSSDK
308
+ */
240
309
  _defineProperty(this, "startRTMPOrRecording", async data => {
241
310
  _HMSLogger.logger === null || _HMSLogger.logger === void 0 ? void 0 : _HMSLogger.logger.verbose('#Function startRTMPOrRecording', {
242
311
  ...data,
@@ -248,6 +317,14 @@ class HMSSDK {
248
317
  });
249
318
  return op;
250
319
  });
320
+ /**
321
+ * - this function stops all the ongoing RTMP streaming and recording.
322
+ * - we get the response of this function in onRoomUpdate as RTMP_STREAMING_STATE_UPDATED.
323
+ *
324
+ * checkout {@link https://www.100ms.live/docs/react-native/v2/features/recording} for more info
325
+ *
326
+ * @memberof HMSSDK
327
+ */
251
328
  _defineProperty(this, "stopRtmpAndRecording", async () => {
252
329
  _HMSLogger.logger === null || _HMSLogger.logger === void 0 ? void 0 : _HMSLogger.logger.verbose('#Function stopRtmpAndRecording', {});
253
330
  const op = await HMSManager.stopRtmpAndRecording({
@@ -255,6 +332,15 @@ class HMSSDK {
255
332
  });
256
333
  return op;
257
334
  });
335
+ /**
336
+ * - This function starts HLSStreaming.
337
+ * - we get the response of this function in onRoomUpdate as HLS_STREAMING_STATE_UPDATED.
338
+ *
339
+ * checkout {@link https://www.100ms.live/docs/react-native/v2/features/hls-streaming} for more info
340
+ *
341
+ * @param {HMSHLSConfig}
342
+ * @memberof HMSSDK
343
+ */
258
344
  _defineProperty(this, "startHLSStreaming", async data => {
259
345
  _HMSLogger.logger === null || _HMSLogger.logger === void 0 ? void 0 : _HMSLogger.logger.verbose('#Function startHLSStreaming', {
260
346
  ...data,
@@ -265,12 +351,36 @@ class HMSSDK {
265
351
  id: this.id
266
352
  });
267
353
  });
354
+ /**
355
+ * - stopHLSStreaming function stops the ongoing HLSStreams.
356
+ * - we get the response of this function in onRoomUpdate as HLS_STREAMING_STATE_UPDATED.
357
+ *
358
+ * checkout {@link https://www.100ms.live/docs/react-native/v2/features/hls-streaming} for more info
359
+ *
360
+ * @memberof HMSSDK
361
+ */
268
362
  _defineProperty(this, "stopHLSStreaming", async () => {
269
363
  _HMSLogger.logger === null || _HMSLogger.logger === void 0 ? void 0 : _HMSLogger.logger.verbose('#Function stopHLSStreaming', {});
270
364
  return await HMSManager.stopHLSStreaming({
271
365
  id: this.id
272
366
  });
273
367
  });
368
+ /**
369
+ * @deprecated This function has been deprecated in favor of #Function changeRoleOfPeer
370
+ *
371
+ * - This function can be used in a situation when we want to change role hence manipulate their
372
+ * access and rights in the current room, it takes the peer {@link HMSPeer} whom role we want to change,
373
+ * role {@link HMSRole} which will be the new role for that peer and weather to forcefully change
374
+ * the role or ask the to accept the role change request using a boolean force.
375
+ *
376
+ * - if we change the role forcefully the peer's role will be updated without asking the peer
377
+ * otherwise the user will get the roleChangeRequest in roleChangeRequest listener.
378
+ * for more information on this checkout {@link onRoleChangeRequestListener}
379
+ *
380
+ * checkout {@link https://www.100ms.live/docs/react-native/v2/features/change-role} for more info
381
+ *
382
+ * @memberof HMSSDK
383
+ */
274
384
  _defineProperty(this, "changeRole", async function (peer, role) {
275
385
  let force = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
276
386
  const data = {
@@ -282,6 +392,20 @@ class HMSSDK {
282
392
  _HMSLogger.logger === null || _HMSLogger.logger === void 0 ? void 0 : _HMSLogger.logger.verbose('#Function changeRole', data);
283
393
  return await HMSManager.changeRole(data);
284
394
  });
395
+ /**
396
+ * - This function can be used in a situation when we want to change role hence manipulate their
397
+ * access and rights in the current room, it takes the peer {@link HMSPeer} whom role we want to change,
398
+ * role {@link HMSRole} which will be the new role for that peer and weather to forcefully change
399
+ * the role or ask the to accept the role change request using a boolean force.
400
+ *
401
+ * - if we change the role forcefully the peer's role will be updated without asking the peer
402
+ * otherwise the user will get the roleChangeRequest in roleChangeRequest listener.
403
+ * for more information on this checkout {@link onRoleChangeRequestListener}
404
+ *
405
+ * checkout {@link https://www.100ms.live/docs/react-native/v2/features/change-role} for more info
406
+ *
407
+ * @memberof HMSSDK
408
+ */
285
409
  _defineProperty(this, "changeRoleOfPeer", async function (peer, role) {
286
410
  let force = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
287
411
  const data = {
@@ -293,6 +417,19 @@ class HMSSDK {
293
417
  _HMSLogger.logger === null || _HMSLogger.logger === void 0 ? void 0 : _HMSLogger.logger.verbose('#Function changeRoleOfPeer', data);
294
418
  return HMSManager.changeRoleOfPeer(data);
295
419
  });
420
+ /**
421
+ * - This function can be used in a situation when we want to change role of multiple peers by specifying their roles.
422
+ * Hence manipulate their access and rights in the current room.
423
+ * It takes the list of roles {@link HMSRole} whom role we want to change
424
+ * and role {@link HMSRole} which will be the new role for peers.
425
+ *
426
+ * - Note that role will be updated without asking the peers.
427
+ * Meaning, Peers will not get the roleChangeRequest in roleChangeRequest listener.
428
+ *
429
+ * checkout {@link https://www.100ms.live/docs/react-native/v2/features/change-role} for more info
430
+ *
431
+ * @memberof HMSSDK
432
+ */
296
433
  _defineProperty(this, "changeRoleOfPeersWithRoles", async (ofRoles, toRole) => {
297
434
  const data = {
298
435
  ofRoles: ofRoles.map(ofRole => ofRole.name).filter(Boolean),
@@ -302,6 +439,15 @@ class HMSSDK {
302
439
  _HMSLogger.logger === null || _HMSLogger.logger === void 0 ? void 0 : _HMSLogger.logger.verbose('#Function changeRoleOfPeersWithRoles', data);
303
440
  return HMSManager.changeRoleOfPeersWithRoles(data);
304
441
  });
442
+ /**
443
+ * - This function can be used to manipulate mute status of any track.
444
+ * - Targeted peer affected by this action will get a callback in onChangeTrackStateRequestListener.
445
+ *
446
+ * * checkout {@link https://www.100ms.live/docs/react-native/v2/features/change-track-state} for more info
447
+ *
448
+ * @param {HMSTrack}
449
+ * @memberof HMSSDK
450
+ */
305
451
  _defineProperty(this, "changeTrackState", async (track, mute) => {
306
452
  _HMSLogger.logger === null || _HMSLogger.logger === void 0 ? void 0 : _HMSLogger.logger.verbose('#Function changeTrackState', {
307
453
  track,
@@ -315,6 +461,14 @@ class HMSSDK {
315
461
  };
316
462
  return await HMSManager.changeTrackState(data);
317
463
  });
464
+ /**
465
+ * - changeTrackStateForRoles is an enhancement on the functionality of {@link changeTrackState}.
466
+ * - We can change mute status for all the tracks of peers having a particular role.
467
+ * - @param source determines the source of the track ex. video, audio etc.
468
+ * - The peers affected by this action will get a callback in onChangeTrackStateRequestListener.
469
+ *
470
+ * @memberof HMSSDK
471
+ */
318
472
  _defineProperty(this, "changeTrackStateForRoles", async (mute, type, source, roles) => {
319
473
  let roleNames = null;
320
474
  if (roles) {
@@ -336,6 +490,14 @@ class HMSSDK {
336
490
  };
337
491
  return await HMSManager.changeTrackStateForRoles(data);
338
492
  });
493
+ /**
494
+ * - removePeer can forcefully disconnect a Peer from the room.
495
+ * - the user who's removed from this action will get a callback in {@link onRemovedFromRoomListener}.
496
+ *
497
+ * checkout {@link https://www.100ms.live/docs/react-native/v2/features/remove-peer} for more info
498
+ *
499
+ * @memberof HMSSDK
500
+ */
339
501
  _defineProperty(this, "removePeer", async (peer, reason) => {
340
502
  _HMSLogger.logger === null || _HMSLogger.logger === void 0 ? void 0 : _HMSLogger.logger.verbose('#Function removePeer', {
341
503
  peerId: peer.peerID,
@@ -349,6 +511,15 @@ class HMSSDK {
349
511
  };
350
512
  return await HMSManager.removePeer(data);
351
513
  });
514
+ /**
515
+ * - endRoom can be used in a situation where we want to disconnect all the peers from current room
516
+ * and end the call.
517
+ * - everyone in the room will get an update of this action in {@link onRemovedFromRoomListener}.
518
+ *
519
+ * checkout {@link https://www.100ms.live/docs/react-native/v2/features/end-room} for more info
520
+ *
521
+ * @memberof HMSSDK
522
+ */
352
523
  _defineProperty(this, "endRoom", async function (reason) {
353
524
  let lock = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
354
525
  _HMSLogger.logger === null || _HMSLogger.logger === void 0 ? void 0 : _HMSLogger.logger.verbose('#Function endRoom', {
@@ -363,6 +534,13 @@ class HMSSDK {
363
534
  };
364
535
  return await HMSManager.endRoom(data);
365
536
  });
537
+ /**
538
+ * - This function can be used to change name of localPeer.
539
+ *
540
+ * checkout {@link https://www.100ms.live/docs/react-native/v2/features/change-name} for more info
541
+ *
542
+ * @memberof HMSSDK
543
+ */
366
544
  _defineProperty(this, "changeName", async name => {
367
545
  _HMSLogger.logger === null || _HMSLogger.logger === void 0 ? void 0 : _HMSLogger.logger.verbose('#Function changeName', {
368
546
  name,
@@ -374,6 +552,13 @@ class HMSSDK {
374
552
  };
375
553
  return await HMSManager.changeName(data);
376
554
  });
555
+ /**
556
+ * - Calling this function will accept the most recent roleChange request made by anyone in the room
557
+ *
558
+ * checkout {@link https://www.100ms.live/docs/react-native/v2/features/change-role} for more info
559
+ *
560
+ * @memberof HMSSDK
561
+ */
377
562
  _defineProperty(this, "acceptRoleChange", async () => {
378
563
  _HMSLogger.logger === null || _HMSLogger.logger === void 0 ? void 0 : _HMSLogger.logger.verbose('#Function acceptRoleChange', {
379
564
  id: this.id
@@ -382,6 +567,14 @@ class HMSSDK {
382
567
  id: this.id
383
568
  });
384
569
  });
570
+ /**
571
+ * - setPlaybackForAllAudio is an extension of the abilities of setPlaybackAllowed in
572
+ * HMSRemoteAudioTrack. It sets mute status for all peers in the room only for the local peer.
573
+ *
574
+ * checkout {@link https://www.100ms.live/docs/react-native/v2/features/playback-allowed} for more info
575
+ *
576
+ * @memberof HMSSDK
577
+ */
385
578
  _defineProperty(this, "setPlaybackForAllAudio", mute => {
386
579
  _HMSLogger.logger === null || _HMSLogger.logger === void 0 ? void 0 : _HMSLogger.logger.verbose('#Function setPlaybackForAllAudio', {
387
580
  mute,
@@ -393,6 +586,11 @@ class HMSSDK {
393
586
  id: this.id
394
587
  });
395
588
  });
589
+ /**
590
+ * - This function mutes audio for all peers in the room.
591
+ *
592
+ * @memberof HMSSDK
593
+ */
396
594
  _defineProperty(this, "remoteMuteAllAudio", async () => {
397
595
  _HMSLogger.logger === null || _HMSLogger.logger === void 0 ? void 0 : _HMSLogger.logger.verbose('#Function remoteMuteAllAudio', {
398
596
  id: this.id
@@ -401,16 +599,34 @@ class HMSSDK {
401
599
  id: this.id
402
600
  });
403
601
  });
602
+ /**
603
+ * - getRoom is a wrapper function on an existing native function also known as getRoom the returns
604
+ * current room object which is of type {@link HMSRoom}
605
+ *
606
+ * checkout {@link https://www.100ms.live/docs/react-native/v2/features/join#get-room} for more info
607
+ *
608
+ * @memberof HMSSDK
609
+ * @return Promise<HMSRoom>
610
+ */
404
611
  _defineProperty(this, "getRoom", async () => {
612
+ var _getHmsRoomCache;
405
613
  _HMSLogger.logger === null || _HMSLogger.logger === void 0 ? void 0 : _HMSLogger.logger.verbose('#Function getRoom', {
406
614
  id: this.id
407
615
  });
408
616
  const hmsRoom = await HMSManager.getRoom({
409
617
  id: this.id
410
618
  });
619
+ (_getHmsRoomCache = (0, _HMSRoomCache.getHmsRoomCache)()) === null || _getHmsRoomCache === void 0 ? void 0 : _getHmsRoomCache.updateRoomCache(hmsRoom);
411
620
  const encodedHmsRoom = _HMSEncoder.HMSEncoder.encodeHmsRoom(hmsRoom, this.id);
412
621
  return encodedHmsRoom;
413
622
  });
623
+ /**
624
+ * - getLocalPeer is a wrapper function on an existing native function also known as getLocalPeer the returns
625
+ * current local peer object which is of type {@link HMSLocalPeer}
626
+ *
627
+ * @memberof HMSSDK
628
+ * @return Promise<HMSLocalPeer>
629
+ */
414
630
  _defineProperty(this, "getLocalPeer", async () => {
415
631
  _HMSLogger.logger === null || _HMSLogger.logger === void 0 ? void 0 : _HMSLogger.logger.verbose('#Function getLocalPeer', {
416
632
  id: this.id
@@ -421,6 +637,13 @@ class HMSSDK {
421
637
  const encodedLocalPeer = _HMSEncoder.HMSEncoder.encodeHmsLocalPeer(localPeer, this.id);
422
638
  return encodedLocalPeer;
423
639
  });
640
+ /**
641
+ * - getRemotePeers is a wrapper function on an existing native function also known as getRemotePeers the returns
642
+ * remote peers array which is of type {@link HMSRemotePeer}
643
+ *
644
+ * @memberof HMSSDK
645
+ * @return Promise<HMSRemotePeer[]>
646
+ */
424
647
  _defineProperty(this, "getRemotePeers", async () => {
425
648
  _HMSLogger.logger === null || _HMSLogger.logger === void 0 ? void 0 : _HMSLogger.logger.verbose('#Function getRemotePeers', {
426
649
  id: this.id
@@ -431,6 +654,13 @@ class HMSSDK {
431
654
  const encodedRemotePeers = _HMSEncoder.HMSEncoder.encodeHmsRemotePeers(remotePeers, this.id);
432
655
  return encodedRemotePeers;
433
656
  });
657
+ /**
658
+ * - getRoles is a wrapper function on an existing native function also known as getRoles the returns
659
+ * array of all present roles which is of type {@link HMSRole}
660
+ *
661
+ * @memberof HMSSDK
662
+ * @return Promise<HMSRole[]>
663
+ */
434
664
  _defineProperty(this, "getRoles", async () => {
435
665
  _HMSLogger.logger === null || _HMSLogger.logger === void 0 ? void 0 : _HMSLogger.logger.verbose('#Function getRoles', {
436
666
  id: this.id
@@ -441,6 +671,13 @@ class HMSSDK {
441
671
  const encodedRoles = _HMSEncoder.HMSEncoder.encodeHmsRoles(roles);
442
672
  return encodedRoles;
443
673
  });
674
+ /**
675
+ * - This function sets the volume of any peer in the room
676
+ *
677
+ * checkout {@link https://www.100ms.live/docs/react-native/v2/advanced-features/set-volume} for more info
678
+ *
679
+ * @memberof HMSSDK
680
+ */
444
681
  _defineProperty(this, "setVolume", (track, volume) => {
445
682
  _HMSLogger.logger === null || _HMSLogger.logger === void 0 ? void 0 : _HMSLogger.logger.verbose('#Function setVolume', {
446
683
  track,
@@ -461,6 +698,13 @@ class HMSSDK {
461
698
  id: this.id
462
699
  });
463
700
  });
701
+ /**
702
+ * - This is a temporary solution for the situation when mic access is taken from the app and
703
+ * user returns to the app with no mic access. It will re-acquire the mic by setting the volume
704
+ * from native side
705
+ *
706
+ * @memberof HMSSDK
707
+ */
464
708
  _defineProperty(this, "addAppStateListener", () => {
465
709
  _HMSLogger.logger === null || _HMSLogger.logger === void 0 ? void 0 : _HMSLogger.logger.verbose('#Function addAppStateListener', {
466
710
  id: this.id
@@ -471,6 +715,13 @@ class HMSSDK {
471
715
  }
472
716
  });
473
717
  });
718
+ /**
719
+ * - This function is used to start screenshare, currently available only for android
720
+ *
721
+ * checkout {@link https://www.100ms.live/docs/react-native/v2/features/screenshare} for more info
722
+ *
723
+ * @memberof HMSSDK
724
+ */
474
725
  _defineProperty(this, "startScreenshare", async () => {
475
726
  _HMSLogger.logger === null || _HMSLogger.logger === void 0 ? void 0 : _HMSLogger.logger.verbose('#Function startScreenshare', {
476
727
  id: this.id
@@ -479,6 +730,13 @@ class HMSSDK {
479
730
  id: this.id
480
731
  });
481
732
  });
733
+ /**
734
+ * - Returns a boolean stating if the screen is currently shared or not
735
+ *
736
+ * checkout {@link https://www.100ms.live/docs/react-native/v2/features/screenshare} for more info
737
+ *
738
+ * @memberof HMSSDK
739
+ */
482
740
  _defineProperty(this, "isScreenShared", async () => {
483
741
  _HMSLogger.logger === null || _HMSLogger.logger === void 0 ? void 0 : _HMSLogger.logger.verbose('#Function isScreenShared', {
484
742
  id: this.id
@@ -487,6 +745,13 @@ class HMSSDK {
487
745
  id: this.id
488
746
  });
489
747
  });
748
+ /**
749
+ * - stops the screenShare, currently available for android only.
750
+ *
751
+ * checkout {@link https://www.100ms.live/docs/react-native/v2/features/screenshare} for more info
752
+ *
753
+ * @memberof HMSSDK
754
+ */
490
755
  _defineProperty(this, "stopScreenshare", async () => {
491
756
  _HMSLogger.logger === null || _HMSLogger.logger === void 0 ? void 0 : _HMSLogger.logger.verbose('#Function stopScreenshare', {
492
757
  id: this.id
@@ -495,6 +760,18 @@ class HMSSDK {
495
760
  id: this.id
496
761
  });
497
762
  });
763
+ /**
764
+ * - enableRTCStats sets a boolean in native side which in turn allows several events to be passed
765
+ * through the bridge these events are {@link RTCStatsListener}, {@link onRemoteVideoStatsListener},
766
+ * {@link onRemoteAudioStatsListener}, {@link onLocalAudioStatsListener} and {@link onLocalVideoStatsListener}
767
+ *
768
+ * - These listeners get various dataPoints for current peers and their connectivity to the room
769
+ * such as jitter, latency etc.
770
+ *
771
+ * - currently available for iOS only
772
+ *
773
+ * @memberof HMSSDK
774
+ */
498
775
  _defineProperty(this, "enableRTCStats", () => {
499
776
  _HMSLogger.logger === null || _HMSLogger.logger === void 0 ? void 0 : _HMSLogger.logger.verbose('#Function enableRTCStats', {
500
777
  id: this.id
@@ -503,6 +780,14 @@ class HMSSDK {
503
780
  id: this.id
504
781
  });
505
782
  });
783
+ /**
784
+ * - disable RTCStats sets the same boolean to false that was set true by enableRTCStats.
785
+ * that activates a check which filters out the events acquired in native listeners and don't
786
+ * let them pass through bridge
787
+ *
788
+ * - currently available for iOS only.
789
+ * @memberof HMSSDK
790
+ */
506
791
  _defineProperty(this, "disableRTCStats", () => {
507
792
  _HMSLogger.logger === null || _HMSLogger.logger === void 0 ? void 0 : _HMSLogger.logger.verbose('#Function disableRTCStats', {
508
793
  id: this.id
@@ -527,6 +812,14 @@ class HMSSDK {
527
812
  id: this.id
528
813
  });
529
814
  });
815
+ /**
816
+ * - This wrapper function is used to start streaming device audio, currently available only for android.
817
+ *
818
+ * checkout {@link https://www.100ms.live/docs/react-native/v2/features/audio-share#how-to-stream-device-audio-from-the-app} for more info.
819
+ *
820
+ * @param {HMSAudioMixingMode}
821
+ * @memberof HMSSDK
822
+ */
530
823
  _defineProperty(this, "startAudioshare", async audioMixingMode => {
531
824
  _HMSLogger.logger === null || _HMSLogger.logger === void 0 ? void 0 : _HMSLogger.logger.verbose('#Function startAudioshare', {
532
825
  id: this.id,
@@ -542,6 +835,13 @@ class HMSSDK {
542
835
  return 'API currently not available for iOS';
543
836
  }
544
837
  });
838
+ /**
839
+ * - This wrapper function returns true if audio is being shared and vice versa, currently available only for android.
840
+ *
841
+ * checkout {@link https://www.100ms.live/docs/react-native/v2/features/audio-share#how-to-get-audio-share-status} for more info.
842
+ *
843
+ * @memberof HMSSDK
844
+ */
545
845
  _defineProperty(this, "isAudioShared", async () => {
546
846
  _HMSLogger.logger === null || _HMSLogger.logger === void 0 ? void 0 : _HMSLogger.logger.verbose('#Function isAudioShared', {
547
847
  id: this.id
@@ -555,6 +855,13 @@ class HMSSDK {
555
855
  return 'API currently not available for iOS';
556
856
  }
557
857
  });
858
+ /**
859
+ * - This wrapper function is used to stop streaming device audio, currently available only for android.
860
+ *
861
+ * checkout {@link https://www.100ms.live/docs/react-native/v2/features/audio-share#how-to-stop-audio-sharing} for more info.
862
+ *
863
+ * @memberof HMSSDK
864
+ */
558
865
  _defineProperty(this, "stopAudioshare", async () => {
559
866
  _HMSLogger.logger === null || _HMSLogger.logger === void 0 ? void 0 : _HMSLogger.logger.verbose('#Function stopAudioshare', {
560
867
  id: this.id
@@ -568,6 +875,12 @@ class HMSSDK {
568
875
  return 'API currently not available for iOS';
569
876
  }
570
877
  });
878
+ /**
879
+ * - This wrapper function returns the current audio mixing mode, currently available only for android.
880
+ *
881
+ * @memberof HMSSDK
882
+ * @return HMSAudioMixingMode
883
+ */
571
884
  _defineProperty(this, "getAudioMixingMode", async () => {
572
885
  _HMSLogger.logger === null || _HMSLogger.logger === void 0 ? void 0 : _HMSLogger.logger.verbose('#Function getAudioMixingMode', {
573
886
  id: this.id
@@ -581,6 +894,14 @@ class HMSSDK {
581
894
  return 'API currently not available for iOS';
582
895
  }
583
896
  });
897
+ /**
898
+ * - This wrapper function used to change the mode while the user is streaming audio, currently available only for android.
899
+ *
900
+ * checkout {@link https://www.100ms.live/docs/react-native/v2/features/audio-share#how-to-change-mode} for more info
901
+ *
902
+ * @param {HMSAudioMixingMode}
903
+ * @memberof HMSSDK
904
+ */
584
905
  _defineProperty(this, "setAudioMixingMode", async audioMixingMode => {
585
906
  _HMSLogger.logger === null || _HMSLogger.logger === void 0 ? void 0 : _HMSLogger.logger.verbose('#Function setAudioMixingMode', {
586
907
  id: this.id,
@@ -596,6 +917,15 @@ class HMSSDK {
596
917
  return 'API currently not available for iOS';
597
918
  }
598
919
  });
920
+ /**
921
+ * - This wrapper function returns the array of audio output devices which is of
922
+ * type {@link HMSAudioDevice[]}, currently available only for android.
923
+ *
924
+ * checkout {@link https://www.100ms.live/docs/react-native/v2/features/audio-output-routing#get-list-of-audio-device} for more info
925
+ *
926
+ * @memberof HMSSDK
927
+ * @return HMSAudioDevice[]
928
+ */
599
929
  _defineProperty(this, "getAudioDevicesList", async () => {
600
930
  _HMSLogger.logger === null || _HMSLogger.logger === void 0 ? void 0 : _HMSLogger.logger.verbose('#Function getAudioDevicesList', {
601
931
  id: this.id
@@ -609,6 +939,15 @@ class HMSSDK {
609
939
  return 'API currently not available for iOS';
610
940
  }
611
941
  });
942
+ /**
943
+ * - This wrapper function returns the current audio output device which is of
944
+ * type {@link HMSAudioDevice}, currently available only for android.
945
+ *
946
+ * checkout {@link https://www.100ms.live/docs/react-native/v2/features/audio-output-routing#get-current-focussed-device} for more info
947
+ *
948
+ * @memberof HMSSDK
949
+ * @return HMSAudioDevice
950
+ */
612
951
  _defineProperty(this, "getAudioOutputRouteType", async () => {
613
952
  _HMSLogger.logger === null || _HMSLogger.logger === void 0 ? void 0 : _HMSLogger.logger.verbose('#Function getAudioOutputRouteType', {
614
953
  id: this.id
@@ -622,6 +961,14 @@ class HMSSDK {
622
961
  return 'API currently not available for iOS';
623
962
  }
624
963
  });
964
+ /**
965
+ * - This wrapper function used to switch output to device other than the default, currently available only for android.
966
+ *
967
+ * checkout {@link https://www.100ms.live/docs/react-native/v2/features/audio-output-routing#switch-audio-focus-to-another-device} for more info
968
+ *
969
+ * @param {HMSAudioDevice}
970
+ * @memberof HMSSDK
971
+ */
625
972
  _defineProperty(this, "switchAudioOutput", audioDevice => {
626
973
  _HMSLogger.logger === null || _HMSLogger.logger === void 0 ? void 0 : _HMSLogger.logger.verbose('#Function switchAudioOutput', {
627
974
  id: this.id,
@@ -637,6 +984,14 @@ class HMSSDK {
637
984
  return 'API currently not available for iOS';
638
985
  }
639
986
  });
987
+ /**
988
+ * - This wrapper function used to change Audio Mode manually, currently available only for android.
989
+ *
990
+ * checkout {@link https://www.100ms.live/docs/react-native/v2/features/audio-mode-change} for more info
991
+ *
992
+ * @param {HMSAudioMode}
993
+ * @memberof HMSSDK
994
+ */
640
995
  _defineProperty(this, "setAudioMode", audioMode => {
641
996
  _HMSLogger.logger === null || _HMSLogger.logger === void 0 ? void 0 : _HMSLogger.logger.verbose('#Function setAudioMode', {
642
997
  id: this.id,
@@ -652,6 +1007,14 @@ class HMSSDK {
652
1007
  return 'API currently not available for iOS';
653
1008
  }
654
1009
  });
1010
+ /**
1011
+ * - This is a wrapper function which adds a listener which is triggered when audio output device is switched, currently available only for android.
1012
+ *
1013
+ * checkout {@link https://www.100ms.live/docs/react-native/v2/features/audio-output-routing#adding-a-listener} for more info
1014
+ *
1015
+ * @param {Function}
1016
+ * @memberof HMSSDK
1017
+ */
655
1018
  _defineProperty(this, "setAudioDeviceChangeListener", callback => {
656
1019
  _HMSLogger.logger === null || _HMSLogger.logger === void 0 ? void 0 : _HMSLogger.logger.verbose('#Function setAudioDeviceChangeListener', {
657
1020
  id: this.id
@@ -684,6 +1047,13 @@ class HMSSDK {
684
1047
  id: this.id
685
1048
  });
686
1049
  });
1050
+ /**
1051
+ * - This is a prototype event listener that takes action and listens for updates related to that particular action
1052
+ *
1053
+ * @param {string} action
1054
+ * @param {*} callback
1055
+ * @memberof HMSSDK
1056
+ */
687
1057
  _defineProperty(this, "addEventListener", (action, callback) => {
688
1058
  _HMSLogger.logger === null || _HMSLogger.logger === void 0 ? void 0 : _HMSLogger.logger.verbose('#Function addEventListener', {
689
1059
  action,
@@ -691,68 +1061,257 @@ class HMSSDK {
691
1061
  });
692
1062
  switch (action) {
693
1063
  case _HMSUpdateListenerActions.HMSUpdateListenerActions.ON_PREVIEW:
694
- this.onPreviewDelegate = callback;
695
- break;
1064
+ {
1065
+ // Checking if we already have ON_PREVIEW subscription
1066
+ if (!this.emitterSubscriptions[_HMSUpdateListenerActions.HMSUpdateListenerActions.ON_PREVIEW]) {
1067
+ // Adding ON_PREVIEW native listener
1068
+ const previewSubscription = HmsEventEmitter.addListener(this.id, _HMSUpdateListenerActions.HMSUpdateListenerActions.ON_PREVIEW, this.onPreviewListener);
1069
+ this.emitterSubscriptions[_HMSUpdateListenerActions.HMSUpdateListenerActions.ON_PREVIEW] = previewSubscription;
1070
+ }
1071
+ // Adding App Delegate listener
1072
+ this.onPreviewDelegate = callback;
1073
+ break;
1074
+ }
696
1075
  case _HMSUpdateListenerActions.HMSUpdateListenerActions.ON_JOIN:
697
- this.onJoinDelegate = callback;
698
- break;
1076
+ {
1077
+ // Checking if we already have ON_JOIN subscription
1078
+ if (!this.emitterSubscriptions[_HMSUpdateListenerActions.HMSUpdateListenerActions.ON_JOIN]) {
1079
+ // Adding ON_JOIN native listener
1080
+ const joinSubscription = HmsEventEmitter.addListener(this.id, _HMSUpdateListenerActions.HMSUpdateListenerActions.ON_JOIN, this.onJoinListener);
1081
+ this.emitterSubscriptions[_HMSUpdateListenerActions.HMSUpdateListenerActions.ON_JOIN] = joinSubscription;
1082
+ }
1083
+ // Adding App Delegate listener
1084
+ this.onJoinDelegate = callback;
1085
+ break;
1086
+ }
699
1087
  case _HMSUpdateListenerActions.HMSUpdateListenerActions.ON_ROOM_UPDATE:
700
- this.onRoomDelegate = callback;
701
- break;
1088
+ {
1089
+ // Checking if we already have ON_ROOM_UPDATE subscription
1090
+ if (!this.emitterSubscriptions[_HMSUpdateListenerActions.HMSUpdateListenerActions.ON_ROOM_UPDATE]) {
1091
+ // Adding ON_ROOM_UPDATE native listener
1092
+ const roomSubscription = HmsEventEmitter.addListener(this.id, _HMSUpdateListenerActions.HMSUpdateListenerActions.ON_ROOM_UPDATE, this.onRoomListener);
1093
+ this.emitterSubscriptions[_HMSUpdateListenerActions.HMSUpdateListenerActions.ON_ROOM_UPDATE] = roomSubscription;
1094
+ }
1095
+ // Adding App Delegate listener
1096
+ this.onRoomDelegate = callback;
1097
+ break;
1098
+ }
702
1099
  case _HMSUpdateListenerActions.HMSUpdateListenerActions.ON_PEER_UPDATE:
703
- this.onPeerDelegate = callback;
704
- break;
1100
+ {
1101
+ // Checking if we already have ON_PEER_UPDATE subscription
1102
+ if (!this.emitterSubscriptions[_HMSUpdateListenerActions.HMSUpdateListenerActions.ON_PEER_UPDATE]) {
1103
+ // Adding ON_PEER_UPDATE native listener
1104
+ const peerSubscription = HmsEventEmitter.addListener(this.id, _HMSUpdateListenerActions.HMSUpdateListenerActions.ON_PEER_UPDATE, this.onPeerListener);
1105
+ this.emitterSubscriptions[_HMSUpdateListenerActions.HMSUpdateListenerActions.ON_PEER_UPDATE] = peerSubscription;
1106
+ }
1107
+ // Adding App Delegate listener
1108
+ this.onPeerDelegate = callback;
1109
+ break;
1110
+ }
705
1111
  case _HMSUpdateListenerActions.HMSUpdateListenerActions.ON_TRACK_UPDATE:
706
- this.onTrackDelegate = callback;
707
- break;
1112
+ {
1113
+ // Checking if we already have ON_TRACK_UPDATE subscription
1114
+ if (!this.emitterSubscriptions[_HMSUpdateListenerActions.HMSUpdateListenerActions.ON_TRACK_UPDATE]) {
1115
+ // Adding ON_TRACK_UPDATE native listener
1116
+ const trackSubscription = HmsEventEmitter.addListener(this.id, _HMSUpdateListenerActions.HMSUpdateListenerActions.ON_TRACK_UPDATE, this.onTrackListener);
1117
+ this.emitterSubscriptions[_HMSUpdateListenerActions.HMSUpdateListenerActions.ON_TRACK_UPDATE] = trackSubscription;
1118
+ }
1119
+ // Adding App Delegate listener
1120
+ this.onTrackDelegate = callback;
1121
+ break;
1122
+ }
708
1123
  case _HMSUpdateListenerActions.HMSUpdateListenerActions.ON_ERROR:
709
- this.onErrorDelegate = callback;
710
- break;
1124
+ {
1125
+ // Checking if we already have ON_ERROR subscription
1126
+ if (!this.emitterSubscriptions[_HMSUpdateListenerActions.HMSUpdateListenerActions.ON_ERROR]) {
1127
+ // Adding ON_ERROR native listener
1128
+ const errorSubscription = HmsEventEmitter.addListener(this.id, _HMSUpdateListenerActions.HMSUpdateListenerActions.ON_ERROR, this.onErrorListener);
1129
+ this.emitterSubscriptions[_HMSUpdateListenerActions.HMSUpdateListenerActions.ON_ERROR] = errorSubscription;
1130
+ }
1131
+ // Adding App Delegate listener
1132
+ this.onErrorDelegate = callback;
1133
+ break;
1134
+ }
711
1135
  case _HMSUpdateListenerActions.HMSUpdateListenerActions.ON_MESSAGE:
712
- this.onMessageDelegate = callback;
713
- break;
1136
+ {
1137
+ // Checking if we already have ON_MESSAGE subscription
1138
+ if (!this.emitterSubscriptions[_HMSUpdateListenerActions.HMSUpdateListenerActions.ON_MESSAGE]) {
1139
+ // Adding ON_MESSAGE native listener
1140
+ const messageSubscription = HmsEventEmitter.addListener(this.id, _HMSUpdateListenerActions.HMSUpdateListenerActions.ON_MESSAGE, this.onMessageListener);
1141
+ this.emitterSubscriptions[_HMSUpdateListenerActions.HMSUpdateListenerActions.ON_MESSAGE] = messageSubscription;
1142
+ }
1143
+ // Adding App Delegate listener
1144
+ this.onMessageDelegate = callback;
1145
+ break;
1146
+ }
714
1147
  case _HMSUpdateListenerActions.HMSUpdateListenerActions.ON_SPEAKER:
715
- this.onSpeakerDelegate = callback;
716
- break;
1148
+ {
1149
+ // Checking if we already have ON_SPEAKER subscription
1150
+ if (!this.emitterSubscriptions[_HMSUpdateListenerActions.HMSUpdateListenerActions.ON_SPEAKER]) {
1151
+ // Adding ON_SPEAKER native listener
1152
+ const speakerSubscription = HmsEventEmitter.addListener(this.id, _HMSUpdateListenerActions.HMSUpdateListenerActions.ON_SPEAKER, this.onSpeakerListener);
1153
+ this.emitterSubscriptions[_HMSUpdateListenerActions.HMSUpdateListenerActions.ON_SPEAKER] = speakerSubscription;
1154
+ }
1155
+ // Adding App Delegate listener
1156
+ this.onSpeakerDelegate = callback;
1157
+ break;
1158
+ }
717
1159
  case _HMSUpdateListenerActions.HMSUpdateListenerActions.RECONNECTING:
718
- this.onReconnectingDelegate = callback;
719
- break;
1160
+ {
1161
+ // Checking if we already have RECONNECTING subscription
1162
+ if (!this.emitterSubscriptions[_HMSUpdateListenerActions.HMSUpdateListenerActions.RECONNECTING]) {
1163
+ // Adding RECONNECTING native listener
1164
+ const reconnectingSubscription = HmsEventEmitter.addListener(this.id, _HMSUpdateListenerActions.HMSUpdateListenerActions.RECONNECTING, this.reconnectingListener);
1165
+ this.emitterSubscriptions[_HMSUpdateListenerActions.HMSUpdateListenerActions.RECONNECTING] = reconnectingSubscription;
1166
+ }
1167
+ // Adding App Delegate listener
1168
+ this.onReconnectingDelegate = callback;
1169
+ break;
1170
+ }
720
1171
  case _HMSUpdateListenerActions.HMSUpdateListenerActions.RECONNECTED:
721
- this.onReconnectedDelegate = callback;
722
- break;
1172
+ {
1173
+ // Checking if we already have RECONNECTED subscription
1174
+ if (!this.emitterSubscriptions[_HMSUpdateListenerActions.HMSUpdateListenerActions.RECONNECTED]) {
1175
+ // Adding RECONNECTED native listener
1176
+ const reconnectedSubscription = HmsEventEmitter.addListener(this.id, _HMSUpdateListenerActions.HMSUpdateListenerActions.RECONNECTED, this.reconnectedListener);
1177
+ this.emitterSubscriptions[_HMSUpdateListenerActions.HMSUpdateListenerActions.RECONNECTED] = reconnectedSubscription;
1178
+ }
1179
+ // Adding App Delegate listener
1180
+ this.onReconnectedDelegate = callback;
1181
+ break;
1182
+ }
723
1183
  case _HMSUpdateListenerActions.HMSUpdateListenerActions.ON_ROLE_CHANGE_REQUEST:
724
- this.onRoleChangeRequestDelegate = callback;
725
- break;
1184
+ {
1185
+ // Checking if we already have ON_ROLE_CHANGE_REQUEST subscription
1186
+ if (!this.emitterSubscriptions[_HMSUpdateListenerActions.HMSUpdateListenerActions.ON_ROLE_CHANGE_REQUEST]) {
1187
+ // Adding ON_ROLE_CHANGE_REQUEST native listener
1188
+ const roleChangeReqSubscription = HmsEventEmitter.addListener(this.id, _HMSUpdateListenerActions.HMSUpdateListenerActions.ON_ROLE_CHANGE_REQUEST, this.onRoleChangeRequestListener);
1189
+ this.emitterSubscriptions[_HMSUpdateListenerActions.HMSUpdateListenerActions.ON_ROLE_CHANGE_REQUEST] = roleChangeReqSubscription;
1190
+ }
1191
+ // Adding App Delegate listener
1192
+ this.onRoleChangeRequestDelegate = callback;
1193
+ break;
1194
+ }
726
1195
  case _HMSUpdateListenerActions.HMSUpdateListenerActions.ON_CHANGE_TRACK_STATE_REQUEST:
727
- this.onChangeTrackStateRequestDelegate = callback;
728
- break;
1196
+ {
1197
+ // Checking if we already have ON_CHANGE_TRACK_STATE_REQUEST subscription
1198
+ if (!this.emitterSubscriptions[_HMSUpdateListenerActions.HMSUpdateListenerActions.ON_CHANGE_TRACK_STATE_REQUEST]) {
1199
+ // Adding ON_CHANGE_TRACK_STATE_REQUEST native listener
1200
+ const changeTrackReqSubscription = HmsEventEmitter.addListener(this.id, _HMSUpdateListenerActions.HMSUpdateListenerActions.ON_CHANGE_TRACK_STATE_REQUEST, this.onChangeTrackStateRequestListener);
1201
+ this.emitterSubscriptions[_HMSUpdateListenerActions.HMSUpdateListenerActions.ON_CHANGE_TRACK_STATE_REQUEST] = changeTrackReqSubscription;
1202
+ }
1203
+ // Adding App Delegate listener
1204
+ this.onChangeTrackStateRequestDelegate = callback;
1205
+ break;
1206
+ }
729
1207
  case _HMSUpdateListenerActions.HMSUpdateListenerActions.ON_REMOVED_FROM_ROOM:
730
- this.onRemovedFromRoomDelegate = callback;
731
- break;
1208
+ {
1209
+ // Checking if we already have ON_REMOVED_FROM_ROOM subscription
1210
+ if (!this.emitterSubscriptions[_HMSUpdateListenerActions.HMSUpdateListenerActions.ON_REMOVED_FROM_ROOM]) {
1211
+ // Adding ON_REMOVED_FROM_ROOM native listener
1212
+ const removedFromRoomSubscription = HmsEventEmitter.addListener(this.id, _HMSUpdateListenerActions.HMSUpdateListenerActions.ON_REMOVED_FROM_ROOM, this.onRemovedFromRoomListener);
1213
+ this.emitterSubscriptions[_HMSUpdateListenerActions.HMSUpdateListenerActions.ON_REMOVED_FROM_ROOM] = removedFromRoomSubscription;
1214
+ }
1215
+ // Adding App Delegate listener
1216
+ this.onRemovedFromRoomDelegate = callback;
1217
+ break;
1218
+ }
732
1219
  case _HMSUpdateListenerActions.HMSUpdateListenerActions.ON_RTC_STATS:
733
- this.onRtcStatsDelegate = callback;
734
- break;
1220
+ {
1221
+ // Checking if we already have ON_RTC_STATS subscription
1222
+ if (!this.emitterSubscriptions[_HMSUpdateListenerActions.HMSUpdateListenerActions.ON_RTC_STATS]) {
1223
+ // Adding ON_RTC_STATS native listener
1224
+ const rtcStatsSubscription = HmsEventEmitter.addListener(this.id, _HMSUpdateListenerActions.HMSUpdateListenerActions.ON_RTC_STATS, this.RTCStatsListener);
1225
+ this.emitterSubscriptions[_HMSUpdateListenerActions.HMSUpdateListenerActions.ON_RTC_STATS] = rtcStatsSubscription;
1226
+ }
1227
+ // Adding App Delegate listener
1228
+ this.onRtcStatsDelegate = callback;
1229
+ break;
1230
+ }
735
1231
  case _HMSUpdateListenerActions.HMSUpdateListenerActions.ON_LOCAL_AUDIO_STATS:
736
- this.onLocalAudioStatsDelegate = callback;
737
- break;
1232
+ {
1233
+ // Checking if we already have ON_LOCAL_AUDIO_STATS subscription
1234
+ if (!this.emitterSubscriptions[_HMSUpdateListenerActions.HMSUpdateListenerActions.ON_LOCAL_AUDIO_STATS]) {
1235
+ // Adding ON_LOCAL_AUDIO_STATS native listener
1236
+ const lclAudioStatsSubscription = HmsEventEmitter.addListener(this.id, _HMSUpdateListenerActions.HMSUpdateListenerActions.ON_LOCAL_AUDIO_STATS, this.onLocalAudioStatsListener);
1237
+ this.emitterSubscriptions[_HMSUpdateListenerActions.HMSUpdateListenerActions.ON_LOCAL_AUDIO_STATS] = lclAudioStatsSubscription;
1238
+ }
1239
+ // Adding App Delegate listener
1240
+ this.onLocalAudioStatsDelegate = callback;
1241
+ break;
1242
+ }
738
1243
  case _HMSUpdateListenerActions.HMSUpdateListenerActions.ON_LOCAL_VIDEO_STATS:
739
- this.onLocalVideoStatsDelegate = callback;
740
- break;
1244
+ {
1245
+ // Checking if we already have ON_LOCAL_VIDEO_STATS subscription
1246
+ if (!this.emitterSubscriptions[_HMSUpdateListenerActions.HMSUpdateListenerActions.ON_LOCAL_VIDEO_STATS]) {
1247
+ // Adding ON_LOCAL_VIDEO_STATS native listener
1248
+ const lclVideoStatsSubscription = HmsEventEmitter.addListener(this.id, _HMSUpdateListenerActions.HMSUpdateListenerActions.ON_LOCAL_VIDEO_STATS, this.onLocalVideoStatsListener);
1249
+ this.emitterSubscriptions[_HMSUpdateListenerActions.HMSUpdateListenerActions.ON_LOCAL_VIDEO_STATS] = lclVideoStatsSubscription;
1250
+ }
1251
+ // Adding App Delegate listener
1252
+ this.onLocalVideoStatsDelegate = callback;
1253
+ break;
1254
+ }
741
1255
  case _HMSUpdateListenerActions.HMSUpdateListenerActions.ON_REMOTE_AUDIO_STATS:
742
- this.onRemoteAudioStatsDelegate = callback;
743
- break;
1256
+ {
1257
+ // Checking if we already have ON_REMOTE_AUDIO_STATS subscription
1258
+ if (!this.emitterSubscriptions[_HMSUpdateListenerActions.HMSUpdateListenerActions.ON_REMOTE_AUDIO_STATS]) {
1259
+ // Adding ON_REMOTE_AUDIO_STATS native listener
1260
+ const rmAudioStatsSubscription = HmsEventEmitter.addListener(this.id, _HMSUpdateListenerActions.HMSUpdateListenerActions.ON_REMOTE_AUDIO_STATS, this.onRemoteAudioStatsListener);
1261
+ this.emitterSubscriptions[_HMSUpdateListenerActions.HMSUpdateListenerActions.ON_REMOTE_AUDIO_STATS] = rmAudioStatsSubscription;
1262
+ }
1263
+ // Adding App Delegate listener
1264
+ this.onRemoteAudioStatsDelegate = callback;
1265
+ break;
1266
+ }
744
1267
  case _HMSUpdateListenerActions.HMSUpdateListenerActions.ON_REMOTE_VIDEO_STATS:
745
- this.onRemoteVideoStatsDelegate = callback;
746
- break;
1268
+ {
1269
+ // Checking if we already have ON_REMOTE_VIDEO_STATS subscription
1270
+ if (!this.emitterSubscriptions[_HMSUpdateListenerActions.HMSUpdateListenerActions.ON_REMOTE_VIDEO_STATS]) {
1271
+ // Adding ON_REMOTE_VIDEO_STATS native listener
1272
+ const rmVideoStatsSubscription = HmsEventEmitter.addListener(this.id, _HMSUpdateListenerActions.HMSUpdateListenerActions.ON_REMOTE_VIDEO_STATS, this.onRemoteVideoStatsListener);
1273
+ this.emitterSubscriptions[_HMSUpdateListenerActions.HMSUpdateListenerActions.ON_REMOTE_VIDEO_STATS] = rmVideoStatsSubscription;
1274
+ }
1275
+ // Adding App Delegate listener
1276
+ this.onRemoteVideoStatsDelegate = callback;
1277
+ break;
1278
+ }
747
1279
  case _HMSUpdateListenerActions.HMSUpdateListenerActions.ON_AUDIO_DEVICE_CHANGED:
748
- this.onAudioDeviceChangedDelegate = callback;
749
- break;
1280
+ {
1281
+ // Checking if we already have ON_AUDIO_DEVICE_CHANGED subscription
1282
+ if (!this.emitterSubscriptions[_HMSUpdateListenerActions.HMSUpdateListenerActions.ON_AUDIO_DEVICE_CHANGED]) {
1283
+ // Adding ON_AUDIO_DEVICE_CHANGED native listener
1284
+ const audDeviceChgSubscription = HmsEventEmitter.addListener(this.id, _HMSUpdateListenerActions.HMSUpdateListenerActions.ON_AUDIO_DEVICE_CHANGED, this.onAudioDeviceChangedListener);
1285
+ this.emitterSubscriptions[_HMSUpdateListenerActions.HMSUpdateListenerActions.ON_AUDIO_DEVICE_CHANGED] = audDeviceChgSubscription;
1286
+ }
1287
+ // Adding App Delegate listener
1288
+ this.onAudioDeviceChangedDelegate = callback;
1289
+ break;
1290
+ }
750
1291
  case _HMSPIPListenerActions.HMSPIPListenerActions.ON_PIP_ROOM_LEAVE:
751
- this.onPIPRoomLeaveDelegate = callback;
752
- break;
1292
+ {
1293
+ if (_reactNative.Platform.OS === 'android') {
1294
+ // Checking if we already have ON_PIP_ROOM_LEAVE subscription
1295
+ if (!this.emitterSubscriptions[_HMSPIPListenerActions.HMSPIPListenerActions.ON_PIP_ROOM_LEAVE]) {
1296
+ // Adding ON_PIP_ROOM_LEAVE native listener
1297
+ const pipRoomLeaveSubscription = HmsEventEmitter.addListener(this.id, _HMSPIPListenerActions.HMSPIPListenerActions.ON_PIP_ROOM_LEAVE, this.onPIPRoomLeaveListener);
1298
+ this.emitterSubscriptions[_HMSPIPListenerActions.HMSPIPListenerActions.ON_PIP_ROOM_LEAVE] = pipRoomLeaveSubscription;
1299
+ }
1300
+ // Adding App Delegate listener
1301
+ this.onPIPRoomLeaveDelegate = callback;
1302
+ }
1303
+ break;
1304
+ }
753
1305
  default:
754
1306
  }
755
1307
  });
1308
+ /**
1309
+ * - This is a prototype event listener that takes action and listens for updates related to that particular action
1310
+ *
1311
+ * @param {string} action
1312
+ * @param {*} callback
1313
+ * @memberof HMSSDK
1314
+ */
756
1315
  _defineProperty(this, "removeEventListener", action => {
757
1316
  _HMSLogger.logger === null || _HMSLogger.logger === void 0 ? void 0 : _HMSLogger.logger.verbose('#Function removeEventListener', {
758
1317
  action,
@@ -760,68 +1319,255 @@ class HMSSDK {
760
1319
  });
761
1320
  switch (action) {
762
1321
  case _HMSUpdateListenerActions.HMSUpdateListenerActions.ON_PREVIEW:
763
- this.onPreviewDelegate = null;
764
- break;
1322
+ {
1323
+ const subscription = this.emitterSubscriptions[_HMSUpdateListenerActions.HMSUpdateListenerActions.ON_PREVIEW];
1324
+ // Removing ON_PREVIEW native listener
1325
+ if (subscription) {
1326
+ subscription.remove();
1327
+ this.emitterSubscriptions[_HMSUpdateListenerActions.HMSUpdateListenerActions.ON_PREVIEW] = undefined;
1328
+ }
1329
+ // Removing App Delegate listener
1330
+ this.onPreviewDelegate = null;
1331
+ break;
1332
+ }
765
1333
  case _HMSUpdateListenerActions.HMSUpdateListenerActions.ON_JOIN:
766
- this.onJoinDelegate = null;
767
- break;
1334
+ {
1335
+ const subscription = this.emitterSubscriptions[_HMSUpdateListenerActions.HMSUpdateListenerActions.ON_JOIN];
1336
+ // Removing ON_JOIN native listener
1337
+ if (subscription) {
1338
+ subscription.remove();
1339
+ this.emitterSubscriptions[_HMSUpdateListenerActions.HMSUpdateListenerActions.ON_JOIN] = undefined;
1340
+ }
1341
+ // Removing App Delegate listener
1342
+ this.onJoinDelegate = null;
1343
+ break;
1344
+ }
768
1345
  case _HMSUpdateListenerActions.HMSUpdateListenerActions.ON_ROOM_UPDATE:
769
- this.onRoomDelegate = null;
770
- break;
1346
+ {
1347
+ const subscription = this.emitterSubscriptions[_HMSUpdateListenerActions.HMSUpdateListenerActions.ON_ROOM_UPDATE];
1348
+ // Removing ON_ROOM_UPDATE native listener
1349
+ if (subscription) {
1350
+ subscription.remove();
1351
+ this.emitterSubscriptions[_HMSUpdateListenerActions.HMSUpdateListenerActions.ON_ROOM_UPDATE] = undefined;
1352
+ }
1353
+ // Removing App Delegate listener
1354
+ this.onRoomDelegate = null;
1355
+ break;
1356
+ }
771
1357
  case _HMSUpdateListenerActions.HMSUpdateListenerActions.ON_PEER_UPDATE:
772
- this.onPeerDelegate = null;
773
- break;
1358
+ {
1359
+ const subscription = this.emitterSubscriptions[_HMSUpdateListenerActions.HMSUpdateListenerActions.ON_PEER_UPDATE];
1360
+ // Removing ON_PEER_UPDATE native listener
1361
+ if (subscription) {
1362
+ subscription.remove();
1363
+ this.emitterSubscriptions[_HMSUpdateListenerActions.HMSUpdateListenerActions.ON_PEER_UPDATE] = undefined;
1364
+ }
1365
+ // Removing App Delegate listener
1366
+ this.onPeerDelegate = null;
1367
+ break;
1368
+ }
774
1369
  case _HMSUpdateListenerActions.HMSUpdateListenerActions.ON_TRACK_UPDATE:
775
- this.onTrackDelegate = null;
776
- break;
1370
+ {
1371
+ const subscription = this.emitterSubscriptions[_HMSUpdateListenerActions.HMSUpdateListenerActions.ON_TRACK_UPDATE];
1372
+ // Removing ON_TRACK_UPDATE native listener
1373
+ if (subscription) {
1374
+ subscription.remove();
1375
+ this.emitterSubscriptions[_HMSUpdateListenerActions.HMSUpdateListenerActions.ON_TRACK_UPDATE] = undefined;
1376
+ }
1377
+ // Removing App Delegate listener
1378
+ this.onTrackDelegate = null;
1379
+ break;
1380
+ }
777
1381
  case _HMSUpdateListenerActions.HMSUpdateListenerActions.ON_ERROR:
778
- this.onErrorDelegate = null;
779
- break;
1382
+ {
1383
+ const subscription = this.emitterSubscriptions[_HMSUpdateListenerActions.HMSUpdateListenerActions.ON_ERROR];
1384
+ // Removing ON_ERROR native listener
1385
+ if (subscription) {
1386
+ subscription.remove();
1387
+ this.emitterSubscriptions[_HMSUpdateListenerActions.HMSUpdateListenerActions.ON_ERROR] = undefined;
1388
+ }
1389
+ // Removing App Delegate listener
1390
+ this.onErrorDelegate = null;
1391
+ break;
1392
+ }
780
1393
  case _HMSUpdateListenerActions.HMSUpdateListenerActions.ON_MESSAGE:
781
- this.onMessageDelegate = null;
782
- break;
1394
+ {
1395
+ const subscription = this.emitterSubscriptions[_HMSUpdateListenerActions.HMSUpdateListenerActions.ON_MESSAGE];
1396
+ // Removing ON_MESSAGE native listener
1397
+ if (subscription) {
1398
+ subscription.remove();
1399
+ this.emitterSubscriptions[_HMSUpdateListenerActions.HMSUpdateListenerActions.ON_MESSAGE] = undefined;
1400
+ }
1401
+ // Removing App Delegate listener
1402
+ this.onMessageDelegate = null;
1403
+ break;
1404
+ }
783
1405
  case _HMSUpdateListenerActions.HMSUpdateListenerActions.ON_SPEAKER:
784
- this.onSpeakerDelegate = null;
785
- break;
1406
+ {
1407
+ const subscription = this.emitterSubscriptions[_HMSUpdateListenerActions.HMSUpdateListenerActions.ON_SPEAKER];
1408
+ // Removing ON_SPEAKER native listener
1409
+ if (subscription) {
1410
+ subscription.remove();
1411
+ this.emitterSubscriptions[_HMSUpdateListenerActions.HMSUpdateListenerActions.ON_SPEAKER] = undefined;
1412
+ }
1413
+ // Removing App Delegate listener
1414
+ this.onSpeakerDelegate = null;
1415
+ break;
1416
+ }
786
1417
  case _HMSUpdateListenerActions.HMSUpdateListenerActions.RECONNECTING:
787
- this.onReconnectingDelegate = null;
788
- break;
1418
+ {
1419
+ const subscription = this.emitterSubscriptions[_HMSUpdateListenerActions.HMSUpdateListenerActions.RECONNECTING];
1420
+ // Removing RECONNECTING native listener
1421
+ if (subscription) {
1422
+ subscription.remove();
1423
+ this.emitterSubscriptions[_HMSUpdateListenerActions.HMSUpdateListenerActions.RECONNECTING] = undefined;
1424
+ }
1425
+ // Removing App Delegate listener
1426
+ this.onReconnectingDelegate = null;
1427
+ break;
1428
+ }
789
1429
  case _HMSUpdateListenerActions.HMSUpdateListenerActions.RECONNECTED:
790
- this.onReconnectedDelegate = null;
791
- break;
1430
+ {
1431
+ const subscription = this.emitterSubscriptions[_HMSUpdateListenerActions.HMSUpdateListenerActions.RECONNECTED];
1432
+ // Removing RECONNECTED native listener
1433
+ if (subscription) {
1434
+ subscription.remove();
1435
+ this.emitterSubscriptions[_HMSUpdateListenerActions.HMSUpdateListenerActions.RECONNECTED] = undefined;
1436
+ }
1437
+ // Removing App Delegate listener
1438
+ this.onReconnectedDelegate = null;
1439
+ break;
1440
+ }
792
1441
  case _HMSUpdateListenerActions.HMSUpdateListenerActions.ON_ROLE_CHANGE_REQUEST:
793
- this.onRoleChangeRequestDelegate = null;
794
- break;
1442
+ {
1443
+ const subscription = this.emitterSubscriptions[_HMSUpdateListenerActions.HMSUpdateListenerActions.ON_ROLE_CHANGE_REQUEST];
1444
+ // Removing ON_ROLE_CHANGE_REQUEST native listener
1445
+ if (subscription) {
1446
+ subscription.remove();
1447
+ this.emitterSubscriptions[_HMSUpdateListenerActions.HMSUpdateListenerActions.ON_ROLE_CHANGE_REQUEST] = undefined;
1448
+ }
1449
+ // Removing App Delegate listener
1450
+ this.onRoleChangeRequestDelegate = null;
1451
+ break;
1452
+ }
795
1453
  case _HMSUpdateListenerActions.HMSUpdateListenerActions.ON_CHANGE_TRACK_STATE_REQUEST:
796
- this.onChangeTrackStateRequestDelegate = null;
797
- break;
1454
+ {
1455
+ const subscription = this.emitterSubscriptions[_HMSUpdateListenerActions.HMSUpdateListenerActions.ON_CHANGE_TRACK_STATE_REQUEST];
1456
+ // Removing ON_CHANGE_TRACK_STATE_REQUEST native listener
1457
+ if (subscription) {
1458
+ subscription.remove();
1459
+ this.emitterSubscriptions[_HMSUpdateListenerActions.HMSUpdateListenerActions.ON_CHANGE_TRACK_STATE_REQUEST] = undefined;
1460
+ }
1461
+ // Removing App Delegate listener
1462
+ this.onChangeTrackStateRequestDelegate = null;
1463
+ break;
1464
+ }
798
1465
  case _HMSUpdateListenerActions.HMSUpdateListenerActions.ON_REMOVED_FROM_ROOM:
799
- this.onRemovedFromRoomDelegate = null;
800
- break;
1466
+ {
1467
+ const subscription = this.emitterSubscriptions[_HMSUpdateListenerActions.HMSUpdateListenerActions.ON_REMOVED_FROM_ROOM];
1468
+ // Removing ON_REMOVED_FROM_ROOM native listener
1469
+ if (subscription) {
1470
+ subscription.remove();
1471
+ this.emitterSubscriptions[_HMSUpdateListenerActions.HMSUpdateListenerActions.ON_REMOVED_FROM_ROOM] = undefined;
1472
+ }
1473
+ // Removing App Delegate listener
1474
+ this.onRemovedFromRoomDelegate = null;
1475
+ break;
1476
+ }
801
1477
  case _HMSUpdateListenerActions.HMSUpdateListenerActions.ON_RTC_STATS:
802
- this.onRtcStatsDelegate = null;
803
- break;
1478
+ {
1479
+ const subscription = this.emitterSubscriptions[_HMSUpdateListenerActions.HMSUpdateListenerActions.ON_RTC_STATS];
1480
+ // Removing ON_RTC_STATS native listener
1481
+ if (subscription) {
1482
+ subscription.remove();
1483
+ this.emitterSubscriptions[_HMSUpdateListenerActions.HMSUpdateListenerActions.ON_RTC_STATS] = undefined;
1484
+ }
1485
+ // Removing App Delegate listener
1486
+ this.onRtcStatsDelegate = null;
1487
+ break;
1488
+ }
804
1489
  case _HMSUpdateListenerActions.HMSUpdateListenerActions.ON_LOCAL_AUDIO_STATS:
805
- this.onLocalAudioStatsDelegate = null;
806
- break;
1490
+ {
1491
+ const subscription = this.emitterSubscriptions[_HMSUpdateListenerActions.HMSUpdateListenerActions.ON_LOCAL_AUDIO_STATS];
1492
+ // Removing ON_LOCAL_AUDIO_STATS native listener
1493
+ if (subscription) {
1494
+ subscription.remove();
1495
+ this.emitterSubscriptions[_HMSUpdateListenerActions.HMSUpdateListenerActions.ON_LOCAL_AUDIO_STATS] = undefined;
1496
+ }
1497
+ // Removing App Delegate listener
1498
+ this.onLocalAudioStatsDelegate = null;
1499
+ break;
1500
+ }
807
1501
  case _HMSUpdateListenerActions.HMSUpdateListenerActions.ON_LOCAL_VIDEO_STATS:
808
- this.onLocalVideoStatsDelegate = null;
809
- break;
1502
+ {
1503
+ const subscription = this.emitterSubscriptions[_HMSUpdateListenerActions.HMSUpdateListenerActions.ON_LOCAL_VIDEO_STATS];
1504
+ // Removing ON_LOCAL_VIDEO_STATS native listener
1505
+ if (subscription) {
1506
+ subscription.remove();
1507
+ this.emitterSubscriptions[_HMSUpdateListenerActions.HMSUpdateListenerActions.ON_LOCAL_VIDEO_STATS] = undefined;
1508
+ }
1509
+ // Removing App Delegate listener
1510
+ this.onLocalVideoStatsDelegate = null;
1511
+ break;
1512
+ }
810
1513
  case _HMSUpdateListenerActions.HMSUpdateListenerActions.ON_REMOTE_AUDIO_STATS:
811
- this.onRemoteAudioStatsDelegate = null;
812
- break;
1514
+ {
1515
+ const subscription = this.emitterSubscriptions[_HMSUpdateListenerActions.HMSUpdateListenerActions.ON_REMOTE_AUDIO_STATS];
1516
+ // Removing ON_REMOTE_AUDIO_STATS native listener
1517
+ if (subscription) {
1518
+ subscription.remove();
1519
+ this.emitterSubscriptions[_HMSUpdateListenerActions.HMSUpdateListenerActions.ON_REMOTE_AUDIO_STATS] = undefined;
1520
+ }
1521
+ // Removing App Delegate listener
1522
+ this.onRemoteAudioStatsDelegate = null;
1523
+ break;
1524
+ }
813
1525
  case _HMSUpdateListenerActions.HMSUpdateListenerActions.ON_REMOTE_VIDEO_STATS:
814
- this.onRemoteVideoStatsDelegate = null;
815
- break;
1526
+ {
1527
+ const subscription = this.emitterSubscriptions[_HMSUpdateListenerActions.HMSUpdateListenerActions.ON_REMOTE_VIDEO_STATS];
1528
+ // Removing ON_REMOTE_VIDEO_STATS native listener
1529
+ if (subscription) {
1530
+ subscription.remove();
1531
+ this.emitterSubscriptions[_HMSUpdateListenerActions.HMSUpdateListenerActions.ON_REMOTE_VIDEO_STATS] = undefined;
1532
+ }
1533
+ // Removing App Delegate listener
1534
+ this.onRemoteVideoStatsDelegate = null;
1535
+ break;
1536
+ }
816
1537
  case _HMSUpdateListenerActions.HMSUpdateListenerActions.ON_AUDIO_DEVICE_CHANGED:
817
- this.onAudioDeviceChangedDelegate = null;
818
- break;
1538
+ {
1539
+ const subscription = this.emitterSubscriptions[_HMSUpdateListenerActions.HMSUpdateListenerActions.ON_AUDIO_DEVICE_CHANGED];
1540
+ // Removing ON_AUDIO_DEVICE_CHANGED native listener
1541
+ if (subscription) {
1542
+ subscription.remove();
1543
+ this.emitterSubscriptions[_HMSUpdateListenerActions.HMSUpdateListenerActions.ON_AUDIO_DEVICE_CHANGED] = undefined;
1544
+ }
1545
+ // Removing App Delegate listener
1546
+ this.onAudioDeviceChangedDelegate = null;
1547
+ break;
1548
+ }
819
1549
  case _HMSPIPListenerActions.HMSPIPListenerActions.ON_PIP_ROOM_LEAVE:
820
- this.onPIPRoomLeaveDelegate = null;
821
- break;
1550
+ {
1551
+ if (_reactNative.Platform.OS === 'android') {
1552
+ const subscription = this.emitterSubscriptions[_HMSPIPListenerActions.HMSPIPListenerActions.ON_PIP_ROOM_LEAVE];
1553
+ // Removing ON_PIP_ROOM_LEAVE native listener
1554
+ if (subscription) {
1555
+ subscription.remove();
1556
+ this.emitterSubscriptions[_HMSPIPListenerActions.HMSPIPListenerActions.ON_PIP_ROOM_LEAVE] = undefined;
1557
+ }
1558
+ // Removing App Delegate listener
1559
+ this.onPIPRoomLeaveDelegate = null;
1560
+ }
1561
+ break;
1562
+ }
822
1563
  default:
823
1564
  }
824
1565
  });
1566
+ /**
1567
+ * removes all the listeners
1568
+ *
1569
+ * @memberof HMSSDK
1570
+ */
825
1571
  _defineProperty(this, "removeAllListeners", () => {
826
1572
  this.onPreviewDelegate = null;
827
1573
  this.onJoinDelegate = null;
@@ -837,10 +1583,32 @@ class HMSSDK {
837
1583
  this.onChangeTrackStateRequestDelegate = null;
838
1584
  this.onRemovedFromRoomDelegate = null;
839
1585
  this.onPIPRoomLeaveDelegate = null;
1586
+
1587
+ // Getting list of all available `emitterSubscription` objects
1588
+ Object.values(this.emitterSubscriptions).filter(Boolean).forEach(emitterSubscription => {
1589
+ emitterSubscription.remove();
1590
+ });
1591
+
1592
+ // clearing reference of all `emitterSubscription` objects
1593
+ this.emitterSubscriptions = {};
840
1594
  _HMSLogger.logger === null || _HMSLogger.logger === void 0 ? void 0 : _HMSLogger.logger.verbose('#Function REMOVE_ALL_LISTENER', {
841
1595
  id: this.id
842
1596
  });
843
1597
  });
1598
+ /**
1599
+ * - Below are all the listeners that are connected to native side.
1600
+ *
1601
+ * - All of the are connected when build function is called, we can connect them to the app by
1602
+ * calling {@link addEventListener} with corresponding event type.
1603
+ *
1604
+ * - Before passing the data to the eventListener of the app these listeners encode the data in
1605
+ * ts classes for a proper structuring of the data.
1606
+ *
1607
+ * - Even When event listeners of the app are disconnected using {@link removeEventListener} or
1608
+ * {@link removeAllListeners} or not even connected in first place, these functions still run to
1609
+ * maintain the current state of the instance of {@link HMSSDK}.
1610
+ *
1611
+ */
844
1612
  _defineProperty(this, "onPreviewListener", data => {
845
1613
  if (data.id !== this.id) {
846
1614
  return;
@@ -873,11 +1641,13 @@ class HMSSDK {
873
1641
  }
874
1642
  });
875
1643
  _defineProperty(this, "onRoomListener", data => {
1644
+ var _getHmsRoomCache2;
876
1645
  if (data.id !== this.id) {
877
1646
  return;
878
1647
  }
879
1648
  const room = _HMSEncoder.HMSEncoder.encodeHmsRoom(data.room, this.id);
880
1649
  const type = data.type;
1650
+ (_getHmsRoomCache2 = (0, _HMSRoomCache.getHmsRoomCache)()) === null || _getHmsRoomCache2 === void 0 ? void 0 : _getHmsRoomCache2.updateRoomCache(data.room, data.type);
881
1651
  if (this.onRoomDelegate) {
882
1652
  _HMSLogger.logger === null || _HMSLogger.logger === void 0 ? void 0 : _HMSLogger.logger.verbose('#Listener ON_ROOM_LISTENER_CALL', {
883
1653
  room,
@@ -889,12 +1659,22 @@ class HMSSDK {
889
1659
  });
890
1660
  }
891
1661
  });
892
- _defineProperty(this, "onPeerListener", data => {
893
- if (data.id !== this.id) {
894
- return;
1662
+ _defineProperty(this, "onPeerListener", peerData => {
1663
+ var _getHmsPeersCache;
1664
+ const data = {
1665
+ peer: peerData,
1666
+ type: null
1667
+ };
1668
+ for (const ordinal of _HMSPeerUpdate.HMSPeerUpdateOrdinals.keys()) {
1669
+ if (ordinal in peerData) {
1670
+ data.peer.peerID = peerData[ordinal];
1671
+ data.type = ordinal;
1672
+ break;
1673
+ }
895
1674
  }
896
- const peer = _HMSEncoder.HMSEncoder.encodeHmsPeer(data.peer, this.id);
897
- const type = data.type;
1675
+ const peer = _HMSEncoder.HMSEncoder.encodeHmsPeer(data.peer);
1676
+ const type = _HMSEncoder.HMSEncoder.encodeHmsPeerUpdate(data.type) || data.type;
1677
+ (_getHmsPeersCache = (0, _HMSPeersCache.getHmsPeersCache)()) === null || _getHmsPeersCache === void 0 ? void 0 : _getHmsPeersCache.updatePeerCache(data.peer.peerID, data.peer, type);
898
1678
  if (this.onPeerDelegate) {
899
1679
  _HMSLogger.logger === null || _HMSLogger.logger === void 0 ? void 0 : _HMSLogger.logger.verbose('#Listener ON_PEER_LISTENER_CALL', {
900
1680
  peer,
@@ -907,12 +1687,16 @@ class HMSSDK {
907
1687
  }
908
1688
  });
909
1689
  _defineProperty(this, "onTrackListener", data => {
1690
+ var _getHmsPeersCache2;
910
1691
  if (data.id !== this.id) {
911
1692
  return;
912
1693
  }
913
1694
  const track = _HMSEncoder.HMSEncoder.encodeHmsTrack(data.track, this.id);
914
- const peer = _HMSEncoder.HMSEncoder.encodeHmsPeer(data.peer, this.id);
1695
+ const peer = _HMSEncoder.HMSEncoder.encodeHmsPeer(data.peer);
915
1696
  const type = data.type;
1697
+ (_getHmsPeersCache2 = (0, _HMSPeersCache.getHmsPeersCache)()) === null || _getHmsPeersCache2 === void 0 ? void 0 : _getHmsPeersCache2.updatePeerCache(data.peer.peerID, {
1698
+ track
1699
+ }, data.type);
916
1700
  if (this.muteStatus && (data === null || data === void 0 ? void 0 : data.type) === 'TRACK_ADDED' && track.type === _HMSTrackType.HMSTrackType.AUDIO) {
917
1701
  this.setPlaybackForAllAudio(this.muteStatus);
918
1702
  }
@@ -933,7 +1717,7 @@ class HMSSDK {
933
1717
  if (data.id !== this.id) {
934
1718
  return;
935
1719
  }
936
- const message = _HMSEncoder.HMSEncoder.encodeHMSMessage(data, this.id);
1720
+ const message = _HMSEncoder.HMSEncoder.encodeHMSMessage(data);
937
1721
  if (this.onMessageDelegate) {
938
1722
  _HMSLogger.logger === null || _HMSLogger.logger === void 0 ? void 0 : _HMSLogger.logger.verbose('#Listener ON_MESSAGE_LISTENER_CALL', message);
939
1723
  this.onMessageDelegate(message);
@@ -963,7 +1747,7 @@ class HMSSDK {
963
1747
  return;
964
1748
  }
965
1749
  if (this.onRoleChangeRequestDelegate) {
966
- const encodedRoleChangeRequest = _HMSEncoder.HMSEncoder.encodeHmsRoleChangeRequest(data, this.id);
1750
+ const encodedRoleChangeRequest = _HMSEncoder.HMSEncoder.encodeHmsRoleChangeRequest(data);
967
1751
  _HMSLogger.logger === null || _HMSLogger.logger === void 0 ? void 0 : _HMSLogger.logger.verbose('#Listener ON_ROLE_CHANGE_LISTENER_CALL', encodedRoleChangeRequest);
968
1752
  this.onRoleChangeRequestDelegate(encodedRoleChangeRequest);
969
1753
  }
@@ -973,7 +1757,7 @@ class HMSSDK {
973
1757
  return;
974
1758
  }
975
1759
  if (this.onChangeTrackStateRequestDelegate) {
976
- const encodedRoleChangeRequest = _HMSEncoder.HMSEncoder.encodeHmsChangeTrackStateRequest(data, this.id);
1760
+ const encodedRoleChangeRequest = _HMSEncoder.HMSEncoder.encodeHmsChangeTrackStateRequest(data);
977
1761
  _HMSLogger.logger === null || _HMSLogger.logger === void 0 ? void 0 : _HMSLogger.logger.verbose('#Listener ON_CHANGE_TRACK_STATE_REQUEST_LISTENER_CALL', encodedRoleChangeRequest);
978
1762
  this.onChangeTrackStateRequestDelegate(encodedRoleChangeRequest);
979
1763
  }
@@ -982,10 +1766,11 @@ class HMSSDK {
982
1766
  if (data.id !== this.id) {
983
1767
  return;
984
1768
  }
1769
+ this.roomLeaveCleanup();
985
1770
  if (this.onRemovedFromRoomDelegate) {
986
1771
  let requestedBy = null;
987
1772
  if (data.requestedBy) {
988
- requestedBy = _HMSEncoder.HMSEncoder.encodeHmsPeer(data.requestedBy, this.id);
1773
+ requestedBy = _HMSEncoder.HMSEncoder.encodeHmsPeer(data.requestedBy);
989
1774
  }
990
1775
  const reason = data.reason;
991
1776
  const roomEnded = data.roomEnded;
@@ -1039,7 +1824,7 @@ class HMSSDK {
1039
1824
  return;
1040
1825
  }
1041
1826
  let localAudioStats = new _HMSLocalAudioStats.HMSLocalAudioStats(data.localAudioStats);
1042
- let peer = _HMSEncoder.HMSEncoder.encodeHmsPeer(data.peer, this.id);
1827
+ let peer = _HMSEncoder.HMSEncoder.encodeHmsPeer(data.peer);
1043
1828
  let track = _HMSEncoder.HMSEncoder.encodeHmsLocalAudioTrack(data.track, this.id);
1044
1829
  if (this.onLocalAudioStatsDelegate) {
1045
1830
  _HMSLogger.logger === null || _HMSLogger.logger === void 0 ? void 0 : _HMSLogger.logger.verbose('#Listener onLocalAudioStatsListener_CALL', {
@@ -1061,7 +1846,7 @@ class HMSSDK {
1061
1846
  return;
1062
1847
  }
1063
1848
  let localVideoStats = new _HMSLocalVideoStats.HMSLocalVideoStats(data.localVideoStats);
1064
- let peer = _HMSEncoder.HMSEncoder.encodeHmsPeer(data.peer, this.id);
1849
+ let peer = _HMSEncoder.HMSEncoder.encodeHmsPeer(data.peer);
1065
1850
  let track = _HMSEncoder.HMSEncoder.encodeHmsLocalVideoTrack(data.track, this.id);
1066
1851
  if (this.onLocalVideoStatsDelegate) {
1067
1852
  _HMSLogger.logger === null || _HMSLogger.logger === void 0 ? void 0 : _HMSLogger.logger.verbose('#Listener onLocalVideoStatsListener_CALL', {
@@ -1083,7 +1868,7 @@ class HMSSDK {
1083
1868
  return;
1084
1869
  }
1085
1870
  let remoteAudioStats = new _HMSRemoteAudioStats.HMSRemoteAudioStats(data.remoteAudioStats);
1086
- let peer = _HMSEncoder.HMSEncoder.encodeHmsPeer(data.peer, this.id);
1871
+ let peer = _HMSEncoder.HMSEncoder.encodeHmsPeer(data.peer);
1087
1872
  let track = _HMSEncoder.HMSEncoder.encodeHmsRemoteAudioTrack(data.track, this.id);
1088
1873
  if (this.onRemoteAudioStatsDelegate) {
1089
1874
  _HMSLogger.logger === null || _HMSLogger.logger === void 0 ? void 0 : _HMSLogger.logger.verbose('#Listener onRemoteAudioStatsListener_CALL', {
@@ -1105,7 +1890,7 @@ class HMSSDK {
1105
1890
  return;
1106
1891
  }
1107
1892
  let remoteVideoStats = new _HMSRemoteVideoStats.HMSRemoteVideoStats(data.remoteVideoStats);
1108
- let peer = _HMSEncoder.HMSEncoder.encodeHmsPeer(data.peer, this.id);
1893
+ let peer = _HMSEncoder.HMSEncoder.encodeHmsPeer(data.peer);
1109
1894
  let track = _HMSEncoder.HMSEncoder.encodeHmsRemoteVideoTrack(data.track, this.id);
1110
1895
  if (this.onRemoteVideoStatsDelegate) {
1111
1896
  _HMSLogger.logger === null || _HMSLogger.logger === void 0 ? void 0 : _HMSLogger.logger.verbose('#Listener onRemoteVideoStatsListener_CALL', {
@@ -1134,12 +1919,10 @@ class HMSSDK {
1134
1919
  }
1135
1920
  });
1136
1921
  _defineProperty(this, "onPIPRoomLeaveListener", data => {
1137
- var _this$appStateSubscri2;
1138
1922
  if (data.id !== this.id) {
1139
1923
  return;
1140
1924
  }
1141
- this.muteStatus = undefined;
1142
- this === null || this === void 0 ? void 0 : (_this$appStateSubscri2 = this.appStateSubscription) === null || _this$appStateSubscri2 === void 0 ? void 0 : _this$appStateSubscri2.remove();
1925
+ this.roomLeaveCleanup();
1143
1926
  if (this.onPIPRoomLeaveDelegate) {
1144
1927
  _HMSLogger.logger === null || _HMSLogger.logger === void 0 ? void 0 : _HMSLogger.logger.verbose('#Listener onPIPRoomLeave_CALL', data);
1145
1928
  this.onPIPRoomLeaveDelegate({
@@ -1189,7 +1972,6 @@ class HMSSDK {
1189
1972
  logSettings: params === null || params === void 0 ? void 0 : params.logSettings
1190
1973
  });
1191
1974
  HmsSdk = new HMSSDK(id);
1192
- HmsSdk.attachListeners();
1193
1975
  return HmsSdk;
1194
1976
  }
1195
1977
 
@@ -1201,13 +1983,6 @@ class HMSSDK {
1201
1983
  static getLogger() {
1202
1984
  return (0, _HMSLogger.getLogger)();
1203
1985
  }
1204
-
1205
- /**
1206
- * - Updates the logger for this instance of HMSSDK
1207
- * @param {HMSLogger} hmsLogger
1208
- * @memberof HMSSDK
1209
- */
1210
-
1211
1986
  async isPipModeSupported() {
1212
1987
  return HMSManager.handlePipActions('isPipModeSupported', {
1213
1988
  id: this.id