@100mslive/react-native-hms 2.0.0-alpha.0 → 2.0.0-alpha.1

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 (960) hide show
  1. package/README.md +21 -15
  2. package/android/build.gradle +95 -48
  3. package/android/src/main/java/com/reactnativehmssdk/HMSAudioshareActivity.kt +8 -10
  4. package/android/src/main/java/com/reactnativehmssdk/HMSDecoder.kt +177 -3
  5. package/android/src/main/java/com/reactnativehmssdk/HMSHLSPlayer.kt +149 -29
  6. package/android/src/main/java/com/reactnativehmssdk/HMSHLSPlayerManagerImpl.kt +185 -0
  7. package/android/src/main/java/com/reactnativehmssdk/HMSHelper.kt +80 -20
  8. package/android/src/main/java/com/reactnativehmssdk/{HMSManager.kt → HMSManagerImpl.kt} +517 -145
  9. package/android/src/main/java/com/reactnativehmssdk/HMSRNSDK.kt +503 -312
  10. package/android/src/main/java/com/reactnativehmssdk/HMSReactNativeEvent.kt +29 -0
  11. package/android/src/main/java/com/reactnativehmssdk/HMSSDKViewManagerImpl.kt +119 -0
  12. package/android/src/main/java/com/reactnativehmssdk/HMSView.kt +64 -12
  13. package/android/src/main/java/com/reactnativehmssdk/HmsScreenshareActivity.kt +9 -9
  14. package/android/src/main/java/com/reactnativehmssdk/HmssdkPackage.kt +44 -8
  15. package/android/src/main/java/com/reactnativehmssdk/Interactivity/HMSInteractivityDecoder.kt +435 -0
  16. package/android/src/main/java/com/reactnativehmssdk/Interactivity/HMSInteractivityHelper.kt +353 -0
  17. package/android/src/main/java/com/reactnativehmssdk/Interactivity/HMSRNInteractivityCenter.kt +245 -0
  18. package/android/src/main/java/com/reactnativehmssdk/PipActionReceiver.kt +13 -3
  19. package/android/src/newarch/java/com/reactnativehmssdk/HMSHLSPlayerManager.kt +128 -0
  20. package/android/src/newarch/java/com/reactnativehmssdk/HMSManager.kt +332 -0
  21. package/android/src/newarch/java/com/reactnativehmssdk/HMSSDKViewManager.kt +102 -0
  22. package/android/src/oldarch/java/com/reactnativehmssdk/HMSHLSPlayerManager.kt +61 -0
  23. package/android/src/oldarch/java/com/reactnativehmssdk/HMSManager.kt +351 -0
  24. package/android/src/oldarch/java/com/reactnativehmssdk/HMSSDKViewManager.kt +87 -0
  25. package/ios/HMSConstants.swift +4 -0
  26. package/ios/HMSDecoder.swift +154 -18
  27. package/ios/HMSHLSPlayerComponentView.mm +325 -0
  28. package/ios/HMSHLSPlayerManager.m +16 -0
  29. package/ios/HMSHLSPlayerManager.swift +236 -70
  30. package/ios/HMSHelper.swift +126 -14
  31. package/ios/HMSInteractivityDecoder.swift +314 -0
  32. package/ios/HMSInteractivityHelper.swift +169 -0
  33. package/ios/HMSManager.m +203 -10
  34. package/ios/HMSManager.mm +365 -0
  35. package/ios/HMSManager.swift +431 -87
  36. package/ios/HMSRNInteractivityCenter.swift +161 -0
  37. package/ios/HMSRNSDK.swift +961 -134
  38. package/ios/HMSView.m +9 -0
  39. package/ios/HMSView.swift +45 -16
  40. package/ios/HMSViewComponentView.mm +229 -0
  41. package/ios/PIPMode/HMSPipModel.swift +18 -0
  42. package/ios/PIPMode/HMSPipView.swift +36 -0
  43. package/ios/PIPMode/HMSSampleBufferSwiftUIView.swift +45 -0
  44. package/lib/commonjs/classes/HMSAudioCodec.js +1 -2
  45. package/lib/commonjs/classes/HMSAudioCodec.js.map +1 -1
  46. package/lib/commonjs/classes/HMSAudioDevice.js +10 -2
  47. package/lib/commonjs/classes/HMSAudioDevice.js.map +1 -1
  48. package/lib/commonjs/classes/HMSAudioFilePlayerNode.js.map +1 -1
  49. package/lib/commonjs/classes/HMSAudioMixerSource.js +3 -3
  50. package/lib/commonjs/classes/HMSAudioMixerSource.js.map +1 -1
  51. package/lib/commonjs/classes/HMSAudioMixingMode.js +12 -2
  52. package/lib/commonjs/classes/HMSAudioMixingMode.js.map +1 -1
  53. package/lib/commonjs/classes/HMSAudioMode.js +1 -2
  54. package/lib/commonjs/classes/HMSAudioMode.js.map +1 -1
  55. package/lib/commonjs/classes/HMSAudioNode.js +3 -3
  56. package/lib/commonjs/classes/HMSAudioNode.js.map +1 -1
  57. package/lib/commonjs/classes/HMSAudioSettings.js +3 -3
  58. package/lib/commonjs/classes/HMSAudioSettings.js.map +1 -1
  59. package/lib/commonjs/classes/HMSAudioTrack.js +9 -0
  60. package/lib/commonjs/classes/HMSAudioTrack.js.map +1 -1
  61. package/lib/commonjs/classes/HMSAudioTrackSettings.js +12 -5
  62. package/lib/commonjs/classes/HMSAudioTrackSettings.js.map +1 -1
  63. package/lib/commonjs/classes/HMSBrowserRecordingState.js +5 -3
  64. package/lib/commonjs/classes/HMSBrowserRecordingState.js.map +1 -1
  65. package/lib/commonjs/classes/HMSCameraControl.js +3 -4
  66. package/lib/commonjs/classes/HMSCameraControl.js.map +1 -1
  67. package/lib/commonjs/classes/HMSCameraFacing.js +10 -2
  68. package/lib/commonjs/classes/HMSCameraFacing.js.map +1 -1
  69. package/lib/commonjs/classes/HMSChangeTrackStateRequest.js +3 -3
  70. package/lib/commonjs/classes/HMSChangeTrackStateRequest.js.map +1 -1
  71. package/lib/commonjs/classes/HMSConfig.js +30 -3
  72. package/lib/commonjs/classes/HMSConfig.js.map +1 -1
  73. package/lib/commonjs/classes/HMSConstants.js +1 -2
  74. package/lib/commonjs/classes/HMSConstants.js.map +1 -1
  75. package/lib/commonjs/classes/HMSEncoder.js +57 -14
  76. package/lib/commonjs/classes/HMSEncoder.js.map +1 -1
  77. package/lib/commonjs/classes/HMSEventEmitter.js +1 -2
  78. package/lib/commonjs/classes/HMSEventEmitter.js.map +1 -1
  79. package/lib/commonjs/classes/HMSException.js +21 -3
  80. package/lib/commonjs/classes/HMSException.js.map +1 -1
  81. package/lib/commonjs/classes/HMSHLSConfig.js +3 -3
  82. package/lib/commonjs/classes/HMSHLSConfig.js.map +1 -1
  83. package/lib/commonjs/classes/HMSHLSMeetingURLVariant.js +3 -3
  84. package/lib/commonjs/classes/HMSHLSMeetingURLVariant.js.map +1 -1
  85. package/lib/commonjs/classes/HMSHLSPlaylistType.js +12 -0
  86. package/lib/commonjs/classes/HMSHLSPlaylistType.js.map +1 -0
  87. package/lib/commonjs/classes/HMSHLSRecordingConfig.js +3 -3
  88. package/lib/commonjs/classes/HMSHLSRecordingConfig.js.map +1 -1
  89. package/lib/commonjs/classes/HMSHLSRecordingState.js +7 -7
  90. package/lib/commonjs/classes/HMSHLSRecordingState.js.map +1 -1
  91. package/lib/commonjs/classes/HMSHLSStreamingState.js +9 -3
  92. package/lib/commonjs/classes/HMSHLSStreamingState.js.map +1 -1
  93. package/lib/commonjs/classes/HMSHLSTimedMetadata.js +2 -0
  94. package/lib/commonjs/classes/HMSHLSTimedMetadata.js.map +1 -0
  95. package/lib/commonjs/classes/HMSHLSVariant.js +5 -3
  96. package/lib/commonjs/classes/HMSHLSVariant.js.map +1 -1
  97. package/lib/commonjs/classes/HMSHelper.js.map +1 -1
  98. package/lib/commonjs/classes/HMSIOSAudioMode.js +16 -2
  99. package/lib/commonjs/classes/HMSIOSAudioMode.js.map +1 -1
  100. package/lib/commonjs/classes/HMSInteractivityCenter.js +174 -0
  101. package/lib/commonjs/classes/HMSInteractivityCenter.js.map +1 -0
  102. package/lib/commonjs/classes/HMSInteractivityEncoder.js +83 -0
  103. package/lib/commonjs/classes/HMSInteractivityEncoder.js.map +1 -0
  104. package/lib/commonjs/classes/HMSLayer.js +1 -2
  105. package/lib/commonjs/classes/HMSLayer.js.map +1 -1
  106. package/lib/commonjs/classes/HMSLocalAudioStats.js +3 -3
  107. package/lib/commonjs/classes/HMSLocalAudioStats.js.map +1 -1
  108. package/lib/commonjs/classes/HMSLocalAudioTrack.js +3 -3
  109. package/lib/commonjs/classes/HMSLocalAudioTrack.js.map +1 -1
  110. package/lib/commonjs/classes/HMSLocalPeer.js +3 -3
  111. package/lib/commonjs/classes/HMSLocalPeer.js.map +1 -1
  112. package/lib/commonjs/classes/HMSLocalVideoStats.js +3 -3
  113. package/lib/commonjs/classes/HMSLocalVideoStats.js.map +1 -1
  114. package/lib/commonjs/classes/HMSLocalVideoTrack.js +3 -3
  115. package/lib/commonjs/classes/HMSLocalVideoTrack.js.map +1 -1
  116. package/lib/commonjs/classes/HMSLogAlarmManager.js +13 -2
  117. package/lib/commonjs/classes/HMSLogAlarmManager.js.map +1 -1
  118. package/lib/commonjs/classes/HMSLogLevel.js +13 -2
  119. package/lib/commonjs/classes/HMSLogLevel.js.map +1 -1
  120. package/lib/commonjs/classes/HMSLogSettings.js +17 -3
  121. package/lib/commonjs/classes/HMSLogSettings.js.map +1 -1
  122. package/lib/commonjs/classes/HMSLogger.js +4 -5
  123. package/lib/commonjs/classes/HMSLogger.js.map +1 -1
  124. package/lib/commonjs/classes/HMSMessage.js +3 -3
  125. package/lib/commonjs/classes/HMSMessage.js.map +1 -1
  126. package/lib/commonjs/classes/HMSMessageRecipient.js +3 -3
  127. package/lib/commonjs/classes/HMSMessageRecipient.js.map +1 -1
  128. package/lib/commonjs/classes/HMSMessageRecipientType.js +1 -2
  129. package/lib/commonjs/classes/HMSMessageRecipientType.js.map +1 -1
  130. package/lib/commonjs/classes/HMSMicNode.js.map +1 -1
  131. package/lib/commonjs/classes/HMSNativeEventEmitter.js +4 -6
  132. package/lib/commonjs/classes/HMSNativeEventEmitter.js.map +1 -1
  133. package/lib/commonjs/classes/HMSNativeEventListener.js +3 -4
  134. package/lib/commonjs/classes/HMSNativeEventListener.js.map +1 -1
  135. package/lib/commonjs/classes/HMSNetworkQuality.js +14 -3
  136. package/lib/commonjs/classes/HMSNetworkQuality.js.map +1 -1
  137. package/lib/commonjs/classes/HMSNoiseCancellationPlugin.js +158 -0
  138. package/lib/commonjs/classes/HMSNoiseCancellationPlugin.js.map +1 -0
  139. package/lib/commonjs/classes/HMSPIPConfig.js +6 -0
  140. package/lib/commonjs/classes/HMSPIPConfig.js.map +1 -0
  141. package/lib/commonjs/classes/HMSPIPListenerActions.js +10 -2
  142. package/lib/commonjs/classes/HMSPIPListenerActions.js.map +1 -1
  143. package/lib/commonjs/classes/HMSPeer.js +186 -5
  144. package/lib/commonjs/classes/HMSPeer.js.map +1 -1
  145. package/lib/commonjs/classes/HMSPeerListIterator.js +25 -7
  146. package/lib/commonjs/classes/HMSPeerListIterator.js.map +1 -1
  147. package/lib/commonjs/classes/HMSPeerListIteratorOptions.js.map +1 -1
  148. package/lib/commonjs/classes/HMSPeerType.js +24 -0
  149. package/lib/commonjs/classes/HMSPeerType.js.map +1 -0
  150. package/lib/commonjs/classes/HMSPeerUpdate.js +2 -4
  151. package/lib/commonjs/classes/HMSPeerUpdate.js.map +1 -1
  152. package/lib/commonjs/classes/HMSPeersCache.js +6 -7
  153. package/lib/commonjs/classes/HMSPeersCache.js.map +1 -1
  154. package/lib/commonjs/classes/HMSPermissions.js +11 -3
  155. package/lib/commonjs/classes/HMSPermissions.js.map +1 -1
  156. package/lib/commonjs/classes/HMSPollsListenerActions.js +11 -0
  157. package/lib/commonjs/classes/HMSPollsListenerActions.js.map +1 -0
  158. package/lib/commonjs/classes/HMSPublishSettings.js +3 -3
  159. package/lib/commonjs/classes/HMSPublishSettings.js.map +1 -1
  160. package/lib/commonjs/classes/HMSQualityLimitationReason.js +1 -2
  161. package/lib/commonjs/classes/HMSQualityLimitationReason.js.map +1 -1
  162. package/lib/commonjs/classes/HMSQualityLimitationReasons.js +3 -3
  163. package/lib/commonjs/classes/HMSQualityLimitationReasons.js.map +1 -1
  164. package/lib/commonjs/classes/HMSRTCStats.js +3 -3
  165. package/lib/commonjs/classes/HMSRTCStats.js.map +1 -1
  166. package/lib/commonjs/classes/HMSRTCStatsReport.js +3 -3
  167. package/lib/commonjs/classes/HMSRTCStatsReport.js.map +1 -1
  168. package/lib/commonjs/classes/HMSRTMPConfig.js +17 -3
  169. package/lib/commonjs/classes/HMSRTMPConfig.js.map +1 -1
  170. package/lib/commonjs/classes/HMSRecordingState.js +17 -0
  171. package/lib/commonjs/classes/HMSRecordingState.js.map +1 -0
  172. package/lib/commonjs/classes/HMSRemoteAudioStats.js +3 -3
  173. package/lib/commonjs/classes/HMSRemoteAudioStats.js.map +1 -1
  174. package/lib/commonjs/classes/HMSRemoteAudioTrack.js +3 -3
  175. package/lib/commonjs/classes/HMSRemoteAudioTrack.js.map +1 -1
  176. package/lib/commonjs/classes/HMSRemotePeer.js +3 -3
  177. package/lib/commonjs/classes/HMSRemotePeer.js.map +1 -1
  178. package/lib/commonjs/classes/HMSRemoteVideoStats.js +3 -3
  179. package/lib/commonjs/classes/HMSRemoteVideoStats.js.map +1 -1
  180. package/lib/commonjs/classes/HMSRemoteVideoTrack.js +3 -3
  181. package/lib/commonjs/classes/HMSRemoteVideoTrack.js.map +1 -1
  182. package/lib/commonjs/classes/HMSRole.js +20 -3
  183. package/lib/commonjs/classes/HMSRole.js.map +1 -1
  184. package/lib/commonjs/classes/HMSRoleChangeRequest.js +3 -3
  185. package/lib/commonjs/classes/HMSRoleChangeRequest.js.map +1 -1
  186. package/lib/commonjs/classes/HMSRoom.js +17 -4
  187. package/lib/commonjs/classes/HMSRoom.js.map +1 -1
  188. package/lib/commonjs/classes/HMSRoomCache.js +13 -7
  189. package/lib/commonjs/classes/HMSRoomCache.js.map +1 -1
  190. package/lib/commonjs/classes/HMSRoomUpdate.js +2 -2
  191. package/lib/commonjs/classes/HMSRoomUpdate.js.map +1 -1
  192. package/lib/commonjs/classes/HMSRtmpStreamingState.js +5 -5
  193. package/lib/commonjs/classes/HMSRtmpStreamingState.js.map +1 -1
  194. package/lib/commonjs/classes/HMSRtmpVideoResolution.js +16 -3
  195. package/lib/commonjs/classes/HMSRtmpVideoResolution.js.map +1 -1
  196. package/lib/commonjs/classes/HMSSDK.js +1313 -327
  197. package/lib/commonjs/classes/HMSSDK.js.map +1 -1
  198. package/lib/commonjs/classes/HMSScreenBroadcastAudioReceiverNode.js.map +1 -1
  199. package/lib/commonjs/classes/HMSServerRecordingState.js +5 -3
  200. package/lib/commonjs/classes/HMSServerRecordingState.js.map +1 -1
  201. package/lib/commonjs/classes/HMSSessionStore.js +20 -23
  202. package/lib/commonjs/classes/HMSSessionStore.js.map +1 -1
  203. package/lib/commonjs/classes/HMSSimulcastLayerDefinition.js +3 -3
  204. package/lib/commonjs/classes/HMSSimulcastLayerDefinition.js.map +1 -1
  205. package/lib/commonjs/classes/HMSSimulcastLayerSettings.js +3 -3
  206. package/lib/commonjs/classes/HMSSimulcastLayerSettings.js.map +1 -1
  207. package/lib/commonjs/classes/HMSSimulcastLayerSettingsPolicy.js +3 -3
  208. package/lib/commonjs/classes/HMSSimulcastLayerSettingsPolicy.js.map +1 -1
  209. package/lib/commonjs/classes/HMSSimulcastSettings.js +3 -3
  210. package/lib/commonjs/classes/HMSSimulcastSettings.js.map +1 -1
  211. package/lib/commonjs/classes/HMSSimulcastSettingsPolicy.js +3 -3
  212. package/lib/commonjs/classes/HMSSimulcastSettingsPolicy.js.map +1 -1
  213. package/lib/commonjs/classes/HMSSpeaker.js +3 -3
  214. package/lib/commonjs/classes/HMSSpeaker.js.map +1 -1
  215. package/lib/commonjs/classes/HMSStreamingState.js +15 -0
  216. package/lib/commonjs/classes/HMSStreamingState.js.map +1 -0
  217. package/lib/commonjs/classes/HMSSubscribeDegradationPolicy.js +3 -3
  218. package/lib/commonjs/classes/HMSSubscribeDegradationPolicy.js.map +1 -1
  219. package/lib/commonjs/classes/HMSSubscribeSettings.js +3 -3
  220. package/lib/commonjs/classes/HMSSubscribeSettings.js.map +1 -1
  221. package/lib/commonjs/classes/HMSTrack.js +16 -3
  222. package/lib/commonjs/classes/HMSTrack.js.map +1 -1
  223. package/lib/commonjs/classes/HMSTrackSettings.js +13 -3
  224. package/lib/commonjs/classes/HMSTrackSettings.js.map +1 -1
  225. package/lib/commonjs/classes/HMSTrackSettingsInitState.js +10 -2
  226. package/lib/commonjs/classes/HMSTrackSettingsInitState.js.map +1 -1
  227. package/lib/commonjs/classes/HMSTrackSource.js +11 -2
  228. package/lib/commonjs/classes/HMSTrackSource.js.map +1 -1
  229. package/lib/commonjs/classes/HMSTrackType.js +8 -2
  230. package/lib/commonjs/classes/HMSTrackType.js.map +1 -1
  231. package/lib/commonjs/classes/HMSTrackUpdate.js +1 -2
  232. package/lib/commonjs/classes/HMSTrackUpdate.js.map +1 -1
  233. package/lib/commonjs/classes/HMSUpdateListenerActions.js +44 -5
  234. package/lib/commonjs/classes/HMSUpdateListenerActions.js.map +1 -1
  235. package/lib/commonjs/classes/HMSVideoCodec.js +1 -2
  236. package/lib/commonjs/classes/HMSVideoCodec.js.map +1 -1
  237. package/lib/commonjs/classes/HMSVideoResolution.js +3 -3
  238. package/lib/commonjs/classes/HMSVideoResolution.js.map +1 -1
  239. package/lib/commonjs/classes/HMSVideoSettings.js +3 -3
  240. package/lib/commonjs/classes/HMSVideoSettings.js.map +1 -1
  241. package/lib/commonjs/classes/HMSVideoTrack.js +20 -3
  242. package/lib/commonjs/classes/HMSVideoTrack.js.map +1 -1
  243. package/lib/commonjs/classes/HMSVideoTrackSettings.js +18 -7
  244. package/lib/commonjs/classes/HMSVideoTrackSettings.js.map +1 -1
  245. package/lib/commonjs/classes/HMSVideoViewMode.js +1 -2
  246. package/lib/commonjs/classes/HMSVideoViewMode.js.map +1 -1
  247. package/lib/commonjs/classes/HmsView.js +77 -28
  248. package/lib/commonjs/classes/HmsView.js.map +1 -1
  249. package/lib/commonjs/classes/polls/DecodedPollLeaderboardResponse.js +6 -0
  250. package/lib/commonjs/classes/polls/DecodedPollLeaderboardResponse.js.map +1 -0
  251. package/lib/commonjs/classes/polls/HMSPoll.js +6 -0
  252. package/lib/commonjs/classes/polls/HMSPoll.js.map +1 -0
  253. package/lib/commonjs/classes/polls/HMSPollCategory.js +12 -0
  254. package/lib/commonjs/classes/polls/HMSPollCategory.js.map +1 -0
  255. package/lib/commonjs/classes/polls/HMSPollCreateParams.js +6 -0
  256. package/lib/commonjs/classes/polls/HMSPollCreateParams.js.map +1 -0
  257. package/lib/commonjs/classes/polls/HMSPollLeaderboardEntry.js +6 -0
  258. package/lib/commonjs/classes/polls/HMSPollLeaderboardEntry.js.map +1 -0
  259. package/lib/commonjs/classes/polls/HMSPollLeaderboardSummary.js +2 -0
  260. package/lib/commonjs/classes/polls/HMSPollLeaderboardSummary.js.map +1 -0
  261. package/lib/commonjs/classes/polls/HMSPollQuestion.js +6 -0
  262. package/lib/commonjs/classes/polls/HMSPollQuestion.js.map +1 -0
  263. package/lib/commonjs/classes/polls/HMSPollQuestionAnswer.js +2 -0
  264. package/lib/commonjs/classes/polls/HMSPollQuestionAnswer.js.map +1 -0
  265. package/lib/commonjs/classes/polls/HMSPollQuestionCreateParams.js +6 -0
  266. package/lib/commonjs/classes/polls/HMSPollQuestionCreateParams.js.map +1 -0
  267. package/lib/commonjs/classes/polls/HMSPollQuestionOption.js +2 -0
  268. package/lib/commonjs/classes/polls/HMSPollQuestionOption.js.map +1 -0
  269. package/lib/commonjs/classes/polls/HMSPollQuestionOptionCreateParams.js +6 -0
  270. package/lib/commonjs/classes/polls/HMSPollQuestionOptionCreateParams.js.map +1 -0
  271. package/lib/commonjs/classes/polls/HMSPollQuestionQuizOptionCreateParams.js +6 -0
  272. package/lib/commonjs/classes/polls/HMSPollQuestionQuizOptionCreateParams.js.map +1 -0
  273. package/lib/commonjs/classes/polls/HMSPollQuestionResponse.js +6 -0
  274. package/lib/commonjs/classes/polls/HMSPollQuestionResponse.js.map +1 -0
  275. package/lib/commonjs/classes/polls/HMSPollQuestionResponseCreateParams.js +6 -0
  276. package/lib/commonjs/classes/polls/HMSPollQuestionResponseCreateParams.js.map +1 -0
  277. package/lib/commonjs/classes/polls/HMSPollQuestionResponseResult.js +2 -0
  278. package/lib/commonjs/classes/polls/HMSPollQuestionResponseResult.js.map +1 -0
  279. package/lib/commonjs/classes/polls/HMSPollQuestionResult.js +2 -0
  280. package/lib/commonjs/classes/polls/HMSPollQuestionResult.js.map +1 -0
  281. package/lib/commonjs/classes/polls/HMSPollQuestionType.js +14 -0
  282. package/lib/commonjs/classes/polls/HMSPollQuestionType.js.map +1 -0
  283. package/lib/commonjs/classes/polls/HMSPollResponsePeerInfo.js +2 -0
  284. package/lib/commonjs/classes/polls/HMSPollResponsePeerInfo.js.map +1 -0
  285. package/lib/commonjs/classes/polls/HMSPollResult.js +6 -0
  286. package/lib/commonjs/classes/polls/HMSPollResult.js.map +1 -0
  287. package/lib/commonjs/classes/polls/HMSPollState.js +13 -0
  288. package/lib/commonjs/classes/polls/HMSPollState.js.map +1 -0
  289. package/lib/commonjs/classes/polls/HMSPollType.js +12 -0
  290. package/lib/commonjs/classes/polls/HMSPollType.js.map +1 -0
  291. package/lib/commonjs/classes/polls/HMSPollUpdateType.js +13 -0
  292. package/lib/commonjs/classes/polls/HMSPollUpdateType.js.map +1 -0
  293. package/lib/commonjs/classes/polls/HMSPollUserTrackingMode.js +13 -0
  294. package/lib/commonjs/classes/polls/HMSPollUserTrackingMode.js.map +1 -0
  295. package/lib/commonjs/classes/polls/PollLeaderboardResponse.js +6 -0
  296. package/lib/commonjs/classes/polls/PollLeaderboardResponse.js.map +1 -0
  297. package/lib/commonjs/classes/transcriptions/HMSTranscript.js +6 -0
  298. package/lib/commonjs/classes/transcriptions/HMSTranscript.js.map +1 -0
  299. package/lib/commonjs/classes/transcriptions/OnTranscriptionError.js +2 -0
  300. package/lib/commonjs/classes/transcriptions/OnTranscriptionError.js.map +1 -0
  301. package/lib/commonjs/classes/transcriptions/TranscriptionState.js +14 -0
  302. package/lib/commonjs/classes/transcriptions/TranscriptionState.js.map +1 -0
  303. package/lib/commonjs/classes/transcriptions/Transcriptions.js +6 -0
  304. package/lib/commonjs/classes/transcriptions/Transcriptions.js.map +1 -0
  305. package/lib/commonjs/classes/transcriptions/TranscriptionsMode.js +12 -0
  306. package/lib/commonjs/classes/transcriptions/TranscriptionsMode.js.map +1 -0
  307. package/lib/commonjs/classes/transcriptions/index.js +61 -0
  308. package/lib/commonjs/classes/transcriptions/index.js.map +1 -0
  309. package/lib/commonjs/classes/whiteboard/HMSWhiteboard.js +6 -0
  310. package/lib/commonjs/classes/whiteboard/HMSWhiteboard.js.map +1 -0
  311. package/lib/commonjs/classes/whiteboard/HMSWhiteboardListenerActions.js +11 -0
  312. package/lib/commonjs/classes/whiteboard/HMSWhiteboardListenerActions.js.map +1 -0
  313. package/lib/commonjs/classes/whiteboard/HMSWhiteboardState.js +12 -0
  314. package/lib/commonjs/classes/whiteboard/HMSWhiteboardState.js.map +1 -0
  315. package/lib/commonjs/classes/whiteboard/HMSWhiteboardUpdateType.js +12 -0
  316. package/lib/commonjs/classes/whiteboard/HMSWhiteboardUpdateType.js.map +1 -0
  317. package/lib/commonjs/classes/whiteboard/index.js +39 -0
  318. package/lib/commonjs/classes/whiteboard/index.js.map +1 -0
  319. package/lib/commonjs/classes/whiteboard/registerCallbacks.js +26 -0
  320. package/lib/commonjs/classes/whiteboard/registerCallbacks.js.map +1 -0
  321. package/lib/commonjs/components/HMSHLSPlayer/HMSHLSPlayer.js +155 -49
  322. package/lib/commonjs/components/HMSHLSPlayer/HMSHLSPlayer.js.map +1 -1
  323. package/lib/commonjs/components/HMSHLSPlayer/RCTHMSHLSPlayer.js +5 -6
  324. package/lib/commonjs/components/HMSHLSPlayer/RCTHMSHLSPlayer.js.map +1 -1
  325. package/lib/commonjs/components/HMSHLSPlayer/hooks.js +26 -16
  326. package/lib/commonjs/components/HMSHLSPlayer/hooks.js.map +1 -1
  327. package/lib/commonjs/components/HMSHLSPlayer/index.js +22 -1
  328. package/lib/commonjs/components/HMSHLSPlayer/index.js.map +1 -1
  329. package/lib/commonjs/hooks/hmsviews.js +17 -0
  330. package/lib/commonjs/hooks/hmsviews.js.map +1 -0
  331. package/lib/commonjs/hooks/polls.js +17 -0
  332. package/lib/commonjs/hooks/polls.js.map +1 -0
  333. package/lib/commonjs/hooks/useHMSPeerUpdates.js +3 -5
  334. package/lib/commonjs/hooks/useHMSPeerUpdates.js.map +1 -1
  335. package/lib/commonjs/index.js +233 -6
  336. package/lib/commonjs/index.js.map +1 -1
  337. package/lib/commonjs/modules/HMSManagerModule.js +10 -0
  338. package/lib/commonjs/modules/HMSManagerModule.js.map +1 -0
  339. package/lib/commonjs/specs/HMSHLSPlayerNativeComponent.js +75 -0
  340. package/lib/commonjs/specs/HMSHLSPlayerNativeComponent.js.map +1 -0
  341. package/lib/commonjs/specs/HMSViewNativeComponent.js +55 -0
  342. package/lib/commonjs/specs/HMSViewNativeComponent.js.map +1 -0
  343. package/lib/commonjs/specs/NativeHMSManager.js +38 -0
  344. package/lib/commonjs/specs/NativeHMSManager.js.map +1 -0
  345. package/lib/commonjs/stores/hls-player-playback-slice.js +10 -0
  346. package/lib/commonjs/stores/hls-player-playback-slice.js.map +1 -1
  347. package/lib/commonjs/stores/hls-player-stats-store.js +28 -17
  348. package/lib/commonjs/stores/hls-player-stats-store.js.map +1 -1
  349. package/lib/commonjs/stores/hms-interactivity-store.js +21 -0
  350. package/lib/commonjs/stores/hms-interactivity-store.js.map +1 -0
  351. package/lib/commonjs/stores/hms-polls-slice.js +19 -0
  352. package/lib/commonjs/stores/hms-polls-slice.js.map +1 -0
  353. package/lib/commonjs/stores/hms-store.js +5 -6
  354. package/lib/commonjs/stores/hms-store.js.map +1 -1
  355. package/lib/commonjs/stores/hmsviews-slice.js +19 -0
  356. package/lib/commonjs/stores/hmsviews-slice.js.map +1 -0
  357. package/lib/commonjs/stores/types.js.map +1 -1
  358. package/lib/commonjs/types.js +4 -7
  359. package/lib/commonjs/types.js.map +1 -1
  360. package/lib/commonjs/utils/emitter/EventEmitter.js +23 -7
  361. package/lib/commonjs/utils/emitter/EventEmitter.js.map +1 -1
  362. package/lib/commonjs/utils/emitter/_EmitterSubscription.js +3 -3
  363. package/lib/commonjs/utils/emitter/_EmitterSubscription.js.map +1 -1
  364. package/lib/commonjs/utils/emitter/_EventSubscription.js +3 -3
  365. package/lib/commonjs/utils/emitter/_EventSubscription.js.map +1 -1
  366. package/lib/commonjs/utils/emitter/_EventSubscriptionVendor.js +3 -4
  367. package/lib/commonjs/utils/emitter/_EventSubscriptionVendor.js.map +1 -1
  368. package/lib/commonjs/utils/index.js.map +1 -1
  369. package/lib/commonjs/utils/keyboard.js +46 -0
  370. package/lib/commonjs/utils/keyboard.js.map +1 -0
  371. package/lib/commonjs/utils/notification.js +13 -0
  372. package/lib/commonjs/utils/notification.js.map +1 -0
  373. package/lib/commonjs/utils/windowController.js +30 -0
  374. package/lib/commonjs/utils/windowController.js.map +1 -0
  375. package/lib/module/classes/HMSAudioCodec.js.map +1 -1
  376. package/lib/module/classes/HMSAudioDevice.js +9 -0
  377. package/lib/module/classes/HMSAudioDevice.js.map +1 -1
  378. package/lib/module/classes/HMSAudioFilePlayerNode.js.map +1 -1
  379. package/lib/module/classes/HMSAudioMixerSource.js +3 -3
  380. package/lib/module/classes/HMSAudioMixerSource.js.map +1 -1
  381. package/lib/module/classes/HMSAudioMixingMode.js +11 -0
  382. package/lib/module/classes/HMSAudioMixingMode.js.map +1 -1
  383. package/lib/module/classes/HMSAudioMode.js.map +1 -1
  384. package/lib/module/classes/HMSAudioNode.js +3 -3
  385. package/lib/module/classes/HMSAudioNode.js.map +1 -1
  386. package/lib/module/classes/HMSAudioSettings.js +3 -3
  387. package/lib/module/classes/HMSAudioSettings.js.map +1 -1
  388. package/lib/module/classes/HMSAudioTrack.js +9 -0
  389. package/lib/module/classes/HMSAudioTrack.js.map +1 -1
  390. package/lib/module/classes/HMSAudioTrackSettings.js +12 -5
  391. package/lib/module/classes/HMSAudioTrackSettings.js.map +1 -1
  392. package/lib/module/classes/HMSBrowserRecordingState.js +5 -3
  393. package/lib/module/classes/HMSBrowserRecordingState.js.map +1 -1
  394. package/lib/module/classes/HMSCameraControl.js +2 -3
  395. package/lib/module/classes/HMSCameraControl.js.map +1 -1
  396. package/lib/module/classes/HMSCameraFacing.js +9 -0
  397. package/lib/module/classes/HMSCameraFacing.js.map +1 -1
  398. package/lib/module/classes/HMSChangeTrackStateRequest.js +3 -3
  399. package/lib/module/classes/HMSChangeTrackStateRequest.js.map +1 -1
  400. package/lib/module/classes/HMSConfig.js +30 -3
  401. package/lib/module/classes/HMSConfig.js.map +1 -1
  402. package/lib/module/classes/HMSConstants.js.map +1 -1
  403. package/lib/module/classes/HMSEncoder.js +56 -13
  404. package/lib/module/classes/HMSEncoder.js.map +1 -1
  405. package/lib/module/classes/HMSEventEmitter.js.map +1 -1
  406. package/lib/module/classes/HMSException.js +21 -3
  407. package/lib/module/classes/HMSException.js.map +1 -1
  408. package/lib/module/classes/HMSHLSConfig.js +3 -3
  409. package/lib/module/classes/HMSHLSConfig.js.map +1 -1
  410. package/lib/module/classes/HMSHLSMeetingURLVariant.js +3 -3
  411. package/lib/module/classes/HMSHLSMeetingURLVariant.js.map +1 -1
  412. package/lib/module/classes/HMSHLSPlaylistType.js +6 -0
  413. package/lib/module/classes/HMSHLSPlaylistType.js.map +1 -0
  414. package/lib/module/classes/HMSHLSRecordingConfig.js +3 -3
  415. package/lib/module/classes/HMSHLSRecordingConfig.js.map +1 -1
  416. package/lib/module/classes/HMSHLSRecordingState.js +7 -7
  417. package/lib/module/classes/HMSHLSRecordingState.js.map +1 -1
  418. package/lib/module/classes/HMSHLSStreamingState.js +9 -3
  419. package/lib/module/classes/HMSHLSStreamingState.js.map +1 -1
  420. package/lib/module/classes/HMSHLSTimedMetadata.js +2 -0
  421. package/lib/module/classes/HMSHLSTimedMetadata.js.map +1 -0
  422. package/lib/module/classes/HMSHLSVariant.js +5 -3
  423. package/lib/module/classes/HMSHLSVariant.js.map +1 -1
  424. package/lib/module/classes/HMSHelper.js.map +1 -1
  425. package/lib/module/classes/HMSIOSAudioMode.js +15 -0
  426. package/lib/module/classes/HMSIOSAudioMode.js.map +1 -1
  427. package/lib/module/classes/HMSInteractivityCenter.js +166 -0
  428. package/lib/module/classes/HMSInteractivityCenter.js.map +1 -0
  429. package/lib/module/classes/HMSInteractivityEncoder.js +76 -0
  430. package/lib/module/classes/HMSInteractivityEncoder.js.map +1 -0
  431. package/lib/module/classes/HMSLayer.js.map +1 -1
  432. package/lib/module/classes/HMSLocalAudioStats.js +3 -3
  433. package/lib/module/classes/HMSLocalAudioStats.js.map +1 -1
  434. package/lib/module/classes/HMSLocalAudioTrack.js +3 -3
  435. package/lib/module/classes/HMSLocalAudioTrack.js.map +1 -1
  436. package/lib/module/classes/HMSLocalPeer.js +3 -3
  437. package/lib/module/classes/HMSLocalPeer.js.map +1 -1
  438. package/lib/module/classes/HMSLocalVideoStats.js +3 -3
  439. package/lib/module/classes/HMSLocalVideoStats.js.map +1 -1
  440. package/lib/module/classes/HMSLocalVideoTrack.js +3 -3
  441. package/lib/module/classes/HMSLocalVideoTrack.js.map +1 -1
  442. package/lib/module/classes/HMSLogAlarmManager.js +12 -0
  443. package/lib/module/classes/HMSLogAlarmManager.js.map +1 -1
  444. package/lib/module/classes/HMSLogLevel.js +12 -0
  445. package/lib/module/classes/HMSLogLevel.js.map +1 -1
  446. package/lib/module/classes/HMSLogSettings.js +17 -3
  447. package/lib/module/classes/HMSLogSettings.js.map +1 -1
  448. package/lib/module/classes/HMSLogger.js +3 -3
  449. package/lib/module/classes/HMSLogger.js.map +1 -1
  450. package/lib/module/classes/HMSMessage.js +3 -3
  451. package/lib/module/classes/HMSMessage.js.map +1 -1
  452. package/lib/module/classes/HMSMessageRecipient.js +3 -3
  453. package/lib/module/classes/HMSMessageRecipient.js.map +1 -1
  454. package/lib/module/classes/HMSMessageRecipientType.js.map +1 -1
  455. package/lib/module/classes/HMSMicNode.js.map +1 -1
  456. package/lib/module/classes/HMSNativeEventEmitter.js +4 -6
  457. package/lib/module/classes/HMSNativeEventEmitter.js.map +1 -1
  458. package/lib/module/classes/HMSNativeEventListener.js +1 -1
  459. package/lib/module/classes/HMSNativeEventListener.js.map +1 -1
  460. package/lib/module/classes/HMSNetworkQuality.js +14 -3
  461. package/lib/module/classes/HMSNetworkQuality.js.map +1 -1
  462. package/lib/module/classes/HMSNoiseCancellationPlugin.js +152 -0
  463. package/lib/module/classes/HMSNoiseCancellationPlugin.js.map +1 -0
  464. package/lib/module/classes/HMSPIPConfig.js +2 -0
  465. package/lib/module/classes/HMSPIPConfig.js.map +1 -0
  466. package/lib/module/classes/HMSPIPListenerActions.js +9 -0
  467. package/lib/module/classes/HMSPIPListenerActions.js.map +1 -1
  468. package/lib/module/classes/HMSPeer.js +187 -5
  469. package/lib/module/classes/HMSPeer.js.map +1 -1
  470. package/lib/module/classes/HMSPeerListIterator.js +24 -6
  471. package/lib/module/classes/HMSPeerListIterator.js.map +1 -1
  472. package/lib/module/classes/HMSPeerListIteratorOptions.js.map +1 -1
  473. package/lib/module/classes/HMSPeerType.js +18 -0
  474. package/lib/module/classes/HMSPeerType.js.map +1 -0
  475. package/lib/module/classes/HMSPeerUpdate.js.map +1 -1
  476. package/lib/module/classes/HMSPeersCache.js +4 -4
  477. package/lib/module/classes/HMSPeersCache.js.map +1 -1
  478. package/lib/module/classes/HMSPermissions.js +11 -3
  479. package/lib/module/classes/HMSPermissions.js.map +1 -1
  480. package/lib/module/classes/HMSPollsListenerActions.js +5 -0
  481. package/lib/module/classes/HMSPollsListenerActions.js.map +1 -0
  482. package/lib/module/classes/HMSPublishSettings.js +3 -3
  483. package/lib/module/classes/HMSPublishSettings.js.map +1 -1
  484. package/lib/module/classes/HMSQualityLimitationReason.js.map +1 -1
  485. package/lib/module/classes/HMSQualityLimitationReasons.js +3 -3
  486. package/lib/module/classes/HMSQualityLimitationReasons.js.map +1 -1
  487. package/lib/module/classes/HMSRTCStats.js +3 -3
  488. package/lib/module/classes/HMSRTCStats.js.map +1 -1
  489. package/lib/module/classes/HMSRTCStatsReport.js +3 -3
  490. package/lib/module/classes/HMSRTCStatsReport.js.map +1 -1
  491. package/lib/module/classes/HMSRTMPConfig.js +17 -3
  492. package/lib/module/classes/HMSRTMPConfig.js.map +1 -1
  493. package/lib/module/classes/HMSRecordingState.js +11 -0
  494. package/lib/module/classes/HMSRecordingState.js.map +1 -0
  495. package/lib/module/classes/HMSRemoteAudioStats.js +3 -3
  496. package/lib/module/classes/HMSRemoteAudioStats.js.map +1 -1
  497. package/lib/module/classes/HMSRemoteAudioTrack.js +3 -3
  498. package/lib/module/classes/HMSRemoteAudioTrack.js.map +1 -1
  499. package/lib/module/classes/HMSRemotePeer.js +3 -3
  500. package/lib/module/classes/HMSRemotePeer.js.map +1 -1
  501. package/lib/module/classes/HMSRemoteVideoStats.js +3 -3
  502. package/lib/module/classes/HMSRemoteVideoStats.js.map +1 -1
  503. package/lib/module/classes/HMSRemoteVideoTrack.js +3 -3
  504. package/lib/module/classes/HMSRemoteVideoTrack.js.map +1 -1
  505. package/lib/module/classes/HMSRole.js +20 -3
  506. package/lib/module/classes/HMSRole.js.map +1 -1
  507. package/lib/module/classes/HMSRoleChangeRequest.js +3 -3
  508. package/lib/module/classes/HMSRoleChangeRequest.js.map +1 -1
  509. package/lib/module/classes/HMSRoom.js +17 -4
  510. package/lib/module/classes/HMSRoom.js.map +1 -1
  511. package/lib/module/classes/HMSRoomCache.js +11 -4
  512. package/lib/module/classes/HMSRoomCache.js.map +1 -1
  513. package/lib/module/classes/HMSRoomUpdate.js +1 -0
  514. package/lib/module/classes/HMSRoomUpdate.js.map +1 -1
  515. package/lib/module/classes/HMSRtmpStreamingState.js +5 -5
  516. package/lib/module/classes/HMSRtmpStreamingState.js.map +1 -1
  517. package/lib/module/classes/HMSRtmpVideoResolution.js +16 -3
  518. package/lib/module/classes/HMSRtmpVideoResolution.js.map +1 -1
  519. package/lib/module/classes/HMSSDK.js +1314 -328
  520. package/lib/module/classes/HMSSDK.js.map +1 -1
  521. package/lib/module/classes/HMSScreenBroadcastAudioReceiverNode.js.map +1 -1
  522. package/lib/module/classes/HMSServerRecordingState.js +5 -3
  523. package/lib/module/classes/HMSServerRecordingState.js.map +1 -1
  524. package/lib/module/classes/HMSSessionStore.js +19 -22
  525. package/lib/module/classes/HMSSessionStore.js.map +1 -1
  526. package/lib/module/classes/HMSSimulcastLayerDefinition.js +3 -3
  527. package/lib/module/classes/HMSSimulcastLayerDefinition.js.map +1 -1
  528. package/lib/module/classes/HMSSimulcastLayerSettings.js +3 -3
  529. package/lib/module/classes/HMSSimulcastLayerSettings.js.map +1 -1
  530. package/lib/module/classes/HMSSimulcastLayerSettingsPolicy.js +3 -3
  531. package/lib/module/classes/HMSSimulcastLayerSettingsPolicy.js.map +1 -1
  532. package/lib/module/classes/HMSSimulcastSettings.js +3 -3
  533. package/lib/module/classes/HMSSimulcastSettings.js.map +1 -1
  534. package/lib/module/classes/HMSSimulcastSettingsPolicy.js +3 -3
  535. package/lib/module/classes/HMSSimulcastSettingsPolicy.js.map +1 -1
  536. package/lib/module/classes/HMSSpeaker.js +3 -3
  537. package/lib/module/classes/HMSSpeaker.js.map +1 -1
  538. package/lib/module/classes/HMSStreamingState.js +9 -0
  539. package/lib/module/classes/HMSStreamingState.js.map +1 -0
  540. package/lib/module/classes/HMSSubscribeDegradationPolicy.js +3 -3
  541. package/lib/module/classes/HMSSubscribeDegradationPolicy.js.map +1 -1
  542. package/lib/module/classes/HMSSubscribeSettings.js +3 -3
  543. package/lib/module/classes/HMSSubscribeSettings.js.map +1 -1
  544. package/lib/module/classes/HMSTrack.js +16 -3
  545. package/lib/module/classes/HMSTrack.js.map +1 -1
  546. package/lib/module/classes/HMSTrackSettings.js +13 -3
  547. package/lib/module/classes/HMSTrackSettings.js.map +1 -1
  548. package/lib/module/classes/HMSTrackSettingsInitState.js +9 -0
  549. package/lib/module/classes/HMSTrackSettingsInitState.js.map +1 -1
  550. package/lib/module/classes/HMSTrackSource.js +10 -0
  551. package/lib/module/classes/HMSTrackSource.js.map +1 -1
  552. package/lib/module/classes/HMSTrackType.js +7 -0
  553. package/lib/module/classes/HMSTrackType.js.map +1 -1
  554. package/lib/module/classes/HMSTrackUpdate.js.map +1 -1
  555. package/lib/module/classes/HMSUpdateListenerActions.js +43 -3
  556. package/lib/module/classes/HMSUpdateListenerActions.js.map +1 -1
  557. package/lib/module/classes/HMSVideoCodec.js.map +1 -1
  558. package/lib/module/classes/HMSVideoResolution.js +3 -3
  559. package/lib/module/classes/HMSVideoResolution.js.map +1 -1
  560. package/lib/module/classes/HMSVideoSettings.js +3 -3
  561. package/lib/module/classes/HMSVideoSettings.js.map +1 -1
  562. package/lib/module/classes/HMSVideoTrack.js +20 -3
  563. package/lib/module/classes/HMSVideoTrack.js.map +1 -1
  564. package/lib/module/classes/HMSVideoTrackSettings.js +18 -7
  565. package/lib/module/classes/HMSVideoTrackSettings.js.map +1 -1
  566. package/lib/module/classes/HMSVideoViewMode.js.map +1 -1
  567. package/lib/module/classes/HmsView.js +77 -25
  568. package/lib/module/classes/HmsView.js.map +1 -1
  569. package/lib/module/classes/polls/DecodedPollLeaderboardResponse.js +2 -0
  570. package/lib/module/classes/polls/DecodedPollLeaderboardResponse.js.map +1 -0
  571. package/lib/module/classes/polls/HMSPoll.js +2 -0
  572. package/lib/module/classes/polls/HMSPoll.js.map +1 -0
  573. package/lib/module/classes/polls/HMSPollCategory.js +6 -0
  574. package/lib/module/classes/polls/HMSPollCategory.js.map +1 -0
  575. package/lib/module/classes/polls/HMSPollCreateParams.js +2 -0
  576. package/lib/module/classes/polls/HMSPollCreateParams.js.map +1 -0
  577. package/lib/module/classes/polls/HMSPollLeaderboardEntry.js +2 -0
  578. package/lib/module/classes/polls/HMSPollLeaderboardEntry.js.map +1 -0
  579. package/lib/module/classes/polls/HMSPollLeaderboardSummary.js +2 -0
  580. package/lib/module/classes/polls/HMSPollLeaderboardSummary.js.map +1 -0
  581. package/lib/module/classes/polls/HMSPollQuestion.js +2 -0
  582. package/lib/module/classes/polls/HMSPollQuestion.js.map +1 -0
  583. package/lib/module/classes/polls/HMSPollQuestionAnswer.js +2 -0
  584. package/lib/module/classes/polls/HMSPollQuestionAnswer.js.map +1 -0
  585. package/lib/module/classes/polls/HMSPollQuestionCreateParams.js +2 -0
  586. package/lib/module/classes/polls/HMSPollQuestionCreateParams.js.map +1 -0
  587. package/lib/module/classes/polls/HMSPollQuestionOption.js +2 -0
  588. package/lib/module/classes/polls/HMSPollQuestionOption.js.map +1 -0
  589. package/lib/module/classes/polls/HMSPollQuestionOptionCreateParams.js +2 -0
  590. package/lib/module/classes/polls/HMSPollQuestionOptionCreateParams.js.map +1 -0
  591. package/lib/module/classes/polls/HMSPollQuestionQuizOptionCreateParams.js +2 -0
  592. package/lib/module/classes/polls/HMSPollQuestionQuizOptionCreateParams.js.map +1 -0
  593. package/lib/module/classes/polls/HMSPollQuestionResponse.js +2 -0
  594. package/lib/module/classes/polls/HMSPollQuestionResponse.js.map +1 -0
  595. package/lib/module/classes/polls/HMSPollQuestionResponseCreateParams.js +2 -0
  596. package/lib/module/classes/polls/HMSPollQuestionResponseCreateParams.js.map +1 -0
  597. package/lib/module/classes/polls/HMSPollQuestionResponseResult.js +2 -0
  598. package/lib/module/classes/polls/HMSPollQuestionResponseResult.js.map +1 -0
  599. package/lib/module/classes/polls/HMSPollQuestionResult.js +2 -0
  600. package/lib/module/classes/polls/HMSPollQuestionResult.js.map +1 -0
  601. package/lib/module/classes/polls/HMSPollQuestionType.js +8 -0
  602. package/lib/module/classes/polls/HMSPollQuestionType.js.map +1 -0
  603. package/lib/module/classes/polls/HMSPollResponsePeerInfo.js +2 -0
  604. package/lib/module/classes/polls/HMSPollResponsePeerInfo.js.map +1 -0
  605. package/lib/module/classes/polls/HMSPollResult.js +2 -0
  606. package/lib/module/classes/polls/HMSPollResult.js.map +1 -0
  607. package/lib/module/classes/polls/HMSPollState.js +7 -0
  608. package/lib/module/classes/polls/HMSPollState.js.map +1 -0
  609. package/lib/module/classes/polls/HMSPollType.js +6 -0
  610. package/lib/module/classes/polls/HMSPollType.js.map +1 -0
  611. package/lib/module/classes/polls/HMSPollUpdateType.js +7 -0
  612. package/lib/module/classes/polls/HMSPollUpdateType.js.map +1 -0
  613. package/lib/module/classes/polls/HMSPollUserTrackingMode.js +7 -0
  614. package/lib/module/classes/polls/HMSPollUserTrackingMode.js.map +1 -0
  615. package/lib/module/classes/polls/PollLeaderboardResponse.js +2 -0
  616. package/lib/module/classes/polls/PollLeaderboardResponse.js.map +1 -0
  617. package/lib/module/classes/transcriptions/HMSTranscript.js +2 -0
  618. package/lib/module/classes/transcriptions/HMSTranscript.js.map +1 -0
  619. package/lib/module/classes/transcriptions/OnTranscriptionError.js +2 -0
  620. package/lib/module/classes/transcriptions/OnTranscriptionError.js.map +1 -0
  621. package/lib/module/classes/transcriptions/TranscriptionState.js +8 -0
  622. package/lib/module/classes/transcriptions/TranscriptionState.js.map +1 -0
  623. package/lib/module/classes/transcriptions/Transcriptions.js +2 -0
  624. package/lib/module/classes/transcriptions/Transcriptions.js.map +1 -0
  625. package/lib/module/classes/transcriptions/TranscriptionsMode.js +6 -0
  626. package/lib/module/classes/transcriptions/TranscriptionsMode.js.map +1 -0
  627. package/lib/module/classes/transcriptions/index.js +6 -0
  628. package/lib/module/classes/transcriptions/index.js.map +1 -0
  629. package/lib/module/classes/whiteboard/HMSWhiteboard.js +2 -0
  630. package/lib/module/classes/whiteboard/HMSWhiteboard.js.map +1 -0
  631. package/lib/module/classes/whiteboard/HMSWhiteboardListenerActions.js +5 -0
  632. package/lib/module/classes/whiteboard/HMSWhiteboardListenerActions.js.map +1 -0
  633. package/lib/module/classes/whiteboard/HMSWhiteboardState.js +6 -0
  634. package/lib/module/classes/whiteboard/HMSWhiteboardState.js.map +1 -0
  635. package/lib/module/classes/whiteboard/HMSWhiteboardUpdateType.js +6 -0
  636. package/lib/module/classes/whiteboard/HMSWhiteboardUpdateType.js.map +1 -0
  637. package/lib/module/classes/whiteboard/index.js +4 -0
  638. package/lib/module/classes/whiteboard/index.js.map +1 -0
  639. package/lib/module/classes/whiteboard/registerCallbacks.js +18 -0
  640. package/lib/module/classes/whiteboard/registerCallbacks.js.map +1 -0
  641. package/lib/module/components/HMSHLSPlayer/HMSHLSPlayer.js +157 -49
  642. package/lib/module/components/HMSHLSPlayer/HMSHLSPlayer.js.map +1 -1
  643. package/lib/module/components/HMSHLSPlayer/RCTHMSHLSPlayer.js +3 -3
  644. package/lib/module/components/HMSHLSPlayer/RCTHMSHLSPlayer.js.map +1 -1
  645. package/lib/module/components/HMSHLSPlayer/hooks.js +16 -4
  646. package/lib/module/components/HMSHLSPlayer/hooks.js.map +1 -1
  647. package/lib/module/components/HMSHLSPlayer/index.js +1 -1
  648. package/lib/module/components/HMSHLSPlayer/index.js.map +1 -1
  649. package/lib/module/hooks/hmsviews.js +12 -0
  650. package/lib/module/hooks/hmsviews.js.map +1 -0
  651. package/lib/module/hooks/polls.js +12 -0
  652. package/lib/module/hooks/polls.js.map +1 -0
  653. package/lib/module/hooks/useHMSPeerUpdates.js +1 -2
  654. package/lib/module/hooks/useHMSPeerUpdates.js.map +1 -1
  655. package/lib/module/index.js +29 -2
  656. package/lib/module/index.js.map +1 -1
  657. package/lib/module/modules/HMSManagerModule.js +3 -0
  658. package/lib/module/modules/HMSManagerModule.js.map +1 -0
  659. package/lib/module/specs/HMSHLSPlayerNativeComponent.js +69 -0
  660. package/lib/module/specs/HMSHLSPlayerNativeComponent.js.map +1 -0
  661. package/lib/module/specs/HMSViewNativeComponent.js +49 -0
  662. package/lib/module/specs/HMSViewNativeComponent.js.map +1 -0
  663. package/lib/module/specs/NativeHMSManager.js +33 -0
  664. package/lib/module/specs/NativeHMSManager.js.map +1 -0
  665. package/lib/module/stores/hls-player-playback-slice.js +10 -0
  666. package/lib/module/stores/hls-player-playback-slice.js.map +1 -1
  667. package/lib/module/stores/hls-player-stats-store.js +27 -15
  668. package/lib/module/stores/hls-player-stats-store.js.map +1 -1
  669. package/lib/module/stores/hms-interactivity-store.js +15 -0
  670. package/lib/module/stores/hms-interactivity-store.js.map +1 -0
  671. package/lib/module/stores/hms-polls-slice.js +12 -0
  672. package/lib/module/stores/hms-polls-slice.js.map +1 -0
  673. package/lib/module/stores/hms-store.js +5 -5
  674. package/lib/module/stores/hms-store.js.map +1 -1
  675. package/lib/module/stores/hmsviews-slice.js +12 -0
  676. package/lib/module/stores/hmsviews-slice.js.map +1 -0
  677. package/lib/module/stores/types.js.map +1 -1
  678. package/lib/module/types.js +3 -1
  679. package/lib/module/types.js.map +1 -1
  680. package/lib/module/utils/emitter/EventEmitter.js +23 -7
  681. package/lib/module/utils/emitter/EventEmitter.js.map +1 -1
  682. package/lib/module/utils/emitter/_EmitterSubscription.js +3 -3
  683. package/lib/module/utils/emitter/_EmitterSubscription.js.map +1 -1
  684. package/lib/module/utils/emitter/_EventSubscription.js +3 -3
  685. package/lib/module/utils/emitter/_EventSubscription.js.map +1 -1
  686. package/lib/module/utils/emitter/_EventSubscriptionVendor.js +3 -4
  687. package/lib/module/utils/emitter/_EventSubscriptionVendor.js.map +1 -1
  688. package/lib/module/utils/index.js.map +1 -1
  689. package/lib/module/utils/keyboard.js +38 -0
  690. package/lib/module/utils/keyboard.js.map +1 -0
  691. package/lib/module/utils/notification.js +5 -0
  692. package/lib/module/utils/notification.js.map +1 -0
  693. package/lib/module/utils/windowController.js +22 -0
  694. package/lib/module/utils/windowController.js.map +1 -0
  695. package/lib/typescript/classes/HMSAudioDevice.d.ts +14 -0
  696. package/lib/typescript/classes/HMSAudioMixingMode.d.ts +11 -0
  697. package/lib/typescript/classes/HMSAudioTrack.d.ts +9 -0
  698. package/lib/typescript/classes/HMSAudioTrackSettings.d.ts +9 -0
  699. package/lib/typescript/classes/HMSBrowserRecordingState.d.ts +3 -0
  700. package/lib/typescript/classes/HMSCameraFacing.d.ts +11 -0
  701. package/lib/typescript/classes/HMSConfig.d.ts +27 -0
  702. package/lib/typescript/classes/HMSEncoder.d.ts +5 -0
  703. package/lib/typescript/classes/HMSException.d.ts +18 -0
  704. package/lib/typescript/classes/HMSHLSPlaylistType.d.ts +4 -0
  705. package/lib/typescript/classes/HMSHLSRecordingState.d.ts +6 -4
  706. package/lib/typescript/classes/HMSHLSStreamingState.d.ts +8 -0
  707. package/lib/typescript/classes/HMSHLSTimedMetadata.d.ts +16 -0
  708. package/lib/typescript/classes/HMSHLSVariant.d.ts +3 -0
  709. package/lib/typescript/classes/HMSIOSAudioMode.d.ts +15 -0
  710. package/lib/typescript/classes/HMSInteractivityCenter.d.ts +62 -0
  711. package/lib/typescript/classes/HMSInteractivityEncoder.d.ts +9 -0
  712. package/lib/typescript/classes/HMSLogAlarmManager.d.ts +12 -0
  713. package/lib/typescript/classes/HMSLogLevel.d.ts +12 -0
  714. package/lib/typescript/classes/HMSLogSettings.d.ts +14 -0
  715. package/lib/typescript/classes/HMSNetworkQuality.d.ts +11 -0
  716. package/lib/typescript/classes/HMSNoiseCancellationPlugin.d.ts +87 -0
  717. package/lib/typescript/classes/HMSPIPConfig.d.ts +47 -0
  718. package/lib/typescript/classes/HMSPIPListenerActions.d.ts +17 -0
  719. package/lib/typescript/classes/HMSPeer.d.ts +144 -1
  720. package/lib/typescript/classes/HMSPeerListIterator.d.ts +3 -1
  721. package/lib/typescript/classes/HMSPeerListIteratorOptions.d.ts +19 -0
  722. package/lib/typescript/classes/HMSPeerType.d.ts +16 -0
  723. package/lib/typescript/classes/HMSPeersCache.d.ts +2 -0
  724. package/lib/typescript/classes/HMSPermissions.d.ts +18 -0
  725. package/lib/typescript/classes/HMSPollsListenerActions.d.ts +3 -0
  726. package/lib/typescript/classes/HMSRTMPConfig.d.ts +14 -0
  727. package/lib/typescript/classes/HMSRecordingState.d.ts +9 -0
  728. package/lib/typescript/classes/HMSRole.d.ts +17 -0
  729. package/lib/typescript/classes/HMSRoom.d.ts +3 -0
  730. package/lib/typescript/classes/HMSRoomUpdate.d.ts +2 -1
  731. package/lib/typescript/classes/HMSRtmpStreamingState.d.ts +3 -2
  732. package/lib/typescript/classes/HMSRtmpVideoResolution.d.ts +13 -0
  733. package/lib/typescript/classes/HMSSDK.d.ts +1123 -249
  734. package/lib/typescript/classes/HMSServerRecordingState.d.ts +3 -0
  735. package/lib/typescript/classes/HMSSessionStore.d.ts +23 -22
  736. package/lib/typescript/classes/HMSStreamingState.d.ts +7 -0
  737. package/lib/typescript/classes/HMSTrack.d.ts +13 -0
  738. package/lib/typescript/classes/HMSTrackSettings.d.ts +10 -0
  739. package/lib/typescript/classes/HMSTrackSettingsInitState.d.ts +11 -0
  740. package/lib/typescript/classes/HMSTrackSource.d.ts +10 -0
  741. package/lib/typescript/classes/HMSTrackType.d.ts +7 -0
  742. package/lib/typescript/classes/HMSUpdateListenerActions.d.ts +290 -3
  743. package/lib/typescript/classes/HMSVideoTrack.d.ts +17 -0
  744. package/lib/typescript/classes/HMSVideoTrackSettings.d.ts +23 -2
  745. package/lib/typescript/classes/HmsView.d.ts +16 -0
  746. package/lib/typescript/classes/polls/DecodedPollLeaderboardResponse.d.ts +37 -0
  747. package/lib/typescript/classes/polls/HMSPoll.d.ts +73 -0
  748. package/lib/typescript/classes/polls/HMSPollCategory.d.ts +10 -0
  749. package/lib/typescript/classes/polls/HMSPollCreateParams.d.ts +6 -0
  750. package/lib/typescript/classes/polls/HMSPollLeaderboardEntry.d.ts +9 -0
  751. package/lib/typescript/classes/polls/HMSPollLeaderboardSummary.d.ts +7 -0
  752. package/lib/typescript/classes/polls/HMSPollQuestion.d.ts +61 -0
  753. package/lib/typescript/classes/polls/HMSPollQuestionAnswer.d.ts +17 -0
  754. package/lib/typescript/classes/polls/HMSPollQuestionCreateParams.d.ts +25 -0
  755. package/lib/typescript/classes/polls/HMSPollQuestionOption.d.ts +21 -0
  756. package/lib/typescript/classes/polls/HMSPollQuestionOptionCreateParams.d.ts +3 -0
  757. package/lib/typescript/classes/polls/HMSPollQuestionQuizOptionCreateParams.d.ts +4 -0
  758. package/lib/typescript/classes/polls/HMSPollQuestionResponse.d.ts +47 -0
  759. package/lib/typescript/classes/polls/HMSPollQuestionResponseCreateParams.d.ts +2 -0
  760. package/lib/typescript/classes/polls/HMSPollQuestionResponseResult.d.ts +17 -0
  761. package/lib/typescript/classes/polls/HMSPollQuestionResult.d.ts +29 -0
  762. package/lib/typescript/classes/polls/HMSPollQuestionType.d.ts +18 -0
  763. package/lib/typescript/classes/polls/HMSPollResponsePeerInfo.d.ts +21 -0
  764. package/lib/typescript/classes/polls/HMSPollResult.d.ts +22 -0
  765. package/lib/typescript/classes/polls/HMSPollState.d.ts +14 -0
  766. package/lib/typescript/classes/polls/HMSPollType.d.ts +4 -0
  767. package/lib/typescript/classes/polls/HMSPollUpdateType.d.ts +5 -0
  768. package/lib/typescript/classes/polls/HMSPollUserTrackingMode.d.ts +14 -0
  769. package/lib/typescript/classes/polls/PollLeaderboardResponse.d.ts +7 -0
  770. package/lib/typescript/classes/transcriptions/HMSTranscript.d.ts +8 -0
  771. package/lib/typescript/classes/transcriptions/OnTranscriptionError.d.ts +4 -0
  772. package/lib/typescript/classes/transcriptions/TranscriptionState.d.ts +6 -0
  773. package/lib/typescript/classes/transcriptions/Transcriptions.d.ts +12 -0
  774. package/lib/typescript/classes/transcriptions/TranscriptionsMode.d.ts +4 -0
  775. package/lib/typescript/classes/transcriptions/index.d.ts +5 -0
  776. package/lib/typescript/classes/whiteboard/HMSWhiteboard.d.ts +10 -0
  777. package/lib/typescript/classes/whiteboard/HMSWhiteboardListenerActions.d.ts +3 -0
  778. package/lib/typescript/classes/whiteboard/HMSWhiteboardState.d.ts +4 -0
  779. package/lib/typescript/classes/whiteboard/HMSWhiteboardUpdateType.d.ts +4 -0
  780. package/lib/typescript/classes/whiteboard/index.d.ts +3 -0
  781. package/lib/typescript/classes/whiteboard/registerCallbacks.d.ts +8 -0
  782. package/lib/typescript/components/HMSHLSPlayer/HMSHLSPlayer.d.ts +6 -0
  783. package/lib/typescript/components/HMSHLSPlayer/RCTHMSHLSPlayer.d.ts +11 -9
  784. package/lib/typescript/components/HMSHLSPlayer/hooks.d.ts +5 -0
  785. package/lib/typescript/components/HMSHLSPlayer/index.d.ts +1 -1
  786. package/lib/typescript/hooks/hmsviews.d.ts +3 -0
  787. package/lib/typescript/hooks/polls.d.ts +3 -0
  788. package/lib/typescript/index.d.ts +29 -2
  789. package/lib/typescript/specs/HMSHLSPlayerNativeComponent.d.ts +115 -0
  790. package/lib/typescript/specs/HMSViewNativeComponent.d.ts +97 -0
  791. package/lib/typescript/specs/NativeHMSManager.d.ts +147 -0
  792. package/lib/typescript/stores/hls-player-stats-store.d.ts +4 -3
  793. package/lib/typescript/stores/hms-interactivity-store.d.ts +9 -0
  794. package/lib/typescript/stores/hms-polls-slice.d.ts +5 -0
  795. package/lib/typescript/stores/hms-store.d.ts +4 -3
  796. package/lib/typescript/stores/hmsviews-slice.d.ts +5 -0
  797. package/lib/typescript/stores/types.d.ts +27 -3
  798. package/lib/typescript/types.d.ts +18 -5
  799. package/lib/typescript/utils/emitter/EventEmitter.d.ts +7 -0
  800. package/lib/typescript/utils/keyboard.d.ts +16 -0
  801. package/lib/typescript/utils/notification.d.ts +5 -0
  802. package/lib/typescript/utils/windowController.d.ts +10 -0
  803. package/package.json +49 -7
  804. package/react-native-hms.podspec +56 -2
  805. package/sdk-versions.json +4 -3
  806. package/src/classes/HMSAudioDevice.ts +18 -0
  807. package/src/classes/HMSAudioMixingMode.ts +11 -0
  808. package/src/classes/HMSAudioTrack.ts +9 -0
  809. package/src/classes/HMSAudioTrackSettings.ts +11 -0
  810. package/src/classes/HMSBrowserRecordingState.ts +4 -0
  811. package/src/classes/HMSCameraControl.ts +1 -1
  812. package/src/classes/HMSCameraFacing.ts +11 -0
  813. package/src/classes/HMSConfig.ts +27 -0
  814. package/src/classes/HMSEncoder.ts +57 -4
  815. package/src/classes/HMSException.ts +18 -0
  816. package/src/classes/HMSHLSPlaylistType.ts +4 -0
  817. package/src/classes/HMSHLSRecordingState.ts +9 -7
  818. package/src/classes/HMSHLSStreamingState.ts +15 -1
  819. package/src/classes/HMSHLSTimedMetadata.ts +16 -0
  820. package/src/classes/HMSHLSVariant.ts +5 -0
  821. package/src/classes/HMSIOSAudioMode.ts +15 -0
  822. package/src/classes/HMSInteractivityCenter.ts +246 -0
  823. package/src/classes/HMSInteractivityEncoder.ts +92 -0
  824. package/src/classes/HMSLogAlarmManager.ts +12 -0
  825. package/src/classes/HMSLogLevel.ts +12 -0
  826. package/src/classes/HMSLogSettings.ts +14 -0
  827. package/src/classes/HMSNativeEventEmitter.ts +1 -7
  828. package/src/classes/HMSNativeEventListener.ts +1 -1
  829. package/src/classes/HMSNetworkQuality.ts +11 -0
  830. package/src/classes/HMSNoiseCancellationPlugin.ts +162 -0
  831. package/src/classes/HMSPIPConfig.ts +54 -0
  832. package/src/classes/HMSPIPListenerActions.ts +18 -0
  833. package/src/classes/HMSPeer.ts +193 -3
  834. package/src/classes/HMSPeerListIterator.ts +29 -7
  835. package/src/classes/HMSPeerListIteratorOptions.ts +21 -0
  836. package/src/classes/HMSPeerType.ts +20 -0
  837. package/src/classes/HMSPeersCache.ts +3 -1
  838. package/src/classes/HMSPermissions.ts +25 -0
  839. package/src/classes/HMSPollsListenerActions.ts +3 -0
  840. package/src/classes/HMSRTMPConfig.ts +14 -0
  841. package/src/classes/HMSRecordingState.ts +9 -0
  842. package/src/classes/HMSRole.ts +17 -0
  843. package/src/classes/HMSRoom.ts +27 -0
  844. package/src/classes/HMSRoomCache.ts +10 -1
  845. package/src/classes/HMSRoomUpdate.ts +1 -0
  846. package/src/classes/HMSRtmpStreamingState.ts +4 -3
  847. package/src/classes/HMSRtmpVideoResolution.ts +13 -0
  848. package/src/classes/HMSSDK.tsx +1379 -345
  849. package/src/classes/HMSServerRecordingState.ts +4 -0
  850. package/src/classes/HMSSessionStore.ts +34 -45
  851. package/src/classes/HMSStreamingState.ts +7 -0
  852. package/src/classes/HMSTrack.ts +13 -0
  853. package/src/classes/HMSTrackSettings.ts +10 -0
  854. package/src/classes/HMSTrackSettingsInitState.ts +11 -0
  855. package/src/classes/HMSTrackSource.ts +10 -0
  856. package/src/classes/HMSTrackType.ts +7 -0
  857. package/src/classes/HMSUpdateListenerActions.ts +313 -3
  858. package/src/classes/HMSVideoTrack.ts +17 -0
  859. package/src/classes/HMSVideoTrackSettings.ts +27 -2
  860. package/src/classes/HmsView.tsx +92 -57
  861. package/src/classes/polls/DecodedPollLeaderboardResponse.ts +43 -0
  862. package/src/classes/polls/HMSPoll.ts +99 -0
  863. package/src/classes/polls/HMSPollCategory.ts +11 -0
  864. package/src/classes/polls/HMSPollCreateParams.ts +19 -0
  865. package/src/classes/polls/HMSPollLeaderboardEntry.ts +10 -0
  866. package/src/classes/polls/HMSPollLeaderboardSummary.ts +7 -0
  867. package/src/classes/polls/HMSPollQuestion.ts +92 -0
  868. package/src/classes/polls/HMSPollQuestionAnswer.ts +29 -0
  869. package/src/classes/polls/HMSPollQuestionCreateParams.ts +36 -0
  870. package/src/classes/polls/HMSPollQuestionOption.ts +24 -0
  871. package/src/classes/polls/HMSPollQuestionOptionCreateParams.ts +8 -0
  872. package/src/classes/polls/HMSPollQuestionQuizOptionCreateParams.ts +6 -0
  873. package/src/classes/polls/HMSPollQuestionResponse.ts +72 -0
  874. package/src/classes/polls/HMSPollQuestionResponseCreateParams.ts +6 -0
  875. package/src/classes/polls/HMSPollQuestionResponseResult.ts +19 -0
  876. package/src/classes/polls/HMSPollQuestionResult.ts +41 -0
  877. package/src/classes/polls/HMSPollQuestionType.ts +21 -0
  878. package/src/classes/polls/HMSPollResponsePeerInfo.ts +24 -0
  879. package/src/classes/polls/HMSPollResult.ts +26 -0
  880. package/src/classes/polls/HMSPollState.ts +16 -0
  881. package/src/classes/polls/HMSPollType.ts +4 -0
  882. package/src/classes/polls/HMSPollUpdateType.ts +5 -0
  883. package/src/classes/polls/HMSPollUserTrackingMode.ts +16 -0
  884. package/src/classes/polls/PollLeaderboardResponse.ts +8 -0
  885. package/src/classes/transcriptions/HMSTranscript.ts +13 -0
  886. package/src/classes/transcriptions/OnTranscriptionError.ts +5 -0
  887. package/src/classes/transcriptions/TranscriptionState.ts +6 -0
  888. package/src/classes/transcriptions/Transcriptions.ts +19 -0
  889. package/src/classes/transcriptions/TranscriptionsMode.ts +4 -0
  890. package/src/classes/transcriptions/index.ts +5 -0
  891. package/src/classes/whiteboard/HMSWhiteboard.tsx +16 -0
  892. package/src/classes/whiteboard/HMSWhiteboardListenerActions.ts +3 -0
  893. package/src/classes/whiteboard/HMSWhiteboardState.tsx +4 -0
  894. package/src/classes/whiteboard/HMSWhiteboardUpdateType.tsx +4 -0
  895. package/src/classes/whiteboard/index.ts +3 -0
  896. package/src/classes/whiteboard/registerCallbacks.ts +34 -0
  897. package/src/components/HMSHLSPlayer/HMSHLSPlayer.tsx +176 -92
  898. package/src/components/HMSHLSPlayer/RCTHMSHLSPlayer.ts +20 -13
  899. package/src/components/HMSHLSPlayer/hooks.ts +22 -4
  900. package/src/components/HMSHLSPlayer/index.ts +3 -0
  901. package/src/hooks/hmsviews.ts +15 -0
  902. package/src/hooks/polls.ts +14 -0
  903. package/src/index.ts +38 -3
  904. package/src/modules/HMSManagerModule.ts +5 -0
  905. package/src/specs/HMSHLSPlayerNativeComponent.ts +203 -0
  906. package/src/specs/HMSViewNativeComponent.ts +119 -0
  907. package/src/specs/NativeHMSManager.ts +307 -0
  908. package/src/stores/hls-player-playback-slice.ts +11 -0
  909. package/src/stores/hls-player-stats-store.ts +28 -18
  910. package/src/stores/hms-interactivity-store.ts +18 -0
  911. package/src/stores/hms-polls-slice.ts +20 -0
  912. package/src/stores/hms-store.ts +2 -0
  913. package/src/stores/hmsviews-slice.ts +20 -0
  914. package/src/stores/types.ts +50 -4
  915. package/src/types.ts +28 -3
  916. package/src/utils/emitter/EventEmitter.ts +26 -0
  917. package/src/utils/keyboard.ts +37 -0
  918. package/src/utils/notification.ts +10 -0
  919. package/src/utils/windowController.ts +23 -0
  920. package/android/.gradle/6.7.1/executionHistory/executionHistory.lock +0 -0
  921. package/android/.gradle/6.7.1/fileChanges/last-build.bin +0 -0
  922. package/android/.gradle/6.7.1/fileHashes/fileHashes.lock +0 -0
  923. package/android/.gradle/6.7.1/gc.properties +0 -0
  924. package/android/.gradle/6.9/executionHistory/executionHistory.bin +0 -0
  925. package/android/.gradle/6.9/executionHistory/executionHistory.lock +0 -0
  926. package/android/.gradle/6.9/fileChanges/last-build.bin +0 -0
  927. package/android/.gradle/6.9/fileHashes/fileHashes.bin +0 -0
  928. package/android/.gradle/6.9/fileHashes/fileHashes.lock +0 -0
  929. package/android/.gradle/6.9/fileHashes/resourceHashesCache.bin +0 -0
  930. package/android/.gradle/6.9/gc.properties +0 -0
  931. package/android/.gradle/6.9/javaCompile/classAnalysis.bin +0 -0
  932. package/android/.gradle/6.9/javaCompile/jarAnalysis.bin +0 -0
  933. package/android/.gradle/6.9/javaCompile/javaCompile.lock +0 -0
  934. package/android/.gradle/6.9/javaCompile/taskHistory.bin +0 -0
  935. package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
  936. package/android/.gradle/buildOutputCleanup/cache.properties +0 -2
  937. package/android/.gradle/buildOutputCleanup/outputFiles.bin +0 -0
  938. package/android/.gradle/checksums/checksums.lock +0 -0
  939. package/android/.gradle/checksums/md5-checksums.bin +0 -0
  940. package/android/.gradle/checksums/sha1-checksums.bin +0 -0
  941. package/android/.gradle/configuration-cache/gc.properties +0 -0
  942. package/android/.gradle/vcs-1/gc.properties +0 -0
  943. package/android/.idea/compiler.xml +0 -6
  944. package/android/.idea/gradle.xml +0 -18
  945. package/android/.idea/jarRepositories.xml +0 -45
  946. package/android/.idea/misc.xml +0 -10
  947. package/android/.idea/vcs.xml +0 -6
  948. package/android/local.properties +0 -8
  949. package/android/src/main/java/com/reactnativehmssdk/HMSHLSPlayerManager.kt +0 -114
  950. package/android/src/main/java/com/reactnativehmssdk/HMSSDKViewManager.kt +0 -115
  951. package/ios/Hmssdk.xcodeproj/project.xcworkspace/contents.xcworkspacedata +0 -7
  952. package/ios/Hmssdk.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +0 -8
  953. package/ios/Hmssdk.xcodeproj/project.xcworkspace/xcuserdata/jatinnagar.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
  954. package/ios/Hmssdk.xcodeproj/xcuserdata/jatinnagar.xcuserdatad/xcschemes/xcschememanagement.plist +0 -14
  955. package/lib/commonjs/classes/HMSManagerModule.js +0 -18
  956. package/lib/commonjs/classes/HMSManagerModule.js.map +0 -1
  957. package/lib/module/classes/HMSManagerModule.js +0 -11
  958. package/lib/module/classes/HMSManagerModule.js.map +0 -1
  959. package/src/classes/HMSManagerModule.ts +0 -18
  960. /package/lib/typescript/{classes → modules}/HMSManagerModule.d.ts +0 -0
@@ -1,35 +1,47 @@
1
- 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; }
2
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
3
- function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
1
+ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
2
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
3
+ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
4
4
  import React from 'react';
5
- import { AppState, Platform } from 'react-native';
5
+ import { Platform } from 'react-native';
6
6
  import { HMSEncoder } from './HMSEncoder';
7
7
  import { HMSHelper } from './HMSHelper';
8
8
  import { getLogger, logger, setLogger } from './HMSLogger';
9
- import { HMSTrackType } from './HMSTrackType';
10
9
  import { HMSUpdateListenerActions } from './HMSUpdateListenerActions';
11
10
  import { HmsViewComponent } from './HmsView';
12
- import HMSManager from './HMSManagerModule';
11
+ import HMSManager from '../modules/HMSManagerModule';
13
12
  import { HMSPIPListenerActions } from './HMSPIPListenerActions';
14
13
  import HMSNativeEventListener from './HMSNativeEventListener';
15
14
  import { clearHmsPeersCache, getHmsPeersCache, HMSPeersCache, setHmsPeersCache } from './HMSPeersCache';
16
15
  import { clearHmsRoomCache, getHmsRoomCache, HMSRoomCache, setHmsRoomCache } from './HMSRoomCache';
17
- import { HMSPeerUpdateOrdinals } from './HMSPeerUpdate';
16
+ import { HMSPeerUpdate, HMSPeerUpdateOrdinals } from './HMSPeerUpdate';
18
17
  import { HMSSessionStore } from './HMSSessionStore';
19
- // import type { HMSPeerListIteratorOptions } from './HMSPeerListIteratorOptions';
20
- // import { HMSPeerListIterator } from './HMSPeerListIterator';
21
- // TODO: Rename to HMSPIPConfig & to be moved to a separate file
18
+ import { HMSPeerListIterator } from './HMSPeerListIterator';
19
+ import { HMSInteractivityCenter } from './HMSInteractivityCenter';
22
20
  const ReactNativeVersion = require('react-native/Libraries/Core/ReactNativeVersion');
23
21
  let HmsSdk;
22
+
23
+ /**
24
+ * Represents the main SDK class for the 100ms (HMS) video conferencing service in a React Native application.
25
+ * This class provides methods to manage the video conferencing lifecycle including joining a room, leaving a room,
26
+ * managing streams, and handling events.
27
+ *
28
+ * @export
29
+ * @class HMSSDK
30
+ * @example
31
+ * const hmsInstance = await HMSSDK.build();
32
+ * await hmsInstance.join({ authToken: 'your_auth_token', username: 'John Appleseed' });
33
+ * @see https://www.100ms.live/docs/react-native/v2/quickstart/quickstart
34
+ */
24
35
  export class HMSSDK {
25
36
  constructor(id) {
26
- var _this = this;
27
37
  _defineProperty(this, "id", void 0);
28
- _defineProperty(this, "muteStatus", void 0);
38
+ _defineProperty(this, "_interactivityCenter", null);
29
39
  _defineProperty(this, "appStateSubscription", void 0);
30
40
  _defineProperty(this, "onPreviewDelegate", void 0);
31
41
  _defineProperty(this, "onJoinDelegate", void 0);
42
+ _defineProperty(this, "onPermissionsRequestedDelegate", void 0);
32
43
  _defineProperty(this, "onRoomDelegate", void 0);
44
+ _defineProperty(this, "onTranscriptsDelegate", void 0);
33
45
  _defineProperty(this, "onPeerDelegate", void 0);
34
46
  _defineProperty(this, "onPeerListUpdatedDelegate", void 0);
35
47
  _defineProperty(this, "onTrackDelegate", void 0);
@@ -52,7 +64,20 @@ export class HMSSDK {
52
64
  _defineProperty(this, "onPIPModeChangedDelegate", void 0);
53
65
  _defineProperty(this, "emitterSubscriptions", {});
54
66
  /**
55
- * - Calls removeListeners that in turn breaks all connections with native listeners.
67
+ * Asynchronously destroys the HMSSDK instance.
68
+ *
69
+ * - This method performs a series of cleanup actions before destroying the HMSSDK instance.
70
+ * - It logs the destruction process, clears both the HMS peers and room caches, removes all event listeners to prevent memory leaks, and finally calls the native
71
+ * `destroy` method on the `HMSManager` with the instance's ID.
72
+ * - This is typically used to ensure that all resources are properly released when the HMSSDK instance is no longer needed, such as when a user leaves a room or the application is shutting down.
73
+ *
74
+ * @returns {Promise<void>} A promise that resolves when the destruction process has completed.
75
+ * @throws {Error} If the HMSSDK instance cannot be destroyed.
76
+ *
77
+ * @example
78
+ * await hmsInstance.destroy();
79
+ *
80
+ * @see https://www.100ms.live/docs/react-native/v2/how-to-guides/install-the-sdk/hmssdk
56
81
  *
57
82
  * @memberof HMSSDK
58
83
  */
@@ -68,10 +93,23 @@ export class HMSSDK {
68
93
  });
69
94
  });
70
95
  /**
71
- * - getAuthTokenByRoomCode function is used to get the Auth Token by Room Code
72
- *
73
- * checkout {@link https://www.100ms.live/docs/concepts/v2/concepts/rooms/room-codes/room-codes} for more info
74
- *
96
+ * Asynchronously retrieves an authentication token using the room code, user ID, and endpoint.
97
+ *
98
+ * This method is responsible for fetching an authentication token that is required to join a room in the HMS ecosystem.
99
+ * It makes a call to the HMSManager's `getAuthTokenByRoomCode` method, passing in the necessary parameters.
100
+ * The function logs the attempt and returns the token as a string.
101
+ *
102
+ * @param {string} roomCode - The unique code of the room for which the token is being requested.
103
+ * @param {string} [userId] - Optional. The user ID of the participant requesting the token. This can be used for identifying the user in the backend.
104
+ * @param {string} [endpoint] - Optional. The endpoint URL to which the token request is sent. This can be used to specify a different authentication server if needed.
105
+ * @returns {Promise<string>} A promise that resolves to the authentication token as a string.
106
+ * @throws {Error} If the authentication token cannot be retrieved.
107
+ * @example
108
+ * const authToken = await hmsInstance.getAuthTokenByRoomCode('room-code');
109
+ *
110
+ * @see https://www.100ms.live/docs/react-native/v2/how-to-guides/listen-to-room-updates/get-methods#getauthtokenbyroomcode
111
+ * @async
112
+ * @function getAuthTokenByRoomCode
75
113
  * @memberof HMSSDK
76
114
  */
77
115
  _defineProperty(this, "getAuthTokenByRoomCode", async (roomCode, userId, endpoint) => {
@@ -89,12 +127,23 @@ export class HMSSDK {
89
127
  });
90
128
  });
91
129
  /**
92
- * takes an instance of [HMSConfig]{@link HMSConfig} and joins the room.
93
- * after joining the room user will start receiving the events and updates of the room.
130
+ * Asynchronously joins a room with the provided configuration
131
+ *
132
+ * This method is responsible for initiating the process of joining a room in the HMS ecosystem. It performs several key actions:
133
+ * - Logs the attempt to join with the provided configuration and instance ID.
134
+ * - Initializes the peers and room caches for the current session.
135
+ * - Calls the `join` method on the `HMSManager` with the provided configuration and the instance ID.
94
136
  *
95
- * checkout {@link https://www.100ms.live/docs/react-native/v2/features/join} for more info
137
+ * @param {HMSConfig} config - The configuration object required to join a room. This includes credentials, room details, and user information.
138
+ * @returns {Promise<void>} A promise that resolves when the join operation has been successfully initiated.
139
+ * @throws {Error} If the join operation cannot be completed.
96
140
  *
97
- * @param {HMSConfig} config
141
+ * @example
142
+ * await hmsInstance.join(hmsConfig);
143
+ *
144
+ * @see https://www.100ms.live/docs/react-native/v2/how-to-guides/set-up-video-conferencing/join
145
+ * @async
146
+ * @function join
98
147
  * @memberof HMSSDK
99
148
  */
100
149
  _defineProperty(this, "join", async config => {
@@ -102,7 +151,6 @@ export class HMSSDK {
102
151
  config,
103
152
  id: this.id
104
153
  });
105
- this.addAppStateListener();
106
154
  setHmsPeersCache(new HMSPeersCache(this.id));
107
155
  setHmsRoomCache(new HMSRoomCache(this.id));
108
156
  await HMSManager.join({
@@ -111,32 +159,61 @@ export class HMSSDK {
111
159
  });
112
160
  });
113
161
  /**
114
- * - preview function is used to initiate a preview for the localPeer.
115
- * - We can call this function and wait for a response in previewListener, the response will contain previewTracks for local peer.
116
- *
117
- * checkout {@link https://www.100ms.live/docs/react-native/v2/features/preview} for more info
118
- *
119
- * @param {HMSConfig} config
162
+ * Initiates a preview for the local peer.
163
+ *
164
+ * This function triggers the preview process for the local peer, allowing the application to display
165
+ * preview tracks (e.g., video or audio tracks) before joining a room. The response from the previewListener
166
+ * will contain the preview tracks for the local peer, which can be used to render a preview UI.
167
+ *
168
+ * @param {HMSConfig} config - The configuration object required for previewing, including credentials and user details.
169
+ * @example
170
+ * // Example usage of the preview function
171
+ * const previewConfig = {
172
+ * authToken: "your_auth_token",
173
+ * userName: "John Doe",
174
+ * roomCode: "your_room_code"
175
+ * };
176
+ * hmsInstance.preview(previewConfig);
177
+ *
178
+ * @see https://www.100ms.live/docs/react-native/v2/features/preview
179
+ *
180
+ * @async
181
+ * @function preview
120
182
  * @memberof HMSSDK
121
183
  */
122
- _defineProperty(this, "preview", config => {
184
+ _defineProperty(this, "preview", async config => {
123
185
  logger === null || logger === void 0 || logger.verbose('#Function preview', {
124
186
  config,
125
187
  id: this.id
126
188
  });
127
- HMSManager.preview({
189
+ await HMSManager.preview({
128
190
  ...config,
129
191
  id: this.id
130
192
  });
131
193
  });
132
194
  /**
133
- * - HmsView is react component that takes trackId and starts showing that track on a tile.
134
- * - The appearance of tile is completely customizable with style prop.
135
- * - Scale type can determine how the incoming video will fit in the canvas check {@link HMSVideoViewMode} for more information.
136
- * - Mirror to flip the video vertically.
137
- * - Auto Simulcast to automatically select the best Streaming Quality of track if feature is enabled in Room.
195
+ * `HmsView` is a React component that renders a video track within a view.
196
+ *
197
+ * It utilizes the `HmsViewComponent` to display the media track specified by the `trackId`.
198
+ * This component is designed to be used with React's `forwardRef` to allow for ref forwarding,
199
+ * enabling direct interaction with the DOM element.
200
+ *
201
+ * Props:
202
+ * - `trackId`: The unique identifier for the track to be displayed.
203
+ * - `style`: Custom styles to apply to the view.
204
+ * - `mirror`: If true, the video will be mirrored; commonly used for local video tracks.
205
+ * - `scaleType`: Determines how the video fits within the bounds of the view (e.g., aspect fill, aspect fit).
206
+ * - `setZOrderMediaOverlay`: When true, the video view will be rendered above the regular view hierarchy.
207
+ * - `autoSimulcast`: Enables automatic simulcast layer switching based on network conditions (if supported).
208
+ *
209
+ * @param {Object} props - The properties passed to the HmsView component.
210
+ * @param {React.Ref} ref - A ref provided by `forwardRef` for accessing the underlying DOM element.
211
+ * @returns {React.Element} A `HmsViewComponent` element configured with the provided props and ref.
212
+ * @memberof HMSSDK
213
+ * @example
214
+ * <HmsView trackId="track-id" style={{ width: 100, height: 100 }} mirror={true} scaleType="aspectFill" />
138
215
  *
139
- * checkout {@link https://www.100ms.live/docs/react-native/v2/features/render-video} for more info
216
+ * @see https://www.100ms.live/docs/react-native/v2/how-to-guides/set-up-video-conferencing/render-video/overview
140
217
  *
141
218
  * @param {HmsViewProps}
142
219
  * @memberof HMSSDK
@@ -163,17 +240,29 @@ export class HMSSDK {
163
240
  }));
164
241
  _defineProperty(this, "roomLeaveCleanup", () => {
165
242
  var _this$appStateSubscri;
166
- this.muteStatus = undefined;
167
243
  this === null || this === void 0 || (_this$appStateSubscri = this.appStateSubscription) === null || _this$appStateSubscri === void 0 || _this$appStateSubscri.remove();
168
244
  clearHmsPeersCache();
169
245
  clearHmsRoomCache();
170
246
  HMSEncoder.clearData(); // Clearing cached data in encoder
171
247
  });
172
248
  /**
173
- * Calls leave function of native sdk and session of current user is invalidated.
249
+ * Asynchronously leaves the current room and performs cleanup.
250
+ *
251
+ * This method triggers the leave process for the current user, effectively disconnecting them from the room they are in.
252
+ * It logs the leave action with the user's ID, calls the native `leave` method in `HMSManager` with the user's ID,
253
+ * and then performs additional cleanup through `roomLeaveCleanup`. This cleanup includes removing app state subscriptions
254
+ * and clearing cached data related to peers and the room.
255
+ *
256
+ * @returns {Promise<boolean>} A promise that resolves to `true` if the user has successfully left the room, or `false` otherwise.
257
+ * @throws {Error} If the user cannot leave the room.
258
+ * @memberof HMSSDK
259
+ * @example
260
+ * await hmsInstance.leave();
174
261
  *
175
- * checkout {@link https://www.100ms.live/docs/react-native/v2/features/leave} for more info
262
+ * @see https://www.100ms.live/docs/react-native/v2/features/leave
176
263
  *
264
+ * @async
265
+ * @function leave
177
266
  * @memberof HMSSDK
178
267
  */
179
268
  _defineProperty(this, "leave", async () => {
@@ -188,86 +277,137 @@ export class HMSSDK {
188
277
  return op;
189
278
  });
190
279
  /**
191
- * - This function sends message to all the peers in the room, the get the message in onMessage listener.
280
+ * Sends a broadcast message to all peers in the room.
192
281
  *
193
- * checkout {@link https://www.100ms.live/docs/react-native/v2/features/chat} for more info
282
+ * This asynchronous function sends a message to all peers in the room, which they can receive through the `onMessage` listener.
283
+ * It can be used to send chat messages or custom types of messages like emoji reactions or notifications.
194
284
  *
285
+ * @param {string} message - The message to be sent to all peers.
286
+ * @param {string} [type='chat'] - The type of the message. Default is 'chat'. Custom types can be used for specific purposes.
287
+ * @returns {Promise<{messageId: string | undefined}>} A promise that resolves with the message ID of the sent message, or undefined if the message could not be sent.
288
+ *
289
+ * @example
290
+ * // Sending a chat message to all peers
291
+ * await hmsInstance.sendBroadcastMessage("Hello everyone!", "chat");
292
+ *
293
+ * @example
294
+ * // Sending a custom notification to all peers
295
+ * await hmsInstance.sendBroadcastMessage("Meeting starts in 5 minutes", "notification");
296
+ *
297
+ * @see https://www.100ms.live/docs/react-native/v2/how-to-guides/set-up-video-conferencing/chat
298
+ *
299
+ * @async
300
+ * @function sendBroadcastMessage
195
301
  * @memberof HMSSDK
196
- * @param message the message that is to be sent
197
- * @param type the default type is set to CHAT. You can pass a custom type here for sending events like Emoji Reactions, Notifications, etc
198
302
  */
199
- _defineProperty(this, "sendBroadcastMessage", async function (message) {
200
- let type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'chat';
303
+ _defineProperty(this, "sendBroadcastMessage", async (message, type = 'chat') => {
201
304
  logger === null || logger === void 0 || logger.verbose('#Function sendBroadcastMessage', {
202
305
  message,
203
306
  type: type || null,
204
- id: _this.id
307
+ id: this.id
205
308
  });
206
309
  const data = await HMSManager.sendBroadcastMessage({
207
310
  message,
208
311
  type: type || null,
209
- id: _this.id
312
+ id: this.id
210
313
  });
211
314
  return data;
212
315
  });
213
316
  /**
214
- * - sendGroupMessage sends a message to specific set of roles, whoever has any of those role in room
215
- * will get the message in onMessage listener.
317
+ * Sends a message to a specific set of roles within the room.
318
+ *
319
+ * This method allows for targeted communication by sending a message to peers who have any of the specified roles.
320
+ * The message is received by the peers through the `onMessage` listener. This can be useful for sending announcements,
321
+ * instructions, or other types of messages to a subset of the room based on their roles.
322
+ *
323
+ * @param {string} message - The message to be sent.
324
+ * @param {HMSRole[]} roles - An array of roles to which the message will be sent. Peers with these roles will receive the message.
325
+ * @param {string} [type='chat'] - The type of the message. Defaults to 'chat'. Custom types can be used for specific messaging scenarios.
326
+ * @returns {Promise<{messageId: string | undefined}>} A promise that resolves with an object containing the `messageId` of the sent message. If the message could not be sent, `messageId` will be `undefined`.
216
327
  *
217
- * checkout {@link https://www.100ms.live/docs/react-native/v2/features/chat} for more info
328
+ * @example
329
+ * // Sending a message to all peers with the role of 'moderator'
330
+ * await hmsInstance.sendGroupMessage("Please start the meeting.", [moderator]);
218
331
  *
332
+ * @see https://www.100ms.live/docs/react-native/v2/features/chat
333
+ *
334
+ * @async
335
+ * @function sendGroupMessage
219
336
  * @memberof HMSSDK
220
337
  */
221
- _defineProperty(this, "sendGroupMessage", async function (message, roles) {
222
- let type = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'chat';
338
+ _defineProperty(this, "sendGroupMessage", async (message, roles, type = 'chat') => {
223
339
  logger === null || logger === void 0 || logger.verbose('#Function sendGroupMessage', {
224
340
  message,
225
341
  roles,
226
- id: _this.id,
342
+ id: this.id,
227
343
  type: type || null
228
344
  });
229
345
  const data = await HMSManager.sendGroupMessage({
230
346
  message,
231
347
  roles: HMSHelper.getRoleNames(roles),
232
- id: _this.id,
348
+ id: this.id,
233
349
  type: type || null
234
350
  });
235
351
  return data;
236
352
  });
237
353
  /**
238
- * - sendDirectMessage sends a private message to a single peer, only that peer will get the message
239
- * in onMessage Listener.
354
+ * Sends a direct message to a specific peer in the room.
355
+ *
356
+ * This method allows sending a private message to a single peer, ensuring that only the specified recipient can receive and view the message.
357
+ * The message is delivered to the recipient through the `onMessage` listener. This functionality is useful for implementing private chat features
358
+ * within a larger group chat context.
359
+ *
360
+ * @param {string} message - The message text to be sent.
361
+ * @param {HMSPeer} peer - The peer object representing the recipient of the message.
362
+ * @param {string} [type='chat'] - The type of the message being sent. Defaults to 'chat'. This can be customized to differentiate between various message types (e.g., 'private', 'system').
363
+ * @returns {Promise<{messageId: string | undefined}>} A promise that resolves with an object containing the `messageId` of the sent message. If the message could not be sent, `messageId` will be `undefined`.
364
+ * @throws {Error} Throws an error if the message could not be sent.
240
365
  *
241
- * checkout {@link https://www.100ms.live/docs/react-native/v2/features/chat} for more info
366
+ * @example
367
+ * // Sending a private chat message to a specific peer
368
+ * const peer = { peerID: 'peer123', ... };
369
+ * await hmsInstance.sendDirectMessage("Hello, this is a private message.", peer, "chat");
242
370
  *
371
+ * @see https://www.100ms.live/docs/react-native/v2/features/chat
372
+ *
373
+ * @async
374
+ * @function sendDirectMessage
243
375
  * @memberof HMSSDK
244
376
  */
245
- _defineProperty(this, "sendDirectMessage", async function (message, peer) {
246
- let type = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'chat';
377
+ _defineProperty(this, "sendDirectMessage", async (message, peer, type = 'chat') => {
247
378
  logger === null || logger === void 0 || logger.verbose('#Function sendDirectMessage', {
248
379
  message,
249
380
  peerId: peer.peerID,
250
- id: _this.id,
381
+ id: this.id,
251
382
  type: type || null
252
383
  });
253
384
  const data = await HMSManager.sendDirectMessage({
254
385
  message,
255
386
  peerId: peer.peerID,
256
- id: _this.id,
387
+ id: this.id,
257
388
  type: type || null
258
389
  });
259
390
  return data;
260
391
  });
261
392
  /**
262
- * - changeMetadata changes a specific field in localPeer which is [metadata] it is a string that can
263
- * be used for various functionalities like raiseHand, beRightBack and many more that explains the
264
- * current status of the peer.
265
- *
266
- * - it is advised to use a json object in string format to store multiple dataPoints in metadata.
267
- *
268
- * checkout {@link https://www.100ms.live/docs/react-native/v2/advanced-features/change-metadata} for more info
269
- *
270
- * @param {string}
393
+ * Asynchronously changes the metadata for the local peer.
394
+ *
395
+ * This method updates the metadata field of the local peer in the room. The metadata is a versatile field that can be used
396
+ * to store various information such as the peer's current status (e.g., raising hand, be right back, etc.). It is recommended
397
+ * to use a JSON object in string format to store multiple data points within the metadata. This allows for a structured and
398
+ * easily parseable format for metadata management.
399
+ *
400
+ * @param {string} metadata - The new metadata in string format. It is advised to use a JSON string for structured data.
401
+ * @returns {Promise<void>} A promise that resolves when the metadata has been successfully changed.
402
+ * @throws {Error} Throws an error if the metadata change operation fails.
403
+ * @see https://www.100ms.live/docs/react-native/v2/how-to-guides/interact-with-room/peer/change-metadata
404
+ * @example
405
+ * // Changing metadata to indicate the peer is raising their hand
406
+ * const newMetadata = JSON.stringify({ status: 'raiseHand' });
407
+ * await hmsInstance.changeMetadata(newMetadata);
408
+ *
409
+ * @async
410
+ * @function changeMetadata
271
411
  * @memberof HMSSDK
272
412
  */
273
413
  _defineProperty(this, "changeMetadata", async metadata => {
@@ -281,12 +421,28 @@ export class HMSSDK {
281
421
  });
282
422
  });
283
423
  /**
284
- * - startRTMPOrRecording takes a configuration object {@link HMSRTMPConfig} and stats the RTMP recording
285
- * - this object of {@link HMSRTMPConfig} sets the urls for streaming and weather to set recording on or not
286
- * - we get the response of this function in onRoomUpdate as RTMP_STREAMING_STATE_UPDATED.
287
- *
288
- * checkout {@link https://www.100ms.live/docs/react-native/v2/features/recording} for more info
289
- *
424
+ * Initiates RTMP streaming or recording based on the provided configuration.
425
+ *
426
+ * This method starts RTMP streaming or recording by taking a configuration object of type HMSRTMPConfig.
427
+ * The configuration specifies the URLs for streaming and whether recording should be enabled. The response to this
428
+ * operation can be observed in the `onRoomUpdate` event, specifically when the `RTMP_STREAMING_STATE_UPDATED` action is triggered.
429
+ *
430
+ * @param {HMSRTMPConfig} data - The configuration object for RTMP streaming or recording. It includes streaming URLs and recording settings.
431
+ * @returns {Promise<any>} A promise that resolves with the operation result when the streaming or recording starts successfully.
432
+ * @throws {Error} Throws an error if the operation fails or the configuration is invalid.
433
+ *
434
+ * @see https://www.100ms.live/docs/react-native/v2/how-to-guides/record-and-live-stream/recording
435
+ *
436
+ * @example
437
+ * const rtmpConfig = {
438
+ * meetingURL: "https://meet.example.com/myMeeting",
439
+ * rtmpURLs: ["rtmp://live.twitch.tv/app", "rtmp://a.rtmp.youtube.com/live2"],
440
+ * record: true,
441
+ * resolution: { width: 1280, height: 720 }
442
+ * };
443
+ * await hmsInstance.startRTMPOrRecording(rtmpConfig);
444
+ * @async
445
+ * @function startRTMPOrRecording
290
446
  * @memberof HMSSDK
291
447
  */
292
448
  _defineProperty(this, "startRTMPOrRecording", async data => {
@@ -301,12 +457,19 @@ export class HMSSDK {
301
457
  return op;
302
458
  });
303
459
  /**
304
- * - this function stops all the ongoing RTMP streaming and recording.
305
- * - we get the response of this function in onRoomUpdate as RTMP_STREAMING_STATE_UPDATED.
460
+ * Stops all ongoing RTMP streaming and recording.
306
461
  *
307
- * checkout {@link https://www.100ms.live/docs/react-native/v2/features/recording} for more info
462
+ * This function is responsible for halting any active RTMP streaming or recording sessions.
463
+ * It communicates with the native `HMSManager` module to execute the stop operation.
464
+ * The completion or status of this operation can be monitored through the `onRoomUpdate` event, specifically when the `RTMP_STREAMING_STATE_UPDATED` action is triggered, indicating that the streaming or recording has been successfully stopped.
308
465
  *
466
+ * @async
467
+ * @function stopRtmpAndRecording
468
+ * @returns {Promise<any>} A promise that resolves when the RTMP streaming and recording have been successfully stopped.
469
+ * @see https://www.100ms.live/docs/react-native/v2/how-to-guides/record-and-live-stream/recording
309
470
  * @memberof HMSSDK
471
+ * @example
472
+ * await hmsInstance.stopRtmpAndRecording();
310
473
  */
311
474
  _defineProperty(this, "stopRtmpAndRecording", async () => {
312
475
  logger === null || logger === void 0 || logger.verbose('#Function stopRtmpAndRecording', {});
@@ -316,13 +479,21 @@ export class HMSSDK {
316
479
  return op;
317
480
  });
318
481
  /**
319
- * - This function starts HLSStreaming.
320
- * - we get the response of this function in onRoomUpdate as HLS_STREAMING_STATE_UPDATED.
321
- *
322
- * checkout {@link https://www.100ms.live/docs/react-native/v2/features/hls-streaming} for more info
323
- *
324
- * @param {HMSHLSConfig}
482
+ * Initiates HLS (HTTP Live Streaming) based on the provided configuration.
483
+ *
484
+ * This asynchronous function starts HLS streaming, allowing for live video content to be delivered over the internet in a scalable manner.
485
+ * The function takes an optional `HMSHLSConfig` object as a parameter, which includes settings such as the meeting URL, HLS variant parameters, and recording settings.
486
+ * The operation's response can be observed through the `onRoomUpdate` event, specifically when the `HLS_STREAMING_STATE_UPDATED` action is triggered, indicating the streaming state has been updated.
487
+ *
488
+ * @param {HMSHLSConfig} [data] - Optional configuration object for HLS streaming. Defines parameters such as meeting URL, HLS variants, and recording options.
489
+ * @returns {Promise<any>} A promise that resolves when the HLS streaming starts successfully. The promise resolves with the operation result.
490
+ * @throws {Error} Throws an error if the operation fails or if the provided configuration is invalid.
491
+ * @see https://www.100ms.live/docs/react-native/v2/how-to-guides/record-and-live-stream/hls
492
+ * @async
493
+ * @function startHLSStreaming
325
494
  * @memberof HMSSDK
495
+ * @example
496
+ * await hmsInstance.startHLSStreaming();
326
497
  */
327
498
  _defineProperty(this, "startHLSStreaming", async data => {
328
499
  logger === null || logger === void 0 || logger.verbose('#Function startHLSStreaming', {
@@ -335,12 +506,19 @@ export class HMSSDK {
335
506
  });
336
507
  });
337
508
  /**
338
- * - stopHLSStreaming function stops the ongoing HLSStreams.
339
- * - we get the response of this function in onRoomUpdate as HLS_STREAMING_STATE_UPDATED.
509
+ * Stops the ongoing HLS (HTTP Live Streaming) streams.
340
510
  *
341
- * checkout {@link https://www.100ms.live/docs/react-native/v2/features/hls-streaming} for more info
511
+ * This asynchronous function is responsible for stopping any active HLS streaming sessions.
512
+ * It communicates with the native `HMSManager` module to execute the stop operation.
513
+ * The completion or status of this operation can be observed through the `onRoomUpdate` event, specifically when the `HLS_STREAMING_STATE_UPDATED` action is triggered, indicating that the HLS streaming has been successfully stopped.
342
514
  *
515
+ * @async
516
+ * @function stopHLSStreaming
517
+ * @returns {Promise<void>} A promise that resolves when the HLS streaming has been successfully stopped.
518
+ * @see https://www.100ms.live/docs/react-native/v2/how-to-guides/record-and-live-stream/hls for more details on HLS streaming.
343
519
  * @memberof HMSSDK
520
+ * @example
521
+ * await hmsInstance.stopHLSStreaming();
344
522
  */
345
523
  _defineProperty(this, "stopHLSStreaming", async () => {
346
524
  logger === null || logger === void 0 || logger.verbose('#Function stopHLSStreaming', {});
@@ -349,67 +527,123 @@ export class HMSSDK {
349
527
  });
350
528
  });
351
529
  /**
352
- * @deprecated This function has been deprecated in favor of #Function changeRoleOfPeer
353
- *
354
- * - This function can be used in a situation when we want to change role hence manipulate their
355
- * access and rights in the current room, it takes the peer {@link HMSPeer} whom role we want to change,
356
- * role {@link HMSRole} which will be the new role for that peer and weather to forcefully change
357
- * the role or ask the to accept the role change request using a boolean force.
358
- *
359
- * - if we change the role forcefully the peer's role will be updated without asking the peer
360
- * otherwise the user will get the roleChangeRequest in roleChangeRequest listener.
361
- * for more information on this checkout {@link onRoleChangeRequestListener}
362
- *
363
- * checkout {@link https://www.100ms.live/docs/react-native/v2/features/change-role} for more info
364
- *
530
+ * Sends timed metadata for HLS (HTTP Live Streaming) playback.
531
+ *
532
+ * This asynchronous function is designed to send metadata that can be synchronized with the HLS video playback.
533
+ * The metadata is sent to all viewers of the HLS stream, allowing for a variety of use cases such as displaying
534
+ * song titles, ads, or other information at specific times during the stream.
535
+ * The metadata should be an array of HMSHLSTimedMetadata objects, each specifying the content and timing for the metadata display.
536
+ *
537
+ * @async
538
+ * @function sendHLSTimedMetadata
539
+ * @param {HMSHLSTimedMetadata[]} metadata - An array of metadata objects to be sent.
540
+ * @returns {Promise<boolean>} A promise that resolves to `true` if the metadata was successfully sent, or `false` otherwise.
541
+ * @example
542
+ * const metadata = [
543
+ * { time: 10, data: "Song: Example Song Title" },
544
+ * { time: 20, data: "Advertisement: Buy Now!" }
545
+ * ];
546
+ * await hmsInstance.sendHLSTimedMetadata(metadata);
547
+ *
548
+ * @see https://www.100ms.live/docs/react-native/v2/how-to-guides/record-and-live-stream/hls-player#how-to-use-hls-timed-metadata-with-100ms-hls-player
549
+ */
550
+ _defineProperty(this, "sendHLSTimedMetadata", async metadata => {
551
+ const data = {
552
+ metadata,
553
+ id: this.id
554
+ };
555
+ logger === null || logger === void 0 || logger.verbose('#Function sendHLSTimedMetadata', data);
556
+ return await HMSManager.sendHLSTimedMetadata(data);
557
+ });
558
+ /**
559
+ * Deprecated. Changes the role of a specified peer within the room.
560
+ *
561
+ * This function is marked as deprecated and should not be used in new implementations. Use `changeRoleOfPeer` instead.
562
+ * It allows for the dynamic adjustment of a peer's permissions and capabilities within the room by changing their role.
563
+ * The role change can be enforced immediately or offered to the peer as a request, depending on the `force` parameter.
564
+ *
565
+ * @deprecated Since version 1.1.0. Use `changeRoleOfPeer` instead.
566
+ * @param {HMSPeer} peer - The peer whose role is to be changed.
567
+ * @param {HMSRole} role - The new role to be assigned to the peer.
568
+ * @param {boolean} [force=false] - If `true`, the role change is applied immediately without the peer's consent. If `false`, the peer receives a role change request.
569
+ * @returns {Promise<void>} A promise that resolves when the role change operation is complete.
570
+ * @throws {Error} Throws an error if the operation fails.
571
+ * @see https://www.100ms.live/docs/react-native/v2/how-to-guides/interact-with-room/peer/change-role
572
+ * @example
573
+ * // Change the role of a peer to 'viewer' forcefully
574
+ * const peer = { peerID: 'peer123', ... };
575
+ * const newRole = { name: 'viewer', ... };
576
+ * await hmsInstance.changeRole(peer, newRole, true);
577
+ * @async
578
+ * @function changeRole
365
579
  * @memberof HMSSDK
366
580
  */
367
- _defineProperty(this, "changeRole", async function (peer, role) {
368
- let force = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
581
+ _defineProperty(this, "changeRole", async (peer, role, force = false) => {
369
582
  const data = {
370
583
  peerId: peer === null || peer === void 0 ? void 0 : peer.peerID,
371
584
  role: role === null || role === void 0 ? void 0 : role.name,
372
585
  force: force,
373
- id: _this.id
586
+ id: this.id
374
587
  };
375
588
  logger === null || logger === void 0 || logger.verbose('#Function changeRole', data);
376
589
  return await HMSManager.changeRole(data);
377
590
  });
378
591
  /**
379
- * - This function can be used in a situation when we want to change role hence manipulate their
380
- * access and rights in the current room, it takes the peer {@link HMSPeer} whom role we want to change,
381
- * role {@link HMSRole} which will be the new role for that peer and weather to forcefully change
382
- * the role or ask the to accept the role change request using a boolean force.
383
- *
384
- * - if we change the role forcefully the peer's role will be updated without asking the peer
385
- * otherwise the user will get the roleChangeRequest in roleChangeRequest listener.
386
- * for more information on this checkout {@link onRoleChangeRequestListener}
387
- *
388
- * checkout {@link https://www.100ms.live/docs/react-native/v2/features/change-role} for more info
389
- *
592
+ * Asynchronously changes the role of a specified peer within the room.
593
+ *
594
+ * This function is designed to dynamically adjust a peer's permissions and capabilities within the room by changing their role.
595
+ * It can enforce the role change immediately or offer it to the peer as a request, depending on the `force` parameter.
596
+ * If the role change is forced, it is applied immediately without the peer's consent. Otherwise, the peer receives a role change request,
597
+ * which can be accepted or declined. This functionality supports flexible room management and control over participant permissions.
598
+ *
599
+ * @async
600
+ * @function changeRoleOfPeer
601
+ * @param {HMSPeer} peer - The peer whose role is to be changed.
602
+ * @param {HMSRole} role - The new role to be assigned to the peer.
603
+ * @param {boolean} [force=false] - Determines whether the role change should be applied immediately (`true`) or sent as a request (`false`).
604
+ * @returns {Promise<void>} A promise that resolves to `true` if the role change operation is successful, or `false` otherwise.
605
+ * @throws {Error} Throws an error if the operation fails.
606
+ * @see https://www.100ms.live/docs/react-native/v2/features/change-role
607
+ * @example
608
+ * // Change the role of a peer to 'viewer' forcefully
609
+ * const peer = { peerID: 'peer123', ... };
610
+ * const newRole = { name: 'viewer', ... };
611
+ * await hmsInstance.changeRoleOfPeer(peer, newRole, true);
612
+ *
613
+ * @async
614
+ * @function changeRoleOfPeer
390
615
  * @memberof HMSSDK
391
616
  */
392
- _defineProperty(this, "changeRoleOfPeer", async function (peer, role) {
393
- let force = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
617
+ _defineProperty(this, "changeRoleOfPeer", async (peer, role, force = false) => {
394
618
  const data = {
395
619
  peerId: peer.peerID,
396
620
  role: role.name,
397
621
  force: force,
398
- id: _this.id
622
+ id: this.id
399
623
  };
400
624
  logger === null || logger === void 0 || logger.verbose('#Function changeRoleOfPeer', data);
401
625
  return HMSManager.changeRoleOfPeer(data);
402
626
  });
403
627
  /**
404
- * - This function can be used in a situation when we want to change role of multiple peers by specifying their roles.
405
- * Hence manipulate their access and rights in the current room.
406
- * It takes the list of roles {@link HMSRole} whom role we want to change
407
- * and role {@link HMSRole} which will be the new role for peers.
408
- *
409
- * - Note that role will be updated without asking the peers.
410
- * Meaning, Peers will not get the roleChangeRequest in roleChangeRequest listener.
411
- *
412
- * checkout {@link https://www.100ms.live/docs/react-native/v2/features/change-role} for more info
628
+ * Asynchronously changes the roles of multiple peers within the room.
629
+ *
630
+ * This function is designed to batch update the roles of peers based on their current roles. It is particularly useful
631
+ * in scenarios where a group of users need to be granted or restricted permissions en masse, such as promoting all viewers
632
+ * to participants or demoting all speakers to viewers. The function updates the roles of all peers that have any of the specified
633
+ * `ofRoles` to the new `toRole` without requiring individual consent, bypassing the `roleChangeRequest` listener on the peer's end.
634
+ *
635
+ * @async
636
+ * @function changeRoleOfPeersWithRoles
637
+ * @param {HMSRole[]} ofRoles - An array of roles to identify the peers whose roles are to be changed.
638
+ * @param {HMSRole} toRole - The new role to be assigned to the identified peers.
639
+ * @returns {Promise<void>} A promise that resolves when the role change operation is complete.
640
+ * @throws {Error} Throws an error if the operation fails.
641
+ * @see https://www.100ms.live/docs/react-native/v2/how-to-guides/interact-with-room/peer/change-role
642
+ * @example
643
+ * // Change the role of all peers with 'viewer' role to 'participant'
644
+ * const viewerRole = { name: 'viewer', ... };
645
+ * const participantRole = { name: 'participant', ... };
646
+ * await hmsInstance.changeRoleOfPeersWithRoles([viewerRole], participantRole);
413
647
  *
414
648
  * @memberof HMSSDK
415
649
  */
@@ -423,13 +657,33 @@ export class HMSSDK {
423
657
  return HMSManager.changeRoleOfPeersWithRoles(data);
424
658
  });
425
659
  /**
426
- * - This function can be used to manipulate mute status of any track.
427
- * - Targeted peer affected by this action will get a callback in onChangeTrackStateRequestListener.
660
+ * Asynchronously changes the mute state of a specified track.
661
+ *
662
+ * This function is designed to control the mute state of any track (audio or video) within the room.
663
+ * When invoked, it sends a request to the HMSManager to change the mute state of the specified track.
664
+ * The targeted peer, whose track is being manipulated, will receive a callback on the `onChangeTrackStateRequestListener`,
665
+ * allowing for custom handling or UI updates based on the mute state change.
666
+ *
667
+ * @async
668
+ * @function changeTrackState
669
+ * @param {HMSTrack} track - The track object whose mute state is to be changed.
670
+ * @param {boolean} mute - The desired mute state of the track. `true` to mute the track, `false` to unmute.
671
+ * @returns {Promise<void>} A promise that resolves when the operation to change the track's mute state is complete.
672
+ * @throws {Error} Throws an error if the operation fails or the track cannot be found.
673
+ * @see https://www.100ms.live/docs/react-native/v2/how-to-guides/interact-with-room/track/remote-mute
674
+ * @async
675
+ * @function changeTrackState
676
+ * @memberof HMSSDK
428
677
  *
429
- * * checkout {@link https://www.100ms.live/docs/react-native/v2/features/change-track-state} for more info
678
+ * @example
679
+ * // Mute a specific track
680
+ * const trackToMute = { trackId: 'track123', ... };
681
+ * await hmsInstance.changeTrackState(trackToMute, true);
430
682
  *
431
- * @param {HMSTrack}
432
- * @memberof HMSSDK
683
+ * @example
684
+ * // Unmute a specific track
685
+ * const trackToUnmute = { trackId: 'track456', ... };
686
+ * await hmsInstance.changeTrackState(trackToUnmute, false);
433
687
  */
434
688
  _defineProperty(this, "changeTrackState", async (track, mute) => {
435
689
  logger === null || logger === void 0 || logger.verbose('#Function changeTrackState', {
@@ -445,12 +699,30 @@ export class HMSSDK {
445
699
  return await HMSManager.changeTrackState(data);
446
700
  });
447
701
  /**
448
- * - changeTrackStateForRoles is an enhancement on the functionality of {@link changeTrackState}.
449
- * - We can change mute status for all the tracks of peers having a particular role.
450
- * - @param source determines the source of the track ex. video, audio etc.
451
- * - The peers affected by this action will get a callback in onChangeTrackStateRequestListener.
452
- *
702
+ * Asynchronously changes the mute state of tracks for peers with specified roles.
703
+ *
704
+ * This method extends the functionality of `changeTrackState` by allowing the mute state of all tracks (audio, video, etc.)
705
+ * belonging to peers with certain roles to be changed in a single operation. It is particularly useful for managing the audio
706
+ * and video state of groups of users, such as muting all participants except the speaker in a conference call.
707
+ *
708
+ * The peers whose track states are being changed will receive a callback on `onChangeTrackStateRequestListener`, allowing for
709
+ * custom handling or UI updates based on the mute state change.
710
+ *
711
+ * @async
712
+ * @function changeTrackStateForRoles
713
+ * @param {boolean} mute - The desired mute state of the tracks. `true` to mute, `false` to unmute.
714
+ * @param {HMSTrackType} [type] - Optional. The type of the tracks to be muted/unmuted (e.g., audio, video).
715
+ * @param {string} [source] - Optional. The source of the track (e.g., camera, screen).
716
+ * @param {Array<HMSRole>} [roles] - The roles of the peers whose tracks are to be muted/unmuted. If not specified, affects all roles.
717
+ * @returns {Promise<void>} A promise that resolves when the operation to change the track's mute state is complete.
718
+ * @throws {Error} Throws an error if the operation fails.
719
+ * @see https://www.100ms.live/docs/react-native/v2/how-to-guides/interact-with-room/track/change-track-state-roles
453
720
  * @memberof HMSSDK
721
+ *
722
+ * @example
723
+ * // Mute all audio tracks for peers with the role of 'viewer'
724
+ * const viewerRole = { name: 'viewer', ... };
725
+ * await hmsInstance.changeTrackStateForRoles(true, 'audio', undefined, [viewerRole]);
454
726
  */
455
727
  _defineProperty(this, "changeTrackStateForRoles", async (mute, type, source, roles) => {
456
728
  let roleNames = null;
@@ -474,11 +746,27 @@ export class HMSSDK {
474
746
  return await HMSManager.changeTrackStateForRoles(data);
475
747
  });
476
748
  /**
477
- * - removePeer can forcefully disconnect a Peer from the room.
478
- * - the user who's removed from this action will get a callback in {@link onRemovedFromRoomListener}.
749
+ * Asynchronously removes a peer from the room.
479
750
  *
480
- * checkout {@link https://www.100ms.live/docs/react-native/v2/features/remove-peer} for more info
751
+ * This method forcefully disconnects a specified peer from the room.
752
+ * Upon successful removal, the removed peer will receive a callback through the `onRemovedFromRoomListener`, indicating
753
+ * they have been removed from the room.
754
+ * This can be used for managing room participants, such as removing disruptive users or managing room capacity.
481
755
  *
756
+ * @param {HMSPeer} peer - The peer object representing the participant to be removed.
757
+ * @param {string} reason - A string detailing the reason for the removal. This reason is communicated
758
+ * to the removed peer, providing context for the action.
759
+ * @returns {Promise<void>} A promise that resolves when the peer has been successfully removed.
760
+ * If the operation fails, the promise will reject with an error.
761
+ *
762
+ * @example
763
+ * // Assuming `peer` is an instance of HMSPeer representing the participant to remove
764
+ * await hmsInstance.removePeer(peer, "Violation of room rules");
765
+ *
766
+ * @see https://www.100ms.live/docs/react-native/v2/how-to-guides/interact-with-room/peer/remove-peer
767
+ *
768
+ * @async
769
+ * @function removePeer
482
770
  * @memberof HMSSDK
483
771
  */
484
772
  _defineProperty(this, "removePeer", async (peer, reason) => {
@@ -495,34 +783,58 @@ export class HMSSDK {
495
783
  return await HMSManager.removePeer(data);
496
784
  });
497
785
  /**
498
- * - endRoom can be used in a situation where we want to disconnect all the peers from current room
499
- * and end the call.
500
- * - everyone in the room will get an update of this action in {@link onRemovedFromRoomListener}.
786
+ * Asynchronously ends the current room session for all participants.
787
+ *
788
+ * This method is used to programmatically end the current room session, effectively disconnecting all participants.
789
+ * It can also optionally lock the room to prevent new participants from joining. This is particularly useful for
790
+ * managing the end of scheduled events or meetings, ensuring that all participants are removed at the same time.
791
+ * Upon successful execution, all participants will receive a notification through the `onRemovedFromRoomListener`
792
+ * indicating that they have been removed from the room.
793
+ *
794
+ * @param {string} reason - A descriptive reason for ending the room session. This reason is communicated to all participants.
795
+ * @param {boolean} [lock=false] - Optional. Specifies whether the room should be locked after ending the session. Default is `false`.
796
+ * @returns {Promise<void>} A promise that resolves when the room has been successfully ended and, optionally, locked.
501
797
  *
502
- * checkout {@link https://www.100ms.live/docs/react-native/v2/features/end-room} for more info
798
+ * @example
799
+ * // End the room and lock it to prevent rejoining
800
+ * await hmsInstance.endRoom("Meeting concluded", true);
503
801
  *
802
+ * @see https://www.100ms.live/docs/react-native/v2/how-to-guides/interact-with-room/room/end-room
803
+ * @async
804
+ * @function endRoom
504
805
  * @memberof HMSSDK
505
806
  */
506
- _defineProperty(this, "endRoom", async function (reason) {
507
- let lock = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
807
+ _defineProperty(this, "endRoom", async (reason, lock = false) => {
508
808
  logger === null || logger === void 0 || logger.verbose('#Function endRoom', {
509
809
  lock,
510
810
  reason,
511
- id: _this.id
811
+ id: this.id
512
812
  });
513
813
  const data = {
514
814
  lock,
515
815
  reason,
516
- id: _this.id
816
+ id: this.id
517
817
  };
518
818
  return await HMSManager.endRoom(data);
519
819
  });
520
820
  /**
521
- * - This function can be used to change name of localPeer.
821
+ * Asynchronously changes the name of the local peer.
822
+ *
823
+ * This function updates the name of the local peer in the room. It is useful for scenarios where a user's display name needs to be updated during a session, such as when a user decides to change their nickname or when correcting a typo in the user's name. The updated name is reflected across all participants in the room.
522
824
  *
523
- * checkout {@link https://www.100ms.live/docs/react-native/v2/features/change-name} for more info
825
+ * Once the name change is successful, all the peers receive HMSUpdateListenerActions.ON_PEER_UPDATE event with HMSPeerUpdate.NAME_CHANGED as update type. When this event is received, the UI for that peer should be updated.
524
826
  *
827
+ * @param {string} name - The new name to be set for the local peer.
828
+ * @returns {Promise<void>} A promise that resolves when the name change operation has been successfully completed.
829
+ * @throws {Error} Throws an error if the name change operation fails.
830
+ * @see https://www.100ms.live/docs/react-native/v2/how-to-guides/interact-with-room/peer/change-name for more information on changing the peer's name.
831
+ * @async
832
+ * @function changeName
525
833
  * @memberof HMSSDK
834
+ *
835
+ * @example
836
+ * // Change the name of the local peer to 'Alice'
837
+ * await hmsInstance.changeName("Alice");
526
838
  */
527
839
  _defineProperty(this, "changeName", async name => {
528
840
  logger === null || logger === void 0 || logger.verbose('#Function changeName', {
@@ -536,13 +848,22 @@ export class HMSSDK {
536
848
  return await HMSManager.changeName(data);
537
849
  });
538
850
  /**
539
- * -Preview for a specific Role before changing it.
851
+ * Asynchronously previews the audio and video tracks for a specific role before applying the role change.
852
+ *
853
+ * This method allows users to preview the expected audio and video tracks that will be visible to other peers in the room
854
+ * after changing their role. It is useful for scenarios where a user wants to understand the impact of a role change on their
855
+ * media tracks before making the change. This can help in ensuring that the right media settings are applied for the new role.
540
856
  *
541
- * By previewing before doing a Role Change, users can see their expected Audio & Video tracks which will be visible to other Peers in Room post changing the Role.
857
+ * @param {string} role - The role for which the preview is requested. The role should be defined within the room's role configurations.
858
+ * @returns {Promise<any>} A promise that resolves with the preview tracks information. The resolved object contains details about the audio and video tracks that would be available to the user if the role were changed to the specified role.
542
859
  *
543
- * checkout {@link https://www.100ms.live/docs/react-native/v2/how-to-guides/interact-with-room/peer/change-role} for more info
860
+ * @example
861
+ * // Preview the tracks for the 'speaker' role
862
+ * const previewTracks = await hmsInstance.previewForRole('speaker');
863
+ * console.log(previewTracks);
544
864
  *
545
- * @param {role: string}
865
+ * @async
866
+ * @function previewForRole
546
867
  * @memberof HMSSDK
547
868
  */
548
869
  _defineProperty(this, "previewForRole", async role => {
@@ -558,13 +879,22 @@ export class HMSSDK {
558
879
  return previewTracks;
559
880
  });
560
881
  /**
561
- * Cancel the Previewing for Role invocation.
882
+ * Asynchronously cancels the preview for a role change.
562
883
  *
563
- * If a [previewForRole] call was performed previously then calling this method clears the tracks created anticipating a Change of Role
564
- *
565
- * checkout {@link https://www.100ms.live/docs/react-native/v2/how-to-guides/interact-with-room/peer/change-role} for more info
884
+ * This method is intended to be used after a `previewForRole` invocation. It cancels the ongoing preview operation,
885
+ * effectively clearing any tracks that were created in anticipation of a role change. This is useful in scenarios where
886
+ * a role change preview was initiated but needs to be aborted before the actual role change occurs, allowing for clean
887
+ * state management and resource cleanup.
566
888
  *
889
+ * @async
890
+ * @function cancelPreview
567
891
  * @memberof HMSSDK
892
+ * @returns {Promise<{data: string}>} A promise that resolves with an object containing a data string.
893
+ *
894
+ * @example
895
+ * // Cancel a previously initiated role change preview
896
+ * await hmsInstance.cancelPreview();
897
+ *
568
898
  */
569
899
  _defineProperty(this, "cancelPreview", async () => {
570
900
  logger === null || logger === void 0 || logger.verbose('#Function cancelPreview', {
@@ -576,11 +906,25 @@ export class HMSSDK {
576
906
  return data;
577
907
  });
578
908
  /**
579
- * - Calling this function will accept the most recent roleChange request made by anyone in the room
909
+ * Asynchronously accepts a role change request for the local peer.
580
910
  *
581
- * checkout {@link https://www.100ms.live/docs/react-native/v2/features/change-role} for more info
911
+ * This method is used when a role change request has been made to the local peer, typically by an admin or moderator of the room.
912
+ * Invoking this method signals acceptance of the new role, and the role change is applied to the local peer. This can affect the peer's
913
+ * permissions and capabilities within the room, such as the ability to send video, audio, or chat messages.
582
914
  *
915
+ * The successful execution of this method triggers an update across the room, notifying other peers of the role change.
916
+ * It is important to handle this method's response to ensure the local UI reflects the new role's permissions and capabilities.
917
+ *
918
+ * @async
919
+ * @function acceptRoleChange
583
920
  * @memberof HMSSDK
921
+ * @returns {Promise<void>} A promise that resolves when the role change has been successfully accepted and applied.
922
+ * @throws {Error} Throws an error if the role change acceptance operation fails.
923
+ * @example
924
+ * // Accept a role change request to become a 'moderator'
925
+ * await hmsInstance.acceptRoleChange();
926
+ *
927
+ * @see https://www.100ms.live/docs/react-native/v2/how-to-guides/interact-with-room/peer/change-role
584
928
  */
585
929
  _defineProperty(this, "acceptRoleChange", async () => {
586
930
  logger === null || logger === void 0 || logger.verbose('#Function acceptRoleChange', {
@@ -591,28 +935,54 @@ export class HMSSDK {
591
935
  });
592
936
  });
593
937
  /**
594
- * - setPlaybackForAllAudio is an extension of the abilities of setPlaybackAllowed in
595
- * HMSRemoteAudioTrack. It sets mute status for all peers in the room only for the local peer.
938
+ * Sets the mute status for all remote audio tracks in the room for the local peer.
596
939
  *
597
- * checkout {@link https://www.100ms.live/docs/react-native/v2/features/playback-allowed} for more info
940
+ * This method allows the local user to mute or unmute the playback of all remote audio tracks in the room.
941
+ * It affects only the local peer's audio playback and does not impact other peers. This can be useful in scenarios
942
+ * where a user needs to quickly mute all incoming audio without affecting the audio state for other participants in the room.
598
943
  *
944
+ * @param {boolean} mute - A boolean value indicating whether to mute (`true`) or unmute (`false`) all remote audio tracks for the local peer.
945
+ * @returns {Promise<boolean>} A promise that resolves with a boolean value indicating the success of the operation.
946
+ * @throws {Error} Throws an error if the operation fails.
947
+ * @async
948
+ * @function setPlaybackForAllAudio
599
949
  * @memberof HMSSDK
950
+ * @example
951
+ * // Mute all remote audio tracks for the local peer
952
+ * hmsInstance.setPlaybackForAllAudio(true);
953
+ *
954
+ * @example
955
+ * // Unmute all remote audio tracks for the local peer
956
+ * hmsInstance.setPlaybackForAllAudio(false);
957
+ *
958
+ * @see https://www.100ms.live/docs/react-native/v2/how-to-guides/interact-with-room/track/playback-allowed
600
959
  */
601
- _defineProperty(this, "setPlaybackForAllAudio", mute => {
960
+ _defineProperty(this, "setPlaybackForAllAudio", async mute => {
602
961
  logger === null || logger === void 0 || logger.verbose('#Function setPlaybackForAllAudio', {
603
962
  mute,
604
963
  id: this.id
605
964
  });
606
- this.muteStatus = mute;
607
- HMSManager.setPlaybackForAllAudio({
965
+ return await HMSManager.setPlaybackForAllAudio({
608
966
  mute,
609
967
  id: this.id
610
968
  });
611
969
  });
612
970
  /**
613
- * - This function mutes audio for all peers in the room.
971
+ * Mutes the audio for all peers in the room.
972
+ *
973
+ * This asynchronous function communicates with the native `HMSManager` module to mute the audio tracks of all remote peers in the room.
974
+ * It is particularly useful in scenarios where a moderator needs to quickly mute all participants to prevent background noise or interruptions during a session.
614
975
  *
976
+ * @async
977
+ * @function remoteMuteAllAudio
615
978
  * @memberof HMSSDK
979
+ * @returns {Promise<{success: boolean}>} A promise that resolves with a boolean value indicating the success of the operation.
980
+ * @throws {Error} Throws an error if the operation fails.
981
+ * @example
982
+ * // Mute all remote audio tracks in the room
983
+ * await hmsInstance.remoteMuteAllAudio();
984
+ *
985
+ * @see https://www.100ms.live/docs/react-native/v2/how-to-guides/interact-with-room/track/remote-mute
616
986
  */
617
987
  _defineProperty(this, "remoteMuteAllAudio", async () => {
618
988
  logger === null || logger === void 0 || logger.verbose('#Function remoteMuteAllAudio', {
@@ -623,13 +993,23 @@ export class HMSSDK {
623
993
  });
624
994
  });
625
995
  /**
626
- * - getRoom is a wrapper function on an existing native function also known as getRoom the returns
627
- * current room object which is of type {@link HMSRoom}
996
+ * Retrieves the current room's details.
628
997
  *
629
- * checkout {@link https://www.100ms.live/docs/react-native/v2/features/join#get-room} for more info
998
+ * This method acts as a wrapper around the native `getRoom` function, providing an easy way to obtain the current room's state and details,
999
+ * including participants, tracks, and other relevant information. The room object is fetched from the native module and then processed
1000
+ * to match the expected format in the React Native layer. This method is useful for getting the room's state at any point in time, such as
1001
+ * when needing to display current room information or for debugging purposes.
630
1002
  *
1003
+ * @async
1004
+ * @function getRoom
631
1005
  * @memberof HMSSDK
632
- * @return Promise<HMSRoom>
1006
+ * @returns {Promise<HMSRoom>} A promise that resolves to the current room object.
1007
+ * @example
1008
+ * // Fetch the current room details
1009
+ * const roomDetails = await hmsInstance.getRoom();
1010
+ * console.log(roomDetails);
1011
+ *
1012
+ * @see https://www.100ms.live/docs/react-native/v2/how-to-guides/listen-to-room-updates/get-methods
633
1013
  */
634
1014
  _defineProperty(this, "getRoom", async () => {
635
1015
  var _getHmsRoomCache;
@@ -644,11 +1024,23 @@ export class HMSSDK {
644
1024
  return encodedHmsRoom;
645
1025
  });
646
1026
  /**
647
- * - getLocalPeer is a wrapper function on an existing native function also known as getLocalPeer the returns
648
- * current local peer object which is of type {@link HMSLocalPeer}
1027
+ * Retrieves the current local peer's details.
649
1028
  *
1029
+ * This asynchronous method wraps around the native `getLocalPeer` function, providing a straightforward way to obtain the current local peer's details,
1030
+ * including their ID, name, role, and any tracks they may be publishing. The local peer object is fetched from the native module and then processed
1031
+ * to match the expected format in the React Native layer. This method is particularly useful for operations that require information about the local user,
1032
+ * such as updating UI elements to reflect the current user's status or for debugging purposes.
1033
+ *
1034
+ * @async
1035
+ * @function getLocalPeer
650
1036
  * @memberof HMSSDK
651
- * @return Promise<HMSLocalPeer>
1037
+ * @returns {Promise<HMSLocalPeer>} A promise that resolves to the current local peer object.
1038
+ * @example
1039
+ * // Fetch the current local peer's details
1040
+ * const localPeerDetails = await hmsInstance.getLocalPeer();
1041
+ * console.log(localPeerDetails);
1042
+ *
1043
+ * @see https://www.100ms.live/docs/react-native/v2/how-to-guides/listen-to-room-updates/get-methods
652
1044
  */
653
1045
  _defineProperty(this, "getLocalPeer", async () => {
654
1046
  logger === null || logger === void 0 || logger.verbose('#Function getLocalPeer', {
@@ -661,11 +1053,22 @@ export class HMSSDK {
661
1053
  return encodedLocalPeer;
662
1054
  });
663
1055
  /**
664
- * - getRemotePeers is a wrapper function on an existing native function also known as getRemotePeers the returns
665
- * remote peers array which is of type {@link HMSRemotePeer}
1056
+ * Retrieves an array of remote peers currently in the room.
1057
+ *
1058
+ * This asynchronous method serves as a wrapper around the native `getRemotePeers` function, facilitating the retrieval of remote peers' details.
1059
+ * It fetches an array of `HMSRemotePeer` objects, each representing a remote participant in the room. The method processes the fetched data
1060
+ * to conform to the expected format in the React Native layer, making it suitable for UI rendering or further processing.
666
1061
  *
1062
+ * @async
1063
+ * @function getRemotePeers
667
1064
  * @memberof HMSSDK
668
- * @return Promise<HMSRemotePeer[]>
1065
+ * @returns {Promise<HMSRemotePeer[]>} A promise that resolves with an array of `HMSRemotePeer` objects, representing the remote peers in the room.
1066
+ * @example
1067
+ * // Fetch the list of remote peers in the room
1068
+ * const remotePeers = await hmsInstance.getRemotePeers();
1069
+ * console.log(remotePeers);
1070
+ *
1071
+ * @see https://www.100ms.live/docs/react-native/v2/how-to-guides/listen-to-room-updates/get-methods
669
1072
  */
670
1073
  _defineProperty(this, "getRemotePeers", async () => {
671
1074
  logger === null || logger === void 0 || logger.verbose('#Function getRemotePeers', {
@@ -678,11 +1081,22 @@ export class HMSSDK {
678
1081
  return encodedRemotePeers;
679
1082
  });
680
1083
  /**
681
- * - getRoles is a wrapper function on an existing native function also known as getRoles the returns
682
- * array of all present roles which is of type {@link HMSRole}
1084
+ * Retrieves a list of all roles currently available in the room.
1085
+ *
1086
+ * This asynchronous method calls the native `getRoles` function to fetch an array of `HMSRole` objects, representing the roles defined for the room.
1087
+ * Each `HMSRole` object includes details such as the role name, permissions, and other role-specific settings. The roles are then processed
1088
+ * to match the expected format in the React Native layer. This method is useful for operations that require a comprehensive list of roles,
1089
+ * such as displaying role options in a UI dropdown for role assignment or for role-based access control checks.
683
1090
  *
1091
+ * @async
1092
+ * @function getRoles
684
1093
  * @memberof HMSSDK
685
- * @return Promise<HMSRole[]>
1094
+ * @returns {Promise<HMSRole[]>} A promise that resolves with an array of `HMSRole` objects, representing the available roles in the room.
1095
+ *
1096
+ * @example
1097
+ * // Fetch the list of available roles in the room
1098
+ * const roles = await hmsInstance.getRoles();
1099
+ * console.log(roles);
686
1100
  */
687
1101
  _defineProperty(this, "getRoles", async () => {
688
1102
  logger === null || logger === void 0 || logger.verbose('#Function getRoles', {
@@ -695,55 +1109,56 @@ export class HMSSDK {
695
1109
  return encodedRoles;
696
1110
  });
697
1111
  /**
698
- * - This function sets the volume of any peer in the room
1112
+ * Sets the volume for a specific track of any peer in the room.
1113
+ *
1114
+ * This function allows the adjustment of the playback volume for any given audio track of a peer within the room.
1115
+ * It is particularly useful for controlling the audio levels of individual participants in a conference call or meeting.
1116
+ * The volume level is specified as a number. Volume level can vary from 0(min) to 10(max). The default value for volume is 1.0.
1117
+ *
1118
+ * @param {HMSTrack} track - The track object whose volume is to be set. This object must include a valid `trackId`.
1119
+ * @param {number} volume - The volume level to set for the specified track.
1120
+ * @returns {Promise<void>} A promise that resolves when the operation to set the track's volume is complete.
1121
+ * @throws {Error} Throws an error if the operation fails or the track cannot be found.
699
1122
  *
700
- * checkout {@link https://www.100ms.live/docs/react-native/v2/advanced-features/set-volume} for more info
1123
+ * @see https://www.100ms.live/docs/react-native/v2/how-to-guides/interact-with-room/track/set-volume
701
1124
  *
1125
+ * @async
702
1126
  * @memberof HMSSDK
1127
+ *
1128
+ * @example
1129
+ * // Assuming `track` is an instance of HMSTrack representing the participant's audio track
1130
+ * hmsInstance.setVolume(track, 10);
703
1131
  */
704
- _defineProperty(this, "setVolume", (track, volume) => {
1132
+ _defineProperty(this, "setVolume", async (track, volume) => {
705
1133
  logger === null || logger === void 0 || logger.verbose('#Function setVolume', {
706
1134
  track,
707
1135
  volume,
708
1136
  id: this.id
709
1137
  });
710
- HMSManager.setVolume({
1138
+ return await HMSManager.setVolume({
711
1139
  id: this.id,
712
1140
  trackId: track.trackId,
713
1141
  volume
714
1142
  });
715
1143
  });
716
- _defineProperty(this, "resetVolume", () => {
717
- logger === null || logger === void 0 || logger.verbose('#Function resetVolume', {
718
- id: this.id
719
- });
720
- if (Platform.OS === 'android') HMSManager.resetVolume({
721
- id: this.id
722
- });
723
- });
724
1144
  /**
725
- * - This is a temporary solution for the situation when mic access is taken from the app and
726
- * user returns to the app with no mic access. It will re-acquire the mic by setting the volume
727
- * from native side
1145
+ * Initiates screen sharing in the room.
728
1146
  *
729
- * @memberof HMSSDK
730
- */
731
- _defineProperty(this, "addAppStateListener", () => {
732
- logger === null || logger === void 0 || logger.verbose('#Function addAppStateListener', {
733
- id: this.id
734
- });
735
- this.appStateSubscription = AppState.addEventListener('change', nextAppState => {
736
- if (nextAppState === 'active' && Platform.OS === 'android') {
737
- this.resetVolume();
738
- }
739
- });
740
- });
741
- /**
742
- * - This function is used to start screenshare, currently available only for android
1147
+ * This asynchronous function triggers the screen sharing feature, allowing the local peer to share their screen with other participants in the room.
1148
+ * Upon successful execution, other participants in the room will be able to see the shared screen as part of the video conference.
743
1149
  *
744
- * checkout {@link https://www.100ms.live/docs/react-native/v2/features/screenshare} for more info
1150
+ * Note: Proper permissions must be granted by the user for screen sharing to work. Ensure to handle permission requests appropriately in your application.
745
1151
  *
1152
+ * @async
1153
+ * @function startScreenshare
746
1154
  * @memberof HMSSDK
1155
+ * @returns {Promise<void>} A promise that resolves when the screen sharing has successfully started.
1156
+ * @throws {Error} Throws an error if the operation fails or screen sharing cannot be initiated.
1157
+ *
1158
+ * @see https://www.100ms.live/docs/react-native/v2/how-to-guides/set-up-video-conferencing/screenshare
1159
+ * @example
1160
+ * // Start screen sharing
1161
+ * await hmsInstance.startScreenshare();
747
1162
  */
748
1163
  _defineProperty(this, "startScreenshare", async () => {
749
1164
  logger === null || logger === void 0 || logger.verbose('#Function startScreenshare', {
@@ -754,11 +1169,22 @@ export class HMSSDK {
754
1169
  });
755
1170
  });
756
1171
  /**
757
- * - Returns a boolean stating if the screen is currently shared or not
1172
+ * Checks if the screen sharing is currently active in the room.
758
1173
  *
759
- * checkout {@link https://www.100ms.live/docs/react-native/v2/features/screenshare} for more info
1174
+ * This asynchronous method queries the native `HMSManager` module to determine if the screen is currently being shared by the local peer in the room.
1175
+ * It returns a promise that resolves to a boolean value, indicating the screen sharing status. `true` signifies that the screen sharing is active,
1176
+ * while `false` indicates that it is not. This method can be used to toggle UI elements or to decide whether to start or stop screen sharing based on the current state.
760
1177
  *
1178
+ * @async
1179
+ * @function isScreenShared
761
1180
  * @memberof HMSSDK
1181
+ * @returns {Promise<boolean>} A promise that resolves to a boolean indicating whether the screen is currently shared.
1182
+ * @example
1183
+ * // Check if the screen is currently shared
1184
+ * const isShared = await hmsInstance.isScreenShared();
1185
+ * console.log(isShared ? "Screen is being shared" : "Screen is not being shared");
1186
+ *
1187
+ * @see https://www.100ms.live/docs/react-native/v2/how-to-guides/set-up-video-conferencing/screenshare
762
1188
  */
763
1189
  _defineProperty(this, "isScreenShared", async () => {
764
1190
  logger === null || logger === void 0 || logger.verbose('#Function isScreenShared', {
@@ -769,11 +1195,25 @@ export class HMSSDK {
769
1195
  });
770
1196
  });
771
1197
  /**
772
- * - stops the screenShare, currently available for android only.
1198
+ * Asynchronously stops the screen sharing session.
1199
+ *
1200
+ * This method communicates with the native `HMSManager` module to stop the ongoing screen sharing session initiated by the local peer.
1201
+ * Upon successful execution, the screen sharing session is terminated, and other participants
1202
+ * in the room will no longer be able to see the shared screen. This method can be used to programmatically control the end of a screen sharing session,
1203
+ * providing flexibility in managing the screen sharing feature within your application.
773
1204
  *
774
- * checkout {@link https://www.100ms.live/docs/react-native/v2/features/screenshare} for more info
1205
+ * Note: Ensure that the necessary permissions and conditions for screen sharing are managed appropriately in your application.
775
1206
  *
1207
+ * @async
1208
+ * @function stopScreenshare
776
1209
  * @memberof HMSSDK
1210
+ * @returns {Promise<void>} A promise that resolves when the screen sharing has successfully stopped.
1211
+ * @throws {Error} Throws an error if the operation fails or the screen sharing cannot be stopped.
1212
+ *
1213
+ * @see https://www.100ms.live/docs/react-native/v2/how-to-guides/set-up-video-conferencing/screenshare
1214
+ * @example
1215
+ * // Stop screen sharing
1216
+ * await hmsInstance.stopScreenshare();
777
1217
  */
778
1218
  _defineProperty(this, "stopScreenshare", async () => {
779
1219
  logger === null || logger === void 0 || logger.verbose('#Function stopScreenshare', {
@@ -783,6 +1223,21 @@ export class HMSSDK {
783
1223
  id: this.id
784
1224
  });
785
1225
  });
1226
+ /**
1227
+ * Enables network quality updates for the local peer.
1228
+ *
1229
+ * This method activates the network quality monitoring feature, which periodically assesses and reports the network quality of peers in a room.
1230
+ * The network quality updates are useful for providing feedback to the user about their current connection status, potentially prompting them to improve their network environment if necessary.
1231
+ * Upon enabling, network quality updates are emitted through the appropriate event listeners - `HMSPeerUpdate.NETWORK_QUALITY_UPDATED` allowing the application to react or display the network status dynamically.
1232
+ *
1233
+ * @function enableNetworkQualityUpdates
1234
+ * @memberof HMSSDK
1235
+ * @example
1236
+ * // Enable network quality updates
1237
+ * hmsInstance.enableNetworkQualityUpdates();
1238
+ *
1239
+ * @see https://www.100ms.live/docs/react-native/v2/how-to-guides/measure-network-quality-and-performance/network-quality
1240
+ */
786
1241
  _defineProperty(this, "enableNetworkQualityUpdates", () => {
787
1242
  logger === null || logger === void 0 || logger.verbose('#Function enableNetworkQualityUpdates', {
788
1243
  id: this.id
@@ -791,6 +1246,21 @@ export class HMSSDK {
791
1246
  id: this.id
792
1247
  });
793
1248
  });
1249
+ /**
1250
+ * Disables network quality updates for the local peer.
1251
+ *
1252
+ * This method deactivates the network quality monitoring feature, which stops the periodic assessment and reporting of the network quality of peers in a room.
1253
+ * Disabling network quality updates can be useful in scenarios where network quality information is no longer needed, or to reduce the computational overhead associated with monitoring network quality.
1254
+ * Once disabled, network quality updates will no longer be emitted through the event listeners, allowing the application to cease reacting to or displaying network status information.
1255
+ *
1256
+ * @function disableNetworkQualityUpdates
1257
+ * @memberof HMSSDK
1258
+ * @example
1259
+ * // Disable network quality updates
1260
+ * hmsInstance.disableNetworkQualityUpdates();
1261
+ *
1262
+ * @see https://www.100ms.live/docs/react-native/v2/how-to-guides/measure-network-quality-and-performance/network-quality
1263
+ */
794
1264
  _defineProperty(this, "disableNetworkQualityUpdates", () => {
795
1265
  logger === null || logger === void 0 || logger.verbose('#Function disableNetworkQualityUpdates', {
796
1266
  id: this.id
@@ -800,12 +1270,26 @@ export class HMSSDK {
800
1270
  });
801
1271
  });
802
1272
  /**
803
- * - This wrapper function is used to start streaming device audio, currently available only for android.
1273
+ * Starts streaming device audio, available only on Android devices.
804
1274
  *
805
- * checkout {@link https://www.100ms.live/docs/react-native/v2/features/audio-share#how-to-stream-device-audio-from-the-app} for more info.
1275
+ * This method allows the application to share device audio, such as music or system sounds, with other participants in a video conference.
1276
+ * It leverages the native HMSManager's `startAudioshare` method to initiate audio sharing. The function takes an `HMSAudioMixingMode` parameter,
1277
+ * which specifies the audio mixing mode to be used during the audio share session.
806
1278
  *
807
- * @param {HMSAudioMixingMode}
808
- * @memberof HMSSDK
1279
+ * Note: This feature is currently supported only on Android. Attempting to use this feature on iOS will result in a console log indicating
1280
+ * that the API is not available for iOS.
1281
+ *
1282
+ * @async
1283
+ * @function startAudioshare
1284
+ * @param {HMSAudioMixingMode} audioMixingMode - The audio mixing mode to be used for the audio share session.
1285
+ * @returns {Promise} A promise that resolves to a success if the audio share is started successfully
1286
+ * @throws {Error} Throws an error if the operation fails or the audio share cannot be started.
1287
+ *
1288
+ * @see https://www.100ms.live/docs/react-native/v2/how-to-guides/set-up-video-conferencing/local-audio-share
1289
+ *
1290
+ * @example
1291
+ * // Start audio sharing with the default mixing mode
1292
+ * await hmsInstance.startAudioshare(HMSAudioMixingMode.DEFAULT);
809
1293
  */
810
1294
  _defineProperty(this, "startAudioshare", async audioMixingMode => {
811
1295
  logger === null || logger === void 0 || logger.verbose('#Function startAudioshare', {
@@ -823,11 +1307,21 @@ export class HMSSDK {
823
1307
  }
824
1308
  });
825
1309
  /**
826
- * - This wrapper function returns true if audio is being shared and vice versa, currently available only for android.
1310
+ * Checks if audio sharing is currently active.
827
1311
  *
828
- * checkout {@link https://www.100ms.live/docs/react-native/v2/features/audio-share#how-to-get-audio-share-status} for more info.
1312
+ * This asynchronous method determines whether audio sharing is currently active, with support limited to Android devices.
1313
+ * On Android, it queries the native `HMSManager` module to check the audio sharing status and returns a promise that resolves to a boolean value.
829
1314
  *
1315
+ * @async
1316
+ * @function isAudioShared
830
1317
  * @memberof HMSSDK
1318
+ * @returns {Promise<boolean>} A promise that resolves to a boolean indicating whether audio sharing is currently active.
1319
+ * @example
1320
+ * // Check if audio is being shared on an Android device
1321
+ * const isSharing = await hmsInstance.isAudioShared();
1322
+ * console.log(isSharing); // true or false based on the sharing status, or a message for iOS
1323
+ *
1324
+ * @see https://www.100ms.live/docs/react-native/v2/how-to-guides/set-up-video-conferencing/local-audio-share
831
1325
  */
832
1326
  _defineProperty(this, "isAudioShared", async () => {
833
1327
  logger === null || logger === void 0 || logger.verbose('#Function isAudioShared', {
@@ -839,15 +1333,25 @@ export class HMSSDK {
839
1333
  });
840
1334
  } else {
841
1335
  console.log('API currently not available for iOS');
842
- return 'API currently not available for iOS';
1336
+ return Promise.resolve(false);
843
1337
  }
844
1338
  });
845
1339
  /**
846
- * - This wrapper function is used to stop streaming device audio, currently available only for android.
1340
+ * Stops the streaming of device audio, with functionality currently limited to Android devices.
847
1341
  *
848
- * checkout {@link https://www.100ms.live/docs/react-native/v2/features/audio-share#how-to-stop-audio-sharing} for more info.
1342
+ * This asynchronous method communicates with the native `HMSManager` module to stop the audio sharing session that was previously started.
1343
+ * It is primarily used when the application needs to cease sharing device audio, such as music or system sounds, with other participants in a video conference.
1344
+ * On Android devices, it successfully terminates the audio share session. On iOS devices, since the feature is not supported, it logs a message indicating the unavailability of the API.
849
1345
  *
1346
+ * @async
1347
+ * @function stopAudioshare
850
1348
  * @memberof HMSSDK
1349
+ * @returns {Promise<boolean>} A promise that resolves to a boolean indicating the success of the operation.
1350
+ * @see https://www.100ms.live/docs/react-native/v2/how-to-guides/set-up-video-conferencing/local-audio-share
1351
+ *
1352
+ * @example
1353
+ * // Stop audio sharing
1354
+ * await hmsInstance.stopAudioshare();
851
1355
  */
852
1356
  _defineProperty(this, "stopAudioshare", async () => {
853
1357
  logger === null || logger === void 0 || logger.verbose('#Function stopAudioshare', {
@@ -859,14 +1363,30 @@ export class HMSSDK {
859
1363
  });
860
1364
  } else {
861
1365
  console.log('API currently not available for iOS');
862
- return 'API currently not available for iOS';
1366
+ return Promise.resolve(false);
863
1367
  }
864
1368
  });
865
1369
  /**
866
- * - This wrapper function returns the current audio mixing mode, currently available only for android.
1370
+ * Asynchronously retrieves the current audio mixing mode, with functionality currently limited to Android devices.
1371
+ *
1372
+ * This method queries the native `HMSManager` module to obtain the current audio mixing mode used in the audio share session.
1373
+ * The audio mixing mode determines how local and remote audio tracks are mixed together during an audio share session.
1374
+ *
1375
+ * Note: This feature is only supported on Android. Attempting to use this feature on iOS will result in a console log indicating
1376
+ * that the API is not available for iOS devices.
867
1377
  *
1378
+ * @async
1379
+ * @function getAudioMixingMode
868
1380
  * @memberof HMSSDK
869
- * @return HMSAudioMixingMode
1381
+ * @returns {Promise<string>} A promise that resolves to a string indicating the current audio mixing mode.
1382
+ *
1383
+ * @throws {Error} Throws an error if the operation fails or the audio mixing mode cannot be retrieved.
1384
+ *
1385
+ * @see https://www.100ms.live/docs/react-native/v2/how-to-guides/set-up-video-conferencing/local-audio-share
1386
+ * @example
1387
+ * // Get the current audio mixing mode on an Android device
1388
+ * const mixingMode = await hmsInstance.getAudioMixingMode();
1389
+ * console.log(mixingMode); // Outputs the current audio mixing mode or a message for iOS
870
1390
  */
871
1391
  _defineProperty(this, "getAudioMixingMode", async () => {
872
1392
  logger === null || logger === void 0 || logger.verbose('#Function getAudioMixingMode', {
@@ -878,15 +1398,27 @@ export class HMSSDK {
878
1398
  });
879
1399
  } else {
880
1400
  console.log('API currently not available for iOS');
881
- return 'API currently not available for iOS';
1401
+ return Promise.reject('API currently not available for iOS');
882
1402
  }
883
1403
  });
884
1404
  /**
885
- * - This wrapper function used to change the mode while the user is streaming audio, currently available only for android.
1405
+ * Sets the audio mixing mode for the current session. Android only.
1406
+ *
1407
+ * This asynchronous function is used to change the mode of audio mixing during a session. It is currently
1408
+ * available only for Android. The function logs the action with the instance ID and the specified audio mixing mode,
1409
+ * then calls the native `setAudioMixingMode` method in `HMSManager` with the provided parameters.
1410
+ *
1411
+ * If the platform is not Android, it logs a message indicating that the API is not available for iOS.
1412
+ *
1413
+ * @param {HMSAudioMixingMode} audioMixingMode - The audio mixing mode to be set.
1414
+ * @returns {Promise<boolean>} A promise that resolves to a boolean indicating the success of the operation.
1415
+ * @throws {Error} Throws an error if the operation fails or the audio mixing mode cannot be set.
1416
+ *
1417
+ * @example
1418
+ * await hmsInstance.setAudioMixingMode(HMSAudioMixingMode.TALK_AND_MUSIC);
886
1419
  *
887
- * checkout {@link https://www.100ms.live/docs/react-native/v2/features/audio-share#how-to-change-mode} for more info
1420
+ * @see https://www.100ms.live/docs/react-native/v2/how-to-guides/set-up-video-conferencing/local-audio-share
888
1421
  *
889
- * @param {HMSAudioMixingMode}
890
1422
  * @memberof HMSSDK
891
1423
  */
892
1424
  _defineProperty(this, "setAudioMixingMode", async audioMixingMode => {
@@ -901,17 +1433,24 @@ export class HMSSDK {
901
1433
  });
902
1434
  } else {
903
1435
  console.log('API currently not available for iOS');
904
- return 'API currently not available for iOS';
1436
+ return Promise.reject('API currently not available for iOS');
905
1437
  }
906
1438
  });
907
1439
  /**
908
- * - This wrapper function returns the array of audio output devices which is of
909
- * type {@link HMSAudioDevice[]}, currently available only for android.
1440
+ * Retrieves a list of audio output devices. Android only.
1441
+ *
1442
+ * This method asynchronously fetches and returns an array of audio output devices available on the device.
1443
+ * It is designed to work specifically on Android platforms. For iOS, it will reject the promise with a message
1444
+ * indicating that the API is not available. This can be useful for applications that need to display or allow
1445
+ * the user to select from available audio output options, such as speakers, headphones, or Bluetooth devices.
910
1446
  *
911
- * checkout {@link https://www.100ms.live/docs/react-native/v2/features/audio-output-routing#get-list-of-audio-device} for more info
1447
+ * @see https://www.100ms.live/docs/react-native/v2/how-to-guides/configure-your-device/speaker/audio-output-routing
912
1448
  *
913
1449
  * @memberof HMSSDK
914
- * @return HMSAudioDevice[]
1450
+ * @returns {Promise<HMSAudioDevice[]>} A promise that resolves to an array of `HMSAudioDevice` objects on Android. On iOS, the promise is rejected.
1451
+ * @example
1452
+ * // Get the list of audio output devices
1453
+ * const audioDevices = await hmsInstance.getAudioDevicesList();
915
1454
  */
916
1455
  _defineProperty(this, "getAudioDevicesList", async () => {
917
1456
  logger === null || logger === void 0 || logger.verbose('#Function getAudioDevicesList', {
@@ -923,17 +1462,25 @@ export class HMSSDK {
923
1462
  });
924
1463
  } else {
925
1464
  console.log('API currently not available for iOS');
926
- return 'API currently not available for iOS';
1465
+ return Promise.reject('API currently not available for iOS');
927
1466
  }
928
1467
  });
929
1468
  /**
930
- * - This wrapper function returns the current audio output device which is of
931
- * type {@link HMSAudioDevice}, currently available only for android.
1469
+ * Retrieves the current audio output device type on Android devices.
1470
+ *
1471
+ * This method is a wrapper function that returns the type of the current audio output device.
1472
+ * The return type is a `HMSAudioDevice`, which is an enumeration representing different types of audio output devices.
1473
+ *
1474
+ * Note: This API is not available for iOS devices. If invoked on iOS, it logs a message indicating the unavailability and rejects the promise.
932
1475
  *
933
- * checkout {@link https://www.100ms.live/docs/react-native/v2/features/audio-output-routing#get-current-focussed-device} for more info
1476
+ * @see https://www.100ms.live/docs/react-native/v2/how-to-guides/configure-your-device/speaker/audio-output-routing
934
1477
  *
935
1478
  * @memberof HMSSDK
936
- * @return HMSAudioDevice
1479
+ * @returns {Promise<HMSAudioDevice>} A promise that resolves to the current audio output device type if the platform is Android. If the platform is iOS, the promise is rejected.
1480
+ *
1481
+ * @example
1482
+ * // Get the current audio output device type
1483
+ * const currentAudioOutputDevice = await hmsInstance.getAudioOutputRouteType();
937
1484
  */
938
1485
  _defineProperty(this, "getAudioOutputRouteType", async () => {
939
1486
  logger === null || logger === void 0 || logger.verbose('#Function getAudioOutputRouteType', {
@@ -945,32 +1492,33 @@ export class HMSSDK {
945
1492
  });
946
1493
  } else {
947
1494
  console.log('API currently not available for iOS');
948
- return 'API currently not available for iOS';
1495
+ return Promise.reject('API currently not available for iOS');
949
1496
  }
950
1497
  });
951
1498
  /**
952
- * Android Only
953
- * - This wrapper function used to switch output to device other than the default, currently available only for android.
1499
+ * Switches the audio output device to a specified device.
1500
+ * This function is a wrapper around the native module's method to change the audio output route.
1501
+ * It allows for changing the audio output to a device other than the default one, such as a Bluetooth headset or speaker.
1502
+ *
1503
+ * @param {HMSAudioDevice} audioDevice - The audio device to switch the output to. This should be one of the devices available in `HMSAudioDevice`.
954
1504
  *
955
- * checkout {@link https://www.100ms.live/docs/react-native/v2/features/audio-output-routing#switch-audio-focus-to-another-device} for more info
1505
+ * @returns {Promise<void>} A promise that resolves when the audio output device is successfully switched. Rejected if the operation fails.
1506
+ *
1507
+ * @example
1508
+ * // To switch audio output to a Bluetooth device
1509
+ * hmsSDK.switchAudioOutput(HMSAudioDevice.Bluetooth);
956
1510
  *
957
1511
  * @memberof HMSSDK
958
- * @param audioDevice
959
1512
  */
960
1513
  _defineProperty(this, "switchAudioOutput", audioDevice => {
961
1514
  logger === null || logger === void 0 || logger.verbose('#Function switchAudioOutput', {
962
1515
  id: this.id,
963
1516
  audioDevice
964
1517
  });
965
- if (Platform.OS === 'android') {
966
- return HMSManager.switchAudioOutput({
967
- id: this.id,
968
- audioDevice
969
- });
970
- } else {
971
- console.log('API currently not available for iOS');
972
- return 'API currently not available for iOS';
973
- }
1518
+ return HMSManager.switchAudioOutput({
1519
+ id: this.id,
1520
+ audioDevice
1521
+ });
974
1522
  });
975
1523
  _defineProperty(this, "switchAudioOutputUsingIOSUI", () => {
976
1524
  logger === null || logger === void 0 || logger.verbose('#Function switchAudioOutputUsingIOSUI', {
@@ -986,7 +1534,7 @@ export class HMSSDK {
986
1534
  /**
987
1535
  * - This wrapper function used to change Audio Mode manually, currently available only for android.
988
1536
  *
989
- * checkout {@link https://www.100ms.live/docs/react-native/v2/features/audio-mode-change} for more info
1537
+ * @see https://www.100ms.live/docs/react-native/v2/how-to-guides/configure-your-device/speaker/audio-mode-change
990
1538
  *
991
1539
  * @param {HMSAudioMode}
992
1540
  * @memberof HMSSDK
@@ -1007,12 +1555,16 @@ export class HMSSDK {
1007
1555
  }
1008
1556
  });
1009
1557
  /**
1010
- * - This is a wrapper function which adds a listener which is triggered when audio output device is switched, currently available only for android.
1558
+ * Adds a listener for changes in the audio output device.
1559
+ * This function is platform-specific and currently only implemented for Android devices.
1560
+ * When the audio output device changes (e.g., switching from the phone speaker to a Bluetooth headset), the specified callback function is triggered.
1561
+ * This can be useful for applications that need to react to changes in audio routing, such as updating the UI to reflect the current output device.
1011
1562
  *
1012
- * checkout {@link https://www.100ms.live/docs/react-native/v2/features/audio-output-routing#adding-a-listener} for more info
1563
+ * Note: This API is not available on iOS as of the current implementation. Attempting to use it on iOS will result in a rejected promise with an appropriate error message.
1013
1564
  *
1014
- * @param {Function}
1565
+ * @param {Function} callback - The function to be called when the audio output device changes. This function does not receive any parameters.
1015
1566
  * @memberof HMSSDK
1567
+ * @see https://www.100ms.live/docs/react-native/v2/how-to-guides/configure-your-device/speaker/audio-output-routing
1016
1568
  */
1017
1569
  _defineProperty(this, "setAudioDeviceChangeListener", callback => {
1018
1570
  logger === null || logger === void 0 || logger.verbose('#Function setAudioDeviceChangeListener', {
@@ -1025,9 +1577,15 @@ export class HMSSDK {
1025
1577
  });
1026
1578
  } else {
1027
1579
  console.log('API currently not available for iOS');
1028
- return 'API currently not available for iOS';
1580
+ return Promise.reject('API currently not available for iOS');
1029
1581
  }
1030
1582
  });
1583
+ /**
1584
+ * Asynchronously retrieves a remote video track by its track ID.
1585
+ *
1586
+ * @param {string} trackId - The unique identifier for the remote video track to be retrieved.
1587
+ * @returns {Promise<HMSRemoteVideoTrack>} A promise that resolves to the encoded remote video track data.
1588
+ */
1031
1589
  _defineProperty(this, "getRemoteVideoTrackFromTrackId", async trackId => {
1032
1590
  logger === null || logger === void 0 || logger.verbose('#Function getRemoteVideoTrackFromTrackId', {
1033
1591
  id: this.id,
@@ -1039,17 +1597,33 @@ export class HMSSDK {
1039
1597
  });
1040
1598
  return HMSEncoder.encodeHmsRemoteVideoTrack(remoteVideoTrackData, this.id);
1041
1599
  });
1600
+ /**
1601
+ * Retrieves a remote audio track by its track ID.
1602
+ *
1603
+ * @param {string} trackId - The unique identifier for the remote audio track to be retrieved.
1604
+ * @returns {Promise<HMSRemoteAudioTrack>} A promise that resolves to the encoded remote audio track data.
1605
+ */
1042
1606
  _defineProperty(this, "getRemoteAudioTrackFromTrackId", async trackId => {
1607
+ // Log the function call with the track ID for debugging purposes.
1043
1608
  logger === null || logger === void 0 || logger.verbose('#Function getRemoteAudioTrackFromTrackId', {
1044
1609
  id: this.id,
1045
1610
  trackId
1046
1611
  });
1612
+
1613
+ // Fetch the remote audio track data from the native HMSManager.
1047
1614
  const remoteAudioTrackData = await HMSManager.getRemoteAudioTrackFromTrackId({
1048
1615
  id: this.id,
1049
1616
  trackId
1050
1617
  });
1618
+ // Encode and return the remote audio track data.
1051
1619
  return HMSEncoder.encodeHmsRemoteAudioTrack(remoteAudioTrackData, this.id);
1052
1620
  });
1621
+ /**
1622
+ * Retrieves a peer object based on the provided peer ID.
1623
+ *
1624
+ * @param {string} peerId - The ID of the peer to retrieve.
1625
+ * @returns {HMSPeer | undefined} An encoded HMSPeer object if the peer is found otherwise `undefined`.
1626
+ */
1053
1627
  _defineProperty(this, "getPeerFromPeerId", peerId => {
1054
1628
  logger === null || logger === void 0 || logger.verbose('#Function getPeerFromPeerId', {
1055
1629
  id: this.id,
@@ -1102,32 +1676,89 @@ export class HMSSDK {
1102
1676
  logger === null || logger === void 0 || logger.verbose('#Function lowerRemotePeerHand', data);
1103
1677
  return HMSManager.lowerRemotePeerHand(data);
1104
1678
  });
1105
- // getPeerListIterator = (
1106
- // options?: HMSPeerListIteratorOptions
1107
- // ): HMSPeerListIterator => {
1108
- // logger?.verbose('#Function getPeerListIterator', {
1109
- // id: this.id,
1110
- // options,
1111
- // });
1112
- // const uniqueId = Date.now();
1113
- // const data: null | { sucess: boolean; uniqueId: number } =
1114
- // HMSManager.getPeerListIterator({
1115
- // id: this.id,
1116
- // ...options,
1117
- // limit: options?.limit ?? 10,
1118
- // uniqueId: uniqueId,
1119
- // });
1120
- // if (!data) {
1121
- // throw new Error('Unable to create PeerListIterator');
1122
- // }
1123
- // return new HMSPeerListIterator(data.uniqueId);
1124
- // };
1125
1679
  /**
1126
- * - This is a prototype event listener that takes action and listens for updates related to that particular action
1680
+ * `getPeerListIterator` method returns an instance of `HMSPeerListIterator` class
1681
+ *
1682
+ * @param options options for configuring iterator
1683
+ * @returns instance of HMSPeerListIterator class
1684
+ *
1685
+ * Example usage:
1686
+ * ```
1687
+ * const peerListIterator = hmsInstance.getPeerListIterator();
1688
+ * ```
1689
+ * OR
1690
+ * ```
1691
+ * const peerListIterator = hmsInstance.getPeerListIterator({
1692
+ * limit: 10,
1693
+ * byRoleName: 'viewer-realtime',
1694
+ * });
1695
+ * ```
1696
+ */
1697
+ _defineProperty(this, "getPeerListIterator", options => {
1698
+ logger === null || logger === void 0 || logger.verbose('#Function getPeerListIterator', {
1699
+ id: this.id,
1700
+ options
1701
+ });
1702
+ const uniqueId = Math.random().toString(16).slice(2);
1703
+ const data = HMSManager.getPeerListIterator({
1704
+ id: this.id,
1705
+ ...options,
1706
+ limit: (options === null || options === void 0 ? void 0 : options.limit) ?? 10,
1707
+ uniqueId
1708
+ });
1709
+ if (!data) {
1710
+ throw new Error('Unable to create PeerListIterator');
1711
+ }
1712
+ return new HMSPeerListIterator(data.uniqueId, data.totalCount);
1713
+ });
1714
+ /**
1715
+ * - This function allows the user to set the screen on always.
1716
+ * - This is useful when the user wants to keep the screen on while the app is in the foreground.
1717
+ * @param enabled boolean value to enable or disable the always screen on
1718
+ */
1719
+ _defineProperty(this, "setAlwaysScreenOn", async enabled => {
1720
+ logger === null || logger === void 0 || logger.verbose('#Function toggleAlwaysScreenOn', {
1721
+ id: this.id,
1722
+ enabled
1723
+ });
1724
+ return HMSManager.setAlwaysScreenOn({
1725
+ id: this.id,
1726
+ enabled
1727
+ });
1728
+ });
1729
+ _defineProperty(this, "setPermissionsAcceptedOnAndroid", async () => {
1730
+ if (Platform.OS === 'ios') {
1731
+ Promise.reject('setPermissionsAcceptedOnAndroid API not available for iOS');
1732
+ return;
1733
+ }
1734
+ logger === null || logger === void 0 || logger.verbose('#Function setPermissionsAcceptedOnAndroid', {
1735
+ id: this.id
1736
+ });
1737
+ return await HMSManager.setPermissionsAccepted({
1738
+ id: this.id
1739
+ });
1740
+ });
1741
+ /**
1742
+ * Registers an event listener for various HMS SDK events.
1127
1743
  *
1128
- * @param {string} action
1129
- * @param {*} callback
1744
+ * This method allows the registration of callbacks for different types of events that can occur within the HMS SDK.
1745
+ * These events include but are not limited to updates about the room, peers, tracks, and errors.
1746
+ * The method dynamically adds listeners based on the specified action and associates them with a callback function
1747
+ * to handle the event. It ensures that only one subscription exists per event type to avoid duplicate listeners.
1748
+ *
1749
+ * @param {HMSUpdateListenerActions | HMSPIPListenerActions} action - The specific action/event to listen for.
1750
+ * @param {Function} callback - The callback function to execute when the event occurs. The specifics of the callback parameters depend on the event type.
1130
1751
  * @memberof HMSSDK
1752
+ *
1753
+ * @example
1754
+ * hmsInstance.addEventListener(HMSUpdateListenerActions.ON_JOIN, (event) => {
1755
+ * console.log('Joined the room:', event);
1756
+ * });
1757
+ *
1758
+ * @example
1759
+ * hmsInstance.addEventListener(HMSUpdateListenerActions.ON_PEER_UPDATE, (event) => {
1760
+ * console.log('Peer update:', event);
1761
+ * });
1131
1762
  */
1132
1763
  _defineProperty(this, "addEventListener", (action, callback) => {
1133
1764
  logger === null || logger === void 0 || logger.verbose('#Function addEventListener', {
@@ -1159,6 +1790,18 @@ export class HMSSDK {
1159
1790
  this.onJoinDelegate = callback;
1160
1791
  break;
1161
1792
  }
1793
+ case HMSUpdateListenerActions.ON_PERMISSIONS_REQUESTED:
1794
+ {
1795
+ // Checking if we already have ON_PERMISSIONS_REQUESTED subscription
1796
+ if (!this.emitterSubscriptions[HMSUpdateListenerActions.ON_PERMISSIONS_REQUESTED]) {
1797
+ // Adding ON_PERMISSIONS_REQUESTED native listener
1798
+ const permissionsRequestedSubscription = HMSNativeEventListener.addListener(this.id, HMSUpdateListenerActions.ON_PERMISSIONS_REQUESTED, this.onPermissionsRequestedListener);
1799
+ this.emitterSubscriptions[HMSUpdateListenerActions.ON_PERMISSIONS_REQUESTED] = permissionsRequestedSubscription;
1800
+ }
1801
+ // Adding App Delegate listener
1802
+ this.onPermissionsRequestedDelegate = callback;
1803
+ break;
1804
+ }
1162
1805
  case HMSUpdateListenerActions.ON_ROOM_UPDATE:
1163
1806
  {
1164
1807
  // Checking if we already have ON_ROOM_UPDATE subscription
@@ -1171,6 +1814,18 @@ export class HMSSDK {
1171
1814
  this.onRoomDelegate = callback;
1172
1815
  break;
1173
1816
  }
1817
+ case HMSUpdateListenerActions.ON_TRANSCRIPTS:
1818
+ {
1819
+ // Checking if we already have ON_TRANSCRIPTS subscription
1820
+ if (!this.emitterSubscriptions[HMSUpdateListenerActions.ON_TRANSCRIPTS]) {
1821
+ // Adding ON_TRANSCRIPTS native listener
1822
+ const transcriptsSubscription = HMSNativeEventListener.addListener(this.id, HMSUpdateListenerActions.ON_TRANSCRIPTS, this.onTranscriptsListener);
1823
+ this.emitterSubscriptions[HMSUpdateListenerActions.ON_TRANSCRIPTS] = transcriptsSubscription;
1824
+ }
1825
+ // Adding App Delegate listener
1826
+ this.onTranscriptsDelegate = callback;
1827
+ break;
1828
+ }
1174
1829
  case HMSUpdateListenerActions.ON_PEER_UPDATE:
1175
1830
  {
1176
1831
  // Checking if we already have ON_PEER_UPDATE subscription
@@ -1403,26 +2058,34 @@ export class HMSSDK {
1403
2058
  }
1404
2059
  case HMSPIPListenerActions.ON_PIP_MODE_CHANGED:
1405
2060
  {
1406
- if (Platform.OS === 'android') {
1407
- // Checking if we already have ON_PIP_MODE_CHANGED subscription
1408
- if (!this.emitterSubscriptions[HMSPIPListenerActions.ON_PIP_MODE_CHANGED]) {
1409
- const pipModeChangedSubscription = HMSNativeEventListener.addListener(this.id, HMSPIPListenerActions.ON_PIP_MODE_CHANGED, this.onPIPModeChangedListener);
1410
- this.emitterSubscriptions[HMSPIPListenerActions.ON_PIP_MODE_CHANGED] = pipModeChangedSubscription;
1411
- }
1412
- // Adding PIP mode changed Delegate listener
1413
- this.onPIPModeChangedDelegate = callback;
2061
+ // Checking if we already have ON_PIP_MODE_CHANGED subscription
2062
+ if (!this.emitterSubscriptions[HMSPIPListenerActions.ON_PIP_MODE_CHANGED]) {
2063
+ const pipModeChangedSubscription = HMSNativeEventListener.addListener(this.id, HMSPIPListenerActions.ON_PIP_MODE_CHANGED, this.onPIPModeChangedListener);
2064
+ this.emitterSubscriptions[HMSPIPListenerActions.ON_PIP_MODE_CHANGED] = pipModeChangedSubscription;
1414
2065
  }
2066
+ // Adding PIP mode changed Delegate listener
2067
+ this.onPIPModeChangedDelegate = callback;
1415
2068
  break;
1416
2069
  }
1417
2070
  default:
1418
2071
  }
1419
2072
  });
1420
2073
  /**
1421
- * - This is a prototype event listener that takes action and listens for updates related to that particular action
2074
+ * Removes an event listener for a specified event action.
1422
2075
  *
1423
- * @param {string} action
1424
- * @param {*} callback
2076
+ * This method allows for the deregistration of previously registered callbacks for specific event types within the HMS SDK.
2077
+ * By specifying the action and the callback, it ensures that the event listener associated with that action is removed,
2078
+ * preventing the callback from being executed when the event occurs in the future. This is useful for cleaning up resources
2079
+ * and avoiding potential memory leaks in applications that dynamically add and remove event listeners based on component lifecycle
2080
+ * or user interactions.
2081
+ *
2082
+ * @param {HMSUpdateListenerActions | HMSPIPListenerActions} action - The specific action/event for which the listener is to be removed.
2083
+ * @param {Function} callback - The callback function that was originally registered for the event. This parameter is necessary to ensure
2084
+ * that only the specific callback associated with the action is removed.
1425
2085
  * @memberof HMSSDK
2086
+ * @example
2087
+ * // Remove a listener for the ON_JOIN event
2088
+ * hmsInstance.removeEventListener(HMSUpdateListenerActions.ON_JOIN, onJoinCallback);
1426
2089
  */
1427
2090
  _defineProperty(this, "removeEventListener", action => {
1428
2091
  logger === null || logger === void 0 || logger.verbose('#Function removeEventListener', {
@@ -1454,6 +2117,18 @@ export class HMSSDK {
1454
2117
  this.onJoinDelegate = null;
1455
2118
  break;
1456
2119
  }
2120
+ case HMSUpdateListenerActions.ON_PERMISSIONS_REQUESTED:
2121
+ {
2122
+ const subscription = this.emitterSubscriptions[HMSUpdateListenerActions.ON_PERMISSIONS_REQUESTED];
2123
+ // Removing ON_PERMISSIONS_REQUESTED native listener
2124
+ if (subscription) {
2125
+ subscription.remove();
2126
+ this.emitterSubscriptions[HMSUpdateListenerActions.ON_PERMISSIONS_REQUESTED] = undefined;
2127
+ }
2128
+ // Removing App Delegate listener
2129
+ this.onPermissionsRequestedDelegate = null;
2130
+ break;
2131
+ }
1457
2132
  case HMSUpdateListenerActions.ON_ROOM_UPDATE:
1458
2133
  {
1459
2134
  const subscription = this.emitterSubscriptions[HMSUpdateListenerActions.ON_ROOM_UPDATE];
@@ -1466,6 +2141,18 @@ export class HMSSDK {
1466
2141
  this.onRoomDelegate = null;
1467
2142
  break;
1468
2143
  }
2144
+ case HMSUpdateListenerActions.ON_TRANSCRIPTS:
2145
+ {
2146
+ const subscription = this.emitterSubscriptions[HMSUpdateListenerActions.ON_TRANSCRIPTS];
2147
+ // Removing ON_TRANSCRIPTS native listener
2148
+ if (subscription) {
2149
+ subscription.remove();
2150
+ this.emitterSubscriptions[HMSUpdateListenerActions.ON_TRANSCRIPTS] = undefined;
2151
+ }
2152
+ // Removing App Delegate listener
2153
+ this.onTranscriptsDelegate = null;
2154
+ break;
2155
+ }
1469
2156
  case HMSUpdateListenerActions.ON_PEER_UPDATE:
1470
2157
  {
1471
2158
  const subscription = this.emitterSubscriptions[HMSUpdateListenerActions.ON_PEER_UPDATE];
@@ -1733,20 +2420,6 @@ export class HMSSDK {
1733
2420
  id: this.id
1734
2421
  });
1735
2422
  });
1736
- /**
1737
- * - Below are all the listeners that are connected to native side.
1738
- *
1739
- * - All of the are connected when build function is called, we can connect them to the app by
1740
- * calling {@link addEventListener} with corresponding event type.
1741
- *
1742
- * - Before passing the data to the eventListener of the app these listeners encode the data in
1743
- * ts classes for a proper structuring of the data.
1744
- *
1745
- * - Even When event listeners of the app are disconnected using {@link removeEventListener} or
1746
- * {@link removeAllListeners} or not even connected in first place, these functions still run to
1747
- * maintain the current state of the instance of {@link HMSSDK}.
1748
- *
1749
- */
1750
2423
  _defineProperty(this, "onPreviewListener", data => {
1751
2424
  if (data.id !== this.id) {
1752
2425
  return;
@@ -1778,6 +2451,17 @@ export class HMSSDK {
1778
2451
  });
1779
2452
  }
1780
2453
  });
2454
+ _defineProperty(this, "onPermissionsRequestedListener", data => {
2455
+ if (data.id !== this.id) {
2456
+ return;
2457
+ }
2458
+ if (this.onPermissionsRequestedDelegate) {
2459
+ logger === null || logger === void 0 || logger.verbose('#Listener ON_PERMISSIONS_REQUESTED_LISTENER_CALL', data);
2460
+ this.onPermissionsRequestedDelegate({
2461
+ ...data
2462
+ });
2463
+ }
2464
+ });
1781
2465
  _defineProperty(this, "onRoomListener", data => {
1782
2466
  var _getHmsRoomCache2;
1783
2467
  if (data.id !== this.id) {
@@ -1797,8 +2481,17 @@ export class HMSSDK {
1797
2481
  });
1798
2482
  }
1799
2483
  });
2484
+ _defineProperty(this, "onTranscriptsListener", data => {
2485
+ if (data.id !== this.id) {
2486
+ return;
2487
+ }
2488
+ HMSEncoder.transformTranscripts(data.transcripts);
2489
+ if (this.onTranscriptsDelegate) {
2490
+ logger === null || logger === void 0 || logger.verbose('#Listener ON_TRANSCRIPTS_LISTENER_CALL', data);
2491
+ this.onTranscriptsDelegate(data);
2492
+ }
2493
+ });
1800
2494
  _defineProperty(this, "onPeerListener", peerData => {
1801
- var _getHmsPeersCache;
1802
2495
  const data = {
1803
2496
  peer: peerData,
1804
2497
  type: null
@@ -1812,7 +2505,15 @@ export class HMSSDK {
1812
2505
  }
1813
2506
  const peer = HMSEncoder.encodeHmsPeer(data.peer);
1814
2507
  const type = HMSEncoder.encodeHmsPeerUpdate(data.type) || data.type;
1815
- (_getHmsPeersCache = getHmsPeersCache()) === null || _getHmsPeersCache === void 0 || _getHmsPeersCache.updatePeerCache(data.peer.peerID, data.peer, type);
2508
+ if (type === HMSPeerUpdate.PEER_LEFT) {
2509
+ this.sendPeerUpdateWhenPeerLeaves(data, peer, type);
2510
+ } else {
2511
+ var _getHmsPeersCache;
2512
+ (_getHmsPeersCache = getHmsPeersCache()) === null || _getHmsPeersCache === void 0 || _getHmsPeersCache.updatePeerCache(data.peer.peerID, data.peer, type);
2513
+ this.sendPeerUpdate(peer, type);
2514
+ }
2515
+ });
2516
+ _defineProperty(this, "sendPeerUpdate", (peer, type) => {
1816
2517
  if (this.onPeerDelegate) {
1817
2518
  logger === null || logger === void 0 || logger.verbose('#Listener ON_PEER_LISTENER_CALL', {
1818
2519
  peer,
@@ -1824,6 +2525,11 @@ export class HMSSDK {
1824
2525
  });
1825
2526
  }
1826
2527
  });
2528
+ _defineProperty(this, "sendPeerUpdateWhenPeerLeaves", (data, peer, type) => {
2529
+ var _getHmsPeersCache2;
2530
+ this.sendPeerUpdate(peer, type);
2531
+ (_getHmsPeersCache2 = getHmsPeersCache()) === null || _getHmsPeersCache2 === void 0 || _getHmsPeersCache2.updatePeerCache(data.peer.peerID, data.peer, type);
2532
+ });
1827
2533
  _defineProperty(this, "onPeerListUpdatedListener", data => {
1828
2534
  if (data.id !== this.id) {
1829
2535
  return;
@@ -1842,19 +2548,16 @@ export class HMSSDK {
1842
2548
  }
1843
2549
  });
1844
2550
  _defineProperty(this, "onTrackListener", data => {
1845
- var _getHmsPeersCache2;
2551
+ var _getHmsPeersCache3;
1846
2552
  if (data.id !== this.id) {
1847
2553
  return;
1848
2554
  }
1849
2555
  const track = HMSEncoder.encodeHmsTrack(data.track, this.id);
1850
2556
  const peer = HMSEncoder.encodeHmsPeer(data.peer);
1851
2557
  const type = data.type;
1852
- (_getHmsPeersCache2 = getHmsPeersCache()) === null || _getHmsPeersCache2 === void 0 || _getHmsPeersCache2.updatePeerCache(data.peer.peerID, {
2558
+ (_getHmsPeersCache3 = getHmsPeersCache()) === null || _getHmsPeersCache3 === void 0 || _getHmsPeersCache3.updatePeerCache(data.peer.peerID, {
1853
2559
  track
1854
2560
  }, data.type);
1855
- if (this.muteStatus && (data === null || data === void 0 ? void 0 : data.type) === 'TRACK_ADDED' && track.type === HMSTrackType.AUDIO) {
1856
- this.setPlaybackForAllAudio(this.muteStatus);
1857
- }
1858
2561
  if (this.onTrackDelegate) {
1859
2562
  logger === null || logger === void 0 || logger.verbose('#Listener ON_TRACK_LISTENER_CALL', {
1860
2563
  peer,
@@ -2073,6 +2776,15 @@ export class HMSSDK {
2073
2776
  });
2074
2777
  }
2075
2778
  });
2779
+ /**
2780
+ * Listener for the `SessionStoreAvailable` event.
2781
+ *
2782
+ * This listener is triggered when the session store becomes available in the SDK. It is an important event
2783
+ * for developers who need to access or manipulate the session store after it has been initialized and made available.
2784
+ *
2785
+ * @param {Object} data - The event data.
2786
+ * @param {HMSSessionStore} data.sessionStore - The session store object that has been made available.
2787
+ */
2076
2788
  _defineProperty(this, "onSessionStoreAvailableListener", data => {
2077
2789
  if (data.id !== this.id) {
2078
2790
  return;
@@ -2085,6 +2797,21 @@ export class HMSSDK {
2085
2797
  });
2086
2798
  }
2087
2799
  });
2800
+ /**
2801
+ * Listener for the `PIPRoomLeave` event. Android only.
2802
+ *
2803
+ * This listener is triggered when a room is left from the Picture in Picture (PIP) mode, which is currently supported only on Android platforms.
2804
+ * It is an essential event for handling cleanup or UI updates when the user exits the room while in PIP mode.
2805
+ * @param {Object} data - The event data.
2806
+ * @memberof HMSSDK
2807
+ * @example
2808
+ * // Example of handling the `PIPRoomLeave` event
2809
+ * hms.onPIPRoomLeave((data) => {
2810
+ * // Handle PIP room leave event
2811
+ * });
2812
+ *
2813
+ * @see https://www.100ms.live/docs/react-native/v2/how-to-guides/set-up-video-conferencing/render-video/pip-mode
2814
+ */
2088
2815
  _defineProperty(this, "onPIPRoomLeaveListener", data => {
2089
2816
  if (data.id !== this.id) {
2090
2817
  return;
@@ -2097,6 +2824,26 @@ export class HMSSDK {
2097
2824
  });
2098
2825
  }
2099
2826
  });
2827
+ /**
2828
+ * Listener for the `PIPModeChanged` event.
2829
+ * This listener is triggered when the Picture in Picture (PIP) mode is toggled on or off.
2830
+ * It is an important event for handling UI updates or other actions when the user enters or exits PIP mode.
2831
+ * @param {Object} data - The event data.
2832
+ * @param {boolean} data.isInPictureInPictureMode - A boolean value indicating whether the user is currently in PIP mode.
2833
+ * @returns {void} - Returns nothing.
2834
+ * @memberof HMSSDK
2835
+ * @example
2836
+ * // Example of handling the `PIPModeChanged` event
2837
+ * hms.onPIPModeChanged((data) => {
2838
+ * if (data.isInPictureInPictureMode) {
2839
+ * // Handle PIP mode enabled
2840
+ * } else {
2841
+ * // Handle PIP mode disabled
2842
+ * }
2843
+ * });
2844
+ *
2845
+ * @see https://www.100ms.live/docs/react-native/v2/how-to-guides/set-up-video-conferencing/render-video/pip-mode
2846
+ */
2100
2847
  _defineProperty(this, "onPIPModeChangedListener", data => {
2101
2848
  if (this.onPIPModeChangedDelegate) {
2102
2849
  logger === null || logger === void 0 || logger.verbose('#Listener onPIPModeChanged_CALL', data);
@@ -2104,9 +2851,20 @@ export class HMSSDK {
2104
2851
  }
2105
2852
  });
2106
2853
  /**
2107
- * - Updates the logger for this instance of HMSSDK
2108
- * @param {HMSLogger} hmsLogger
2854
+ * Updates the logger instance for this HMSSDK instance.
2855
+ *
2856
+ * This method allows for the dynamic updating of the logger instance used by the HMSSDK.
2857
+ * It can be used to change the logger settings or replace the logger entirely at runtime.
2858
+ * This is particularly useful for adjusting log levels or redirecting log output based on application state or user preferences.
2859
+ *
2860
+ * @param {HMSLogger} hmsLogger - The new logger instance to be used. If not provided, the logger will be reset to default.
2109
2861
  * @memberof HMSSDK
2862
+ * @example
2863
+ * // Set a custom logger with a specific configuration
2864
+ * const customLogger = new HMSLogger();
2865
+ * customLogger.setLevel('verbose');
2866
+ * hmsInstance.setLogger(customLogger);
2867
+ *
2110
2868
  */
2111
2869
  _defineProperty(this, "setLogger", hmsLogger => {
2112
2870
  setLogger(this.id, hmsLogger);
@@ -2115,20 +2873,40 @@ export class HMSSDK {
2115
2873
  }
2116
2874
 
2117
2875
  /**
2118
- * - Returns an instance of [HMSSDK] {@link HMSSDK}
2119
- * - This function must be called to get an instance of HMSSDK class and only then user can interact with its methods.
2876
+ * Asynchronously builds and returns an instance of the HMSSDK class.
2877
+ *
2878
+ * This method initializes the HMSSDK with optional configuration parameters and returns the initialized instance.
2879
+ * It is responsible for setting up the SDK with specific settings for track management, app groups, extensions for iOS screen sharing,
2880
+ * logging configurations, etc.
2120
2881
  *
2121
- * Regular Usage:
2122
2882
  *
2883
+ * @param {Object} params - Optional configuration parameters for initializing the HMSSDK.
2884
+ * @param {trackSettings} params.trackSettings is an optional value only required to enable features like iOS Screen/Audio Share, Android Software Echo Cancellation, etc
2885
+ * @param {appGroup} params.appGroup is an optional value only required for implementing Screen & Audio Share on iOS. They are not required for Android. DO NOT USE if your app does not implements Screen or Audio Share on iOS.
2886
+ * @param {preferredExtension} params.preferredExtension is an optional value only required for implementing Screen & Audio Share on iOS. They are not required for Android. DO NOT USE if your app does not implements Screen or Audio Share on iOS.
2887
+ * @param {boolean} params.haltPreviewJoinForPermissionsRequestOnAndroid - Optional flag to halt the preview/join process until permissions are explicitly granted by the user. Android only. This is particularly useful when you might want to request permissions before proceeding with the preview or join operation.
2888
+ * @param {HMSLogSettings} params.logSettings - Optional settings for logging.
2889
+ *
2890
+ * @returns {Promise<HMSSDK>} A promise that resolves to an instance of HMSSDK.
2891
+ * @throws {Error} If the HMSSDK instance cannot be created.
2892
+ *
2893
+ * @example
2894
+ * // Regular usage:
2123
2895
  * const hmsInstance = await HMSSDK.build();
2124
2896
  *
2125
- * For Advanced Use-Cases:
2126
- * @param {trackSettings} trackSettings is an optional value only required to enable features like iOS Screen/Audio Share, Android Software Echo Cancellation, etc
2127
- * @param {appGroup} appGroup is an optional value only required for implementing Screen & Audio Share on iOS. They are not required for Android. DO NOT USE if your app does not implements Screen or Audio Share on iOS.
2128
- * @param {preferredExtension} preferredExtension is an optional value only required for implementing Screen & Audio Share on iOS. They are not required for Android. DO NOT USE if your app does not implements Screen or Audio Share on iOS.
2897
+ * @example
2898
+ * // Advanced Usage:
2899
+ * const hmsInstance = await HMSSDK.build({
2900
+ * trackSettings: {...},
2901
+ * appGroup: 'group.example',
2902
+ * preferredExtension: 'com.example.extension',
2903
+ * logSettings: {...},
2904
+ * });
2129
2905
  *
2906
+ * @see https://www.100ms.live/docs/react-native/v2/how-to-guides/install-the-sdk/hmssdk
2130
2907
  * @static
2131
- * @returns
2908
+ * @async
2909
+ * @function build
2132
2910
  * @memberof HMSSDK
2133
2911
  */
2134
2912
  static async build(params) {
@@ -2142,6 +2920,8 @@ export class HMSSDK {
2142
2920
  } = ReactNativeVersion.version;
2143
2921
  let id = await HMSManager.build({
2144
2922
  trackSettings: params === null || params === void 0 ? void 0 : params.trackSettings,
2923
+ haltPreviewJoinForPermissionsRequest: params === null || params === void 0 ? void 0 : params.haltPreviewJoinForPermissionsRequestOnAndroid,
2924
+ // required for Android Permissions, not required for iOS
2145
2925
  appGroup: params === null || params === void 0 ? void 0 : params.appGroup,
2146
2926
  // required for iOS Screenshare, not required for Android
2147
2927
  preferredExtension: params === null || params === void 0 ? void 0 : params.preferredExtension,
@@ -2156,17 +2936,98 @@ export class HMSSDK {
2156
2936
  HmsSdk = new HMSSDK(id);
2157
2937
  return HmsSdk;
2158
2938
  }
2939
+ /**
2940
+ * - This function is used to check if Picture in Picture mode is supported on the device
2941
+ * @returns {Promise<boolean>} - Returns a boolean value indicating whether Picture in Picture mode is supported on the device.
2942
+ * @memberof HMSSDK
2943
+ * @example
2944
+ * // Example of checking if Picture in Picture mode is supported
2945
+ * const isPipModeSupported = await hms.isPipModeSupported();
2946
+ * if (isPipModeSupported) {
2947
+ * // Picture in Picture mode is supported
2948
+ * } else {
2949
+ * // Picture in Picture mode is not supported
2950
+ * }
2951
+ * @example
2952
+ * // Example of checking if Picture in Picture mode is supported
2953
+ * hms.isPipModeSupported().then((isPipModeSupported) => {
2954
+ * if (isPipModeSupported) {
2955
+ * // Picture in Picture mode is supported
2956
+ * } else {
2957
+ * // Picture in Picture mode is not supported
2958
+ * }
2959
+ * });
2960
+ *
2961
+ * @see https://www.100ms.live/docs/react-native/v2/how-to-guides/set-up-video-conferencing/render-video/pip-mode
2962
+ */
2159
2963
  async isPipModeSupported() {
2160
- return HMSManager.handlePipActions('isPipModeSupported', {
2964
+ const data = {
2161
2965
  id: this.id
2162
- });
2966
+ };
2967
+ logger === null || logger === void 0 || logger.verbose('#Function isPipModeSupported', data);
2968
+ return HMSManager.handlePipActions('isPipModeSupported', data);
2163
2969
  }
2970
+
2971
+ /**
2972
+ * Asynchronously enters Picture in Picture (PIP) mode with optional configuration.
2973
+ *
2974
+ * This method attempts to enter PIP mode based on the provided configuration.
2975
+ * It returns a promise that resolves to a boolean indicating the success of the operation.
2976
+ * If PIP mode is not supported or fails to activate, the promise may resolve to `undefined` or `false`.
2977
+ *
2978
+ * @param {HMSPIPConfig} [data] - Optional configuration for entering PIP mode. This can include settings such as `autoEnterPipMode` and `aspectRatio`.
2979
+ * @returns {Promise<boolean>} - A promise that resolves to `true` if PIP mode was successfully entered, `false` if unsuccessful or PIP mode is not supported.
2980
+ * @throws {Error} - Throws an error if the operation fails.
2981
+ * @memberof HMSSDK
2982
+ * @example
2983
+ * // Example of entering Picture in Picture mode
2984
+ * hms.enterPipMode().then((success) => {
2985
+ * if (success) {
2986
+ * // Picture in Picture mode entered successfully
2987
+ * } else {
2988
+ * // Picture in Picture mode could not be entered
2989
+ * }
2990
+ * });
2991
+ * @example
2992
+ * // Example of entering Picture in Picture mode with configuration
2993
+ * const success = await hms.enterPipMode({ autoEnterPipMode: true, aspectRatio: [16,9] });
2994
+ * if (success) {
2995
+ * // Picture in Picture mode entered successfully
2996
+ * } else {
2997
+ * // Picture in Picture mode could not be entered
2998
+ * }
2999
+ *
3000
+ * @see https://www.100ms.live/docs/react-native/v2/how-to-guides/set-up-video-conferencing/render-video/pip-mode
3001
+ */
2164
3002
  async enterPipMode(data) {
3003
+ logger === null || logger === void 0 || logger.verbose('#Function enterPipMode', data);
2165
3004
  return HMSManager.handlePipActions('enterPipMode', {
2166
3005
  ...data,
2167
3006
  id: this.id
2168
3007
  });
2169
3008
  }
3009
+
3010
+ /**
3011
+ * Asynchronously sets the parameters for Picture in Picture (PIP) mode.
3012
+ *
3013
+ * This method configures the PIP window according to the provided `HMSPIPConfig` settings. It can be used to adjust various aspects of the PIP mode, such as its size, aspect ratio, and more. The method returns a promise that resolves to a boolean indicating the success of the operation. If the PIP mode is not supported or the configuration fails, the promise may resolve to `undefined` or `false`.
3014
+ *
3015
+ * @param {HMSPIPConfig} [data] - Optional configuration for setting PIP mode parameters. This can include settings such as `aspectRatio`, `autoEnterPipMode`, etc.
3016
+ * @returns {Promise<boolean | undefined>} - A promise that resolves to `true` if the PIP parameters were successfully set, `false` if unsuccessful. `undefined` may be returned if PIP mode is not supported.
3017
+ * @throws {Error} - Throws an error if the operation fails.
3018
+ * @memberof HMSSDK
3019
+ * @example
3020
+ * // Example of setting Picture in Picture mode parameters
3021
+ * hms.setPipParams({ aspectRatio: [16, 9], autoEnterPipMode: true }).then((success) => {
3022
+ * if (success) {
3023
+ * // Picture in Picture mode parameters set successfully
3024
+ * } else {
3025
+ * // Picture in Picture mode parameters could not be set
3026
+ * }
3027
+ * });
3028
+ *
3029
+ * @see https://www.100ms.live/docs/react-native/v2/how-to-guides/set-up-video-conferencing/render-video/pip-mode
3030
+ */
2170
3031
  async setPipParams(data) {
2171
3032
  return HMSManager.handlePipActions('setPictureInPictureParams', {
2172
3033
  ...data,
@@ -2175,9 +3036,134 @@ export class HMSSDK {
2175
3036
  }
2176
3037
 
2177
3038
  /**
2178
- * - Returns the instance of logger which can be used to manipulate log levels.
2179
- * @returns @instance HMSLogger
3039
+ * Changes the video track used in Picture in Picture (PIP) mode on iOS devices.
3040
+ *
3041
+ * This function is specifically designed for iOS platforms to switch the video track displayed in PIP mode.
3042
+ * It takes a `HMSVideoTrack` object as an argument, which contains the track ID of the video track to be displayed in PIP mode.
3043
+ * This allows for dynamic changes to the video source in PIP mode, enhancing the flexibility of video presentation in applications that support PIP.
3044
+ *
3045
+ * @param {HMSVideoTrack} track - The video track to be used in PIP mode. Must contain a valid `trackId`.
3046
+ * @returns {Promise} - A promise that resolves when the video track has been successfully changed for PIP mode, or rejects with an error if the operation fails.
3047
+ * @throws {Error} - Throws an error if the operation fails.
3048
+ * @async
3049
+ * @function changeIOSPIPVideoTrack
3050
+ * @see https://www.100ms.live/docs/react-native/v2/how-to-guides/set-up-video-conferencing/render-video/pip-mode
3051
+ * @memberof HMSSDK
3052
+ * @example
3053
+ * // Example of changing the video track for PIP mode on iOS
3054
+ * hms.changeIOSPIPVideoTrack(videoTrack).then(() => {
3055
+ * console.log('Video track for PIP mode changed successfully');
3056
+ * }).catch(error => {
3057
+ * console.error('Failed to change video track for PIP mode', error);
3058
+ * });
3059
+ *
3060
+ */
3061
+ async changeIOSPIPVideoTrack(track) {
3062
+ if (Platform.OS === 'ios') {
3063
+ const data = {
3064
+ id: this.id,
3065
+ trackId: track.trackId
3066
+ };
3067
+ logger === null || logger === void 0 || logger.verbose('#Function changeIOSPIPVideoTrack', data);
3068
+ return await HMSManager.changeIOSPIPVideoTrack(data);
3069
+ } else {
3070
+ return Promise.resolve(false);
3071
+ }
3072
+ }
3073
+
3074
+ /**
3075
+ * - This function is used to automatically switch the video track of the active speaker to the Picture in Picture (PIP) mode window on iOS devices.
3076
+ * - When enabled, the video track of the active speaker will be displayed in the PIP mode window, providing a focused view of the current speaker during a meeting or conference.
3077
+ * @param {boolean} enable - A boolean value indicating whether to enable or disable the automatic switching of the active speaker video track in PIP mode.
3078
+ * @returns {Promise} - A promise that resolves when the operation is successful, or rejects with an error if the operation fails.
3079
+ * @throws {Error} - Throws an error if the operation fails.
3080
+ * @async
3081
+ * @function setActiveSpeakerInIOSPIP
3082
+ * @see https://www.100ms.live/docs/react-native/v2/how-to-guides/set-up-video-conferencing/render-video/pip-mode
3083
+ * @memberof HMSSDK
3084
+ * @example
3085
+ * // Example of enabling the automatic switching of the active speaker video track in PIP mode
3086
+ * hms.setActiveSpeakerInIOSPIP(true).then(() => {
3087
+ * console.log('Active speaker video track enabled in PIP mode');
3088
+ * }).catch(error => {
3089
+ * console.error('Failed to enable active speaker video track in PIP mode', error);
3090
+ * });
3091
+ */
3092
+ async setActiveSpeakerInIOSPIP(enable) {
3093
+ if (Platform.OS === 'ios') {
3094
+ const data = {
3095
+ id: this.id,
3096
+ enable
3097
+ };
3098
+ logger === null || logger === void 0 || logger.verbose('#Function setActiveSpeakerInIOSPIP', data);
3099
+ return await HMSManager.setActiveSpeakerInIOSPIP(data);
3100
+ } else {
3101
+ return Promise.resolve(false);
3102
+ }
3103
+ }
3104
+
3105
+ /**
3106
+ * Initiates real-time transcription services.
3107
+ *
3108
+ * This asynchronous function triggers the HMSManager to start real-time transcription services,
3109
+ * capturing and transcribing audio in real time.
3110
+ *
3111
+ * @async
3112
+ * @function startRealTimeTranscription
3113
+ * @memberof HMSSDK
3114
+ * @example
3115
+ * // Example of starting real-time transcription services
3116
+ * await hmsInstance.startRealTimeTranscription();
3117
+ *
3118
+ * @see https://www.100ms.live/docs/react-native/v2/how-to-guides/extend-capabilities/live-captions
3119
+ */
3120
+ async startRealTimeTranscription() {
3121
+ const data = {
3122
+ id: this.id,
3123
+ action: 'start'
3124
+ };
3125
+ logger === null || logger === void 0 || logger.verbose('#Function startRealTimeTranscription', data);
3126
+ return HMSManager.handleRealTimeTranscription(data);
3127
+ }
3128
+
3129
+ /**
3130
+ * Stops the real-time transcription services.
3131
+ *
3132
+ * This asynchronous function signals the HMSManager to terminate the ongoing real-time transcription services.
3133
+ *
3134
+ * @async
3135
+ * @function stopRealTimeTranscription
3136
+ * @memberof HMSSDK
3137
+ * @example
3138
+ * await hmsInstance.stopRealTimeTranscription();
3139
+ *
3140
+ * @see https://www.100ms.live/docs/react-native/v2/how-to-guides/extend-capabilities/live-captions
3141
+ */
3142
+ async stopRealTimeTranscription() {
3143
+ const data = {
3144
+ id: this.id,
3145
+ action: 'stop'
3146
+ };
3147
+ logger === null || logger === void 0 || logger.verbose('#Function stopRealTimeTranscription', data);
3148
+ return HMSManager.handleRealTimeTranscription(data);
3149
+ }
3150
+ get interactivityCenter() {
3151
+ if (!this._interactivityCenter) {
3152
+ this._interactivityCenter = new HMSInteractivityCenter();
3153
+ }
3154
+ return this._interactivityCenter;
3155
+ }
3156
+
3157
+ /**
3158
+ * Retrieves the current logger instance used by the HMSSDK.
3159
+ *
3160
+ * This static method provides access to the logger instance, allowing for the manipulation of log levels and the retrieval of log information. It is useful for debugging purposes, enabling developers to monitor and adjust the verbosity of logs generated by the HMS SDK.
3161
+ *
3162
+ * @returns {HMSLogger} The current logger instance.
2180
3163
  * @memberof HMSSDK
3164
+ * @example
3165
+ * const logger = HMSSDK.getLogger();
3166
+ * logger.setLevel('debug'); // Adjusting the log level to debug
2181
3167
  */
2182
3168
  static getLogger() {
2183
3169
  return getLogger();