@100mslive/react-native-room-kit 0.0.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 (1111) hide show
  1. package/LICENSE +20 -0
  2. package/README.md +25 -0
  3. package/lib/commonjs/HMSContainer.js +20 -0
  4. package/lib/commonjs/HMSContainer.js.map +1 -0
  5. package/lib/commonjs/HMSInstanceSetup.js +160 -0
  6. package/lib/commonjs/HMSInstanceSetup.js.map +1 -0
  7. package/lib/commonjs/HMSPrebuilt.js +32 -0
  8. package/lib/commonjs/HMSPrebuilt.js.map +1 -0
  9. package/lib/commonjs/HMSRoomSetup.js +216 -0
  10. package/lib/commonjs/HMSRoomSetup.js.map +1 -0
  11. package/lib/commonjs/Icons/100ms/assets/hms-logo.png +0 -0
  12. package/lib/commonjs/Icons/100ms/assets/hms-logo@2x.png +0 -0
  13. package/lib/commonjs/Icons/100ms/assets/hms-logo@3x.png +0 -0
  14. package/lib/commonjs/Icons/100ms/index.js +30 -0
  15. package/lib/commonjs/Icons/100ms/index.js.map +1 -0
  16. package/lib/commonjs/Icons/Alert/assets/alert.png +0 -0
  17. package/lib/commonjs/Icons/Alert/assets/alert@2x.png +0 -0
  18. package/lib/commonjs/Icons/Alert/assets/alert@3x.png +0 -0
  19. package/lib/commonjs/Icons/Alert/index.js +30 -0
  20. package/lib/commonjs/Icons/Alert/index.js.map +1 -0
  21. package/lib/commonjs/Icons/Camera/assets/camera-muted.png +0 -0
  22. package/lib/commonjs/Icons/Camera/assets/camera-muted@2x.png +0 -0
  23. package/lib/commonjs/Icons/Camera/assets/camera-muted@3x.png +0 -0
  24. package/lib/commonjs/Icons/Camera/assets/camera-unmuted.png +0 -0
  25. package/lib/commonjs/Icons/Camera/assets/camera-unmuted@2x.png +0 -0
  26. package/lib/commonjs/Icons/Camera/assets/camera-unmuted@3x.png +0 -0
  27. package/lib/commonjs/Icons/Camera/index.js +31 -0
  28. package/lib/commonjs/Icons/Camera/index.js.map +1 -0
  29. package/lib/commonjs/Icons/Chat/assets/chat.png +0 -0
  30. package/lib/commonjs/Icons/Chat/assets/chat@2x.png +0 -0
  31. package/lib/commonjs/Icons/Chat/assets/chat@3x.png +0 -0
  32. package/lib/commonjs/Icons/Chat/index.js +30 -0
  33. package/lib/commonjs/Icons/Chat/index.js.map +1 -0
  34. package/lib/commonjs/Icons/Chevron/assets/chevron-down.png +0 -0
  35. package/lib/commonjs/Icons/Chevron/assets/chevron-down@2x.png +0 -0
  36. package/lib/commonjs/Icons/Chevron/assets/chevron-down@3x.png +0 -0
  37. package/lib/commonjs/Icons/Chevron/assets/chevron-left.png +0 -0
  38. package/lib/commonjs/Icons/Chevron/assets/chevron-left@2x.png +0 -0
  39. package/lib/commonjs/Icons/Chevron/assets/chevron-left@3x.png +0 -0
  40. package/lib/commonjs/Icons/Chevron/index.js +31 -0
  41. package/lib/commonjs/Icons/Chevron/index.js.map +1 -0
  42. package/lib/commonjs/Icons/Clock/assets/clock.png +0 -0
  43. package/lib/commonjs/Icons/Clock/assets/clock@2x.png +0 -0
  44. package/lib/commonjs/Icons/Clock/assets/clock@3x.png +0 -0
  45. package/lib/commonjs/Icons/Clock/index.js +30 -0
  46. package/lib/commonjs/Icons/Clock/index.js.map +1 -0
  47. package/lib/commonjs/Icons/Close/assets/close.png +0 -0
  48. package/lib/commonjs/Icons/Close/assets/close@2x.png +0 -0
  49. package/lib/commonjs/Icons/Close/assets/close@3x.png +0 -0
  50. package/lib/commonjs/Icons/Close/index.js +30 -0
  51. package/lib/commonjs/Icons/Close/index.js.map +1 -0
  52. package/lib/commonjs/Icons/End/assets/end.png +0 -0
  53. package/lib/commonjs/Icons/End/assets/end@2x.png +0 -0
  54. package/lib/commonjs/Icons/End/assets/end@3x.png +0 -0
  55. package/lib/commonjs/Icons/End/index.js +30 -0
  56. package/lib/commonjs/Icons/End/index.js.map +1 -0
  57. package/lib/commonjs/Icons/Hand/assets/hand.png +0 -0
  58. package/lib/commonjs/Icons/Hand/assets/hand@2x.png +0 -0
  59. package/lib/commonjs/Icons/Hand/assets/hand@3x.png +0 -0
  60. package/lib/commonjs/Icons/Hand/index.js +32 -0
  61. package/lib/commonjs/Icons/Hand/index.js.map +1 -0
  62. package/lib/commonjs/Icons/Leave/assets/leave.png +0 -0
  63. package/lib/commonjs/Icons/Leave/assets/leave@2x.png +0 -0
  64. package/lib/commonjs/Icons/Leave/assets/leave@3x.png +0 -0
  65. package/lib/commonjs/Icons/Leave/index.js +30 -0
  66. package/lib/commonjs/Icons/Leave/index.js.map +1 -0
  67. package/lib/commonjs/Icons/Mic/assets/mic-muted.png +0 -0
  68. package/lib/commonjs/Icons/Mic/assets/mic-muted@2x.png +0 -0
  69. package/lib/commonjs/Icons/Mic/assets/mic-muted@3x.png +0 -0
  70. package/lib/commonjs/Icons/Mic/assets/mic-unmuted.png +0 -0
  71. package/lib/commonjs/Icons/Mic/assets/mic-unmuted@2x.png +0 -0
  72. package/lib/commonjs/Icons/Mic/assets/mic-unmuted@3x.png +0 -0
  73. package/lib/commonjs/Icons/Mic/index.js +31 -0
  74. package/lib/commonjs/Icons/Mic/index.js.map +1 -0
  75. package/lib/commonjs/Icons/NetworkQuality/assets/network_0.png +0 -0
  76. package/lib/commonjs/Icons/NetworkQuality/assets/network_0@2x.png +0 -0
  77. package/lib/commonjs/Icons/NetworkQuality/assets/network_0@3x.png +0 -0
  78. package/lib/commonjs/Icons/NetworkQuality/assets/network_1.png +0 -0
  79. package/lib/commonjs/Icons/NetworkQuality/assets/network_1@2x.png +0 -0
  80. package/lib/commonjs/Icons/NetworkQuality/assets/network_1@3x.png +0 -0
  81. package/lib/commonjs/Icons/NetworkQuality/assets/network_2.png +0 -0
  82. package/lib/commonjs/Icons/NetworkQuality/assets/network_2@2x.png +0 -0
  83. package/lib/commonjs/Icons/NetworkQuality/assets/network_2@3x.png +0 -0
  84. package/lib/commonjs/Icons/NetworkQuality/assets/network_3.png +0 -0
  85. package/lib/commonjs/Icons/NetworkQuality/assets/network_3@2x.png +0 -0
  86. package/lib/commonjs/Icons/NetworkQuality/assets/network_3@3x.png +0 -0
  87. package/lib/commonjs/Icons/NetworkQuality/assets/network_4.png +0 -0
  88. package/lib/commonjs/Icons/NetworkQuality/assets/network_4@2x.png +0 -0
  89. package/lib/commonjs/Icons/NetworkQuality/assets/network_4@3x.png +0 -0
  90. package/lib/commonjs/Icons/NetworkQuality/assets/network_5.png +0 -0
  91. package/lib/commonjs/Icons/NetworkQuality/assets/network_5@2x.png +0 -0
  92. package/lib/commonjs/Icons/NetworkQuality/assets/network_5@3x.png +0 -0
  93. package/lib/commonjs/Icons/NetworkQuality/index.js +31 -0
  94. package/lib/commonjs/Icons/NetworkQuality/index.js.map +1 -0
  95. package/lib/commonjs/Icons/Participants/assets/participants.png +0 -0
  96. package/lib/commonjs/Icons/Participants/assets/participants@2x.png +0 -0
  97. package/lib/commonjs/Icons/Participants/assets/participants@3x.png +0 -0
  98. package/lib/commonjs/Icons/Participants/index.js +30 -0
  99. package/lib/commonjs/Icons/Participants/index.js.map +1 -0
  100. package/lib/commonjs/Icons/RotateCamera/assets/rotate-camera.png +0 -0
  101. package/lib/commonjs/Icons/RotateCamera/assets/rotate-camera@2x.png +0 -0
  102. package/lib/commonjs/Icons/RotateCamera/assets/rotate-camera@3x.png +0 -0
  103. package/lib/commonjs/Icons/RotateCamera/index.js +30 -0
  104. package/lib/commonjs/Icons/RotateCamera/index.js.map +1 -0
  105. package/lib/commonjs/Icons/ScreenShare/assets/screen-share.png +0 -0
  106. package/lib/commonjs/Icons/ScreenShare/assets/screen-share@2x.png +0 -0
  107. package/lib/commonjs/Icons/ScreenShare/assets/screen-share@3x.png +0 -0
  108. package/lib/commonjs/Icons/ScreenShare/index.js +30 -0
  109. package/lib/commonjs/Icons/ScreenShare/index.js.map +1 -0
  110. package/lib/commonjs/Icons/Send/assets/send.png +0 -0
  111. package/lib/commonjs/Icons/Send/assets/send@2x.png +0 -0
  112. package/lib/commonjs/Icons/Send/assets/send@3x.png +0 -0
  113. package/lib/commonjs/Icons/Send/index.js +30 -0
  114. package/lib/commonjs/Icons/Send/index.js.map +1 -0
  115. package/lib/commonjs/Icons/Settings/assets/settings.png +0 -0
  116. package/lib/commonjs/Icons/Settings/assets/settings@2x.png +0 -0
  117. package/lib/commonjs/Icons/Settings/assets/settings@3x.png +0 -0
  118. package/lib/commonjs/Icons/Settings/index.js +30 -0
  119. package/lib/commonjs/Icons/Settings/index.js.map +1 -0
  120. package/lib/commonjs/Icons/Speaker/assets/speaker-muted.png +0 -0
  121. package/lib/commonjs/Icons/Speaker/assets/speaker-muted@2x.png +0 -0
  122. package/lib/commonjs/Icons/Speaker/assets/speaker-muted@3x.png +0 -0
  123. package/lib/commonjs/Icons/Speaker/assets/speaker.png +0 -0
  124. package/lib/commonjs/Icons/Speaker/assets/speaker@2x.png +0 -0
  125. package/lib/commonjs/Icons/Speaker/assets/speaker@3x.png +0 -0
  126. package/lib/commonjs/Icons/Speaker/index.js +31 -0
  127. package/lib/commonjs/Icons/Speaker/index.js.map +1 -0
  128. package/lib/commonjs/Icons/ThreeDots/assets/three-dots-vertical.png +0 -0
  129. package/lib/commonjs/Icons/ThreeDots/assets/three-dots-vertical@2x.png +0 -0
  130. package/lib/commonjs/Icons/ThreeDots/assets/three-dots-vertical@3x.png +0 -0
  131. package/lib/commonjs/Icons/ThreeDots/index.js +31 -0
  132. package/lib/commonjs/Icons/ThreeDots/index.js.map +1 -0
  133. package/lib/commonjs/Icons/index.js +215 -0
  134. package/lib/commonjs/Icons/index.js.map +1 -0
  135. package/lib/commonjs/assets/100ms-logo.png +0 -0
  136. package/lib/commonjs/assets/brb.png +0 -0
  137. package/lib/commonjs/assets/icon.png +0 -0
  138. package/lib/commonjs/assets/illustration.png +0 -0
  139. package/lib/commonjs/assets/network_0.png +0 -0
  140. package/lib/commonjs/assets/network_1.png +0 -0
  141. package/lib/commonjs/assets/network_2.png +0 -0
  142. package/lib/commonjs/assets/network_3.png +0 -0
  143. package/lib/commonjs/assets/network_4.png +0 -0
  144. package/lib/commonjs/assets/user_music.png +0 -0
  145. package/lib/commonjs/components/AvatarView.js +48 -0
  146. package/lib/commonjs/components/AvatarView.js.map +1 -0
  147. package/lib/commonjs/components/BackButton.js +42 -0
  148. package/lib/commonjs/components/BackButton.js.map +1 -0
  149. package/lib/commonjs/components/Chat/ChatBanner.js +77 -0
  150. package/lib/commonjs/components/Chat/ChatBanner.js.map +1 -0
  151. package/lib/commonjs/components/Chat/ChatList.js +51 -0
  152. package/lib/commonjs/components/Chat/ChatList.js.map +1 -0
  153. package/lib/commonjs/components/Chat/ChatMessage.js +175 -0
  154. package/lib/commonjs/components/Chat/ChatMessage.js.map +1 -0
  155. package/lib/commonjs/components/Chat/PinnedMessage.js +85 -0
  156. package/lib/commonjs/components/Chat/PinnedMessage.js.map +1 -0
  157. package/lib/commonjs/components/Chat/index.js +50 -0
  158. package/lib/commonjs/components/Chat/index.js.map +1 -0
  159. package/lib/commonjs/components/ChatWindow.js +608 -0
  160. package/lib/commonjs/components/ChatWindow.js.map +1 -0
  161. package/lib/commonjs/components/CustomButton.js +53 -0
  162. package/lib/commonjs/components/CustomButton.js.map +1 -0
  163. package/lib/commonjs/components/CustomHLSPlayerControls.js +81 -0
  164. package/lib/commonjs/components/CustomHLSPlayerControls.js.map +1 -0
  165. package/lib/commonjs/components/CustomInput.js +90 -0
  166. package/lib/commonjs/components/CustomInput.js.map +1 -0
  167. package/lib/commonjs/components/DefaultModal.js +104 -0
  168. package/lib/commonjs/components/DefaultModal.js.map +1 -0
  169. package/lib/commonjs/components/DisplayTrack.js +70 -0
  170. package/lib/commonjs/components/DisplayTrack.js.map +1 -0
  171. package/lib/commonjs/components/DisplayView.js +213 -0
  172. package/lib/commonjs/components/DisplayView.js.map +1 -0
  173. package/lib/commonjs/components/Footer.js +86 -0
  174. package/lib/commonjs/components/Footer.js.map +1 -0
  175. package/lib/commonjs/components/FullScreenIndicator.js +25 -0
  176. package/lib/commonjs/components/FullScreenIndicator.js.map +1 -0
  177. package/lib/commonjs/components/GridView.js +98 -0
  178. package/lib/commonjs/components/GridView.js.map +1 -0
  179. package/lib/commonjs/components/HLSPlayerEmoticons.js +48 -0
  180. package/lib/commonjs/components/HLSPlayerEmoticons.js.map +1 -0
  181. package/lib/commonjs/components/HLSPlayerStatsView.js +64 -0
  182. package/lib/commonjs/components/HLSPlayerStatsView.js.map +1 -0
  183. package/lib/commonjs/components/HLSView.js +141 -0
  184. package/lib/commonjs/components/HLSView.js.map +1 -0
  185. package/lib/commonjs/components/HMSChat.js +31 -0
  186. package/lib/commonjs/components/HMSChat.js.map +1 -0
  187. package/lib/commonjs/components/HMSHLSNotStarted.js +59 -0
  188. package/lib/commonjs/components/HMSHLSNotStarted.js.map +1 -0
  189. package/lib/commonjs/components/HMSManageCameraRotation.js +42 -0
  190. package/lib/commonjs/components/HMSManageCameraRotation.js.map +1 -0
  191. package/lib/commonjs/components/HMSManageLeave.js +286 -0
  192. package/lib/commonjs/components/HMSManageLeave.js.map +1 -0
  193. package/lib/commonjs/components/HMSManageLocalAudio.js +46 -0
  194. package/lib/commonjs/components/HMSManageLocalAudio.js.map +1 -0
  195. package/lib/commonjs/components/HMSManageLocalVideo.js +46 -0
  196. package/lib/commonjs/components/HMSManageLocalVideo.js.map +1 -0
  197. package/lib/commonjs/components/HMSManageRaiseHand.js +48 -0
  198. package/lib/commonjs/components/HMSManageRaiseHand.js.map +1 -0
  199. package/lib/commonjs/components/HMSPreviewDeviceSettings.js +305 -0
  200. package/lib/commonjs/components/HMSPreviewDeviceSettings.js.map +1 -0
  201. package/lib/commonjs/components/HMSPreviewEditName.js +63 -0
  202. package/lib/commonjs/components/HMSPreviewEditName.js.map +1 -0
  203. package/lib/commonjs/components/HMSPreviewJoinButton.js +56 -0
  204. package/lib/commonjs/components/HMSPreviewJoinButton.js.map +1 -0
  205. package/lib/commonjs/components/HMSPreviewPeersList.js +89 -0
  206. package/lib/commonjs/components/HMSPreviewPeersList.js.map +1 -0
  207. package/lib/commonjs/components/HMSPreviewSubtitle.js +32 -0
  208. package/lib/commonjs/components/HMSPreviewSubtitle.js.map +1 -0
  209. package/lib/commonjs/components/HMSPreviewTile.js +138 -0
  210. package/lib/commonjs/components/HMSPreviewTile.js.map +1 -0
  211. package/lib/commonjs/components/HMSPreviewTitle.js +32 -0
  212. package/lib/commonjs/components/HMSPreviewTitle.js.map +1 -0
  213. package/lib/commonjs/components/HMSRoomOptions.js +105 -0
  214. package/lib/commonjs/components/HMSRoomOptions.js.map +1 -0
  215. package/lib/commonjs/components/HMSShareScreen.js +59 -0
  216. package/lib/commonjs/components/HMSShareScreen.js.map +1 -0
  217. package/lib/commonjs/components/HMSShowNetworkQuality.js +57 -0
  218. package/lib/commonjs/components/HMSShowNetworkQuality.js.map +1 -0
  219. package/lib/commonjs/components/Header.js +177 -0
  220. package/lib/commonjs/components/Header.js.map +1 -0
  221. package/lib/commonjs/components/LiveButton.js +70 -0
  222. package/lib/commonjs/components/LiveButton.js.map +1 -0
  223. package/lib/commonjs/components/Meeting.js +64 -0
  224. package/lib/commonjs/components/Meeting.js.map +1 -0
  225. package/lib/commonjs/components/MeetingScreenContent.js +98 -0
  226. package/lib/commonjs/components/MeetingScreenContent.js.map +1 -0
  227. package/lib/commonjs/components/MenuModal/Menu.js +250 -0
  228. package/lib/commonjs/components/MenuModal/Menu.js.map +1 -0
  229. package/lib/commonjs/components/MenuModal/MenuDivider.js +27 -0
  230. package/lib/commonjs/components/MenuModal/MenuDivider.js.map +1 -0
  231. package/lib/commonjs/components/MenuModal/MenuItem.js +60 -0
  232. package/lib/commonjs/components/MenuModal/MenuItem.js.map +1 -0
  233. package/lib/commonjs/components/MenuModal/index.js +27 -0
  234. package/lib/commonjs/components/MenuModal/index.js.map +1 -0
  235. package/lib/commonjs/components/Modals.js +1640 -0
  236. package/lib/commonjs/components/Modals.js.map +1 -0
  237. package/lib/commonjs/components/PIPView.js +33 -0
  238. package/lib/commonjs/components/PIPView.js.map +1 -0
  239. package/lib/commonjs/components/Participants/ParticipantsFilter.js +128 -0
  240. package/lib/commonjs/components/Participants/ParticipantsFilter.js.map +1 -0
  241. package/lib/commonjs/components/Participants/ParticipantsHeader.js +67 -0
  242. package/lib/commonjs/components/Participants/ParticipantsHeader.js.map +1 -0
  243. package/lib/commonjs/components/Participants/ParticipantsList.js +274 -0
  244. package/lib/commonjs/components/Participants/ParticipantsList.js.map +1 -0
  245. package/lib/commonjs/components/Participants/ParticipantsSeachInput.js +55 -0
  246. package/lib/commonjs/components/Participants/ParticipantsSeachInput.js.map +1 -0
  247. package/lib/commonjs/components/Participants/SearchableParticipantsView.js +27 -0
  248. package/lib/commonjs/components/Participants/SearchableParticipantsView.js.map +1 -0
  249. package/lib/commonjs/components/Participants/index.js +61 -0
  250. package/lib/commonjs/components/Participants/index.js.map +1 -0
  251. package/lib/commonjs/components/ParticipantsModal.js +43 -0
  252. package/lib/commonjs/components/ParticipantsModal.js.map +1 -0
  253. package/lib/commonjs/components/PeerDisplayView.js +79 -0
  254. package/lib/commonjs/components/PeerDisplayView.js.map +1 -0
  255. package/lib/commonjs/components/PeerRTCStatsContainer.js +70 -0
  256. package/lib/commonjs/components/PeerRTCStatsContainer.js.map +1 -0
  257. package/lib/commonjs/components/PeerRTCStatsView.js +54 -0
  258. package/lib/commonjs/components/PeerRTCStatsView.js.map +1 -0
  259. package/lib/commonjs/components/PeerSettingsModalContent.js +241 -0
  260. package/lib/commonjs/components/PeerSettingsModalContent.js.map +1 -0
  261. package/lib/commonjs/components/Picker.js +93 -0
  262. package/lib/commonjs/components/Picker.js.map +1 -0
  263. package/lib/commonjs/components/PressableIcon.js +46 -0
  264. package/lib/commonjs/components/PressableIcon.js.map +1 -0
  265. package/lib/commonjs/components/Preview.js +86 -0
  266. package/lib/commonjs/components/Preview.js.map +1 -0
  267. package/lib/commonjs/components/RoomSettingsModalContent.js +515 -0
  268. package/lib/commonjs/components/RoomSettingsModalContent.js.map +1 -0
  269. package/lib/commonjs/components/StatusBar.js +26 -0
  270. package/lib/commonjs/components/StatusBar.js.map +1 -0
  271. package/lib/commonjs/components/StreamingQualityModalContent.js +215 -0
  272. package/lib/commonjs/components/StreamingQualityModalContent.js.map +1 -0
  273. package/lib/commonjs/components/SwitchRow.js +49 -0
  274. package/lib/commonjs/components/SwitchRow.js.map +1 -0
  275. package/lib/commonjs/components/Tile.js +111 -0
  276. package/lib/commonjs/components/Tile.js.map +1 -0
  277. package/lib/commonjs/components/TilesContainer.js +38 -0
  278. package/lib/commonjs/components/TilesContainer.js.map +1 -0
  279. package/lib/commonjs/components/ZoomableView.js +84 -0
  280. package/lib/commonjs/components/ZoomableView.js.map +1 -0
  281. package/lib/commonjs/components/index.js +94 -0
  282. package/lib/commonjs/components/index.js.map +1 -0
  283. package/lib/commonjs/components/styles.js +965 -0
  284. package/lib/commonjs/components/styles.js.map +1 -0
  285. package/lib/commonjs/hooks/useHmsInstance.js +175 -0
  286. package/lib/commonjs/hooks/useHmsInstance.js.map +1 -0
  287. package/lib/commonjs/hooks-sdk-selectors.js +17 -0
  288. package/lib/commonjs/hooks-sdk-selectors.js.map +1 -0
  289. package/lib/commonjs/hooks-sdk.js +126 -0
  290. package/lib/commonjs/hooks-sdk.js.map +1 -0
  291. package/lib/commonjs/hooks-util-selectors.js +12 -0
  292. package/lib/commonjs/hooks-util-selectors.js.map +1 -0
  293. package/lib/commonjs/hooks-util.js +792 -0
  294. package/lib/commonjs/hooks-util.js.map +1 -0
  295. package/lib/commonjs/index.js +17 -0
  296. package/lib/commonjs/index.js.map +1 -0
  297. package/lib/commonjs/peerTrackNodeUtils.js +65 -0
  298. package/lib/commonjs/peerTrackNodeUtils.js.map +1 -0
  299. package/lib/commonjs/redux/actionTypes.js +75 -0
  300. package/lib/commonjs/redux/actionTypes.js.map +1 -0
  301. package/lib/commonjs/redux/actions/index.js +182 -0
  302. package/lib/commonjs/redux/actions/index.js.map +1 -0
  303. package/lib/commonjs/redux/index.js +12 -0
  304. package/lib/commonjs/redux/index.js.map +1 -0
  305. package/lib/commonjs/redux/reducers/appState.js +131 -0
  306. package/lib/commonjs/redux/reducers/appState.js.map +1 -0
  307. package/lib/commonjs/redux/reducers/chatWindow.js +45 -0
  308. package/lib/commonjs/redux/reducers/chatWindow.js.map +1 -0
  309. package/lib/commonjs/redux/reducers/hmsStates.js +67 -0
  310. package/lib/commonjs/redux/reducers/hmsStates.js.map +1 -0
  311. package/lib/commonjs/redux/reducers/index.js +22 -0
  312. package/lib/commonjs/redux/reducers/index.js.map +1 -0
  313. package/lib/commonjs/redux/reducers/message.js +43 -0
  314. package/lib/commonjs/redux/reducers/message.js.map +1 -0
  315. package/lib/commonjs/redux/reducers/userState.js +67 -0
  316. package/lib/commonjs/redux/reducers/userState.js.map +1 -0
  317. package/lib/commonjs/types.js +16 -0
  318. package/lib/commonjs/types.js.map +1 -0
  319. package/lib/commonjs/utils/dimension.js +64 -0
  320. package/lib/commonjs/utils/dimension.js.map +1 -0
  321. package/lib/commonjs/utils/functions.js +368 -0
  322. package/lib/commonjs/utils/functions.js.map +1 -0
  323. package/lib/commonjs/utils/getRoomLinkDetails.js +23 -0
  324. package/lib/commonjs/utils/getRoomLinkDetails.js.map +1 -0
  325. package/lib/commonjs/utils/hooks.js +46 -0
  326. package/lib/commonjs/utils/hooks.js.map +1 -0
  327. package/lib/commonjs/utils/theme.js +144 -0
  328. package/lib/commonjs/utils/theme.js.map +1 -0
  329. package/lib/commonjs/utils/types.js +104 -0
  330. package/lib/commonjs/utils/types.js.map +1 -0
  331. package/lib/commonjs/utils.js +30 -0
  332. package/lib/commonjs/utils.js.map +1 -0
  333. package/lib/module/HMSContainer.js +12 -0
  334. package/lib/module/HMSContainer.js.map +1 -0
  335. package/lib/module/HMSInstanceSetup.js +151 -0
  336. package/lib/module/HMSInstanceSetup.js.map +1 -0
  337. package/lib/module/HMSPrebuilt.js +22 -0
  338. package/lib/module/HMSPrebuilt.js.map +1 -0
  339. package/lib/module/HMSRoomSetup.js +206 -0
  340. package/lib/module/HMSRoomSetup.js.map +1 -0
  341. package/lib/module/Icons/100ms/assets/hms-logo.png +0 -0
  342. package/lib/module/Icons/100ms/assets/hms-logo@2x.png +0 -0
  343. package/lib/module/Icons/100ms/assets/hms-logo@3x.png +0 -0
  344. package/lib/module/Icons/100ms/index.js +22 -0
  345. package/lib/module/Icons/100ms/index.js.map +1 -0
  346. package/lib/module/Icons/Alert/assets/alert.png +0 -0
  347. package/lib/module/Icons/Alert/assets/alert@2x.png +0 -0
  348. package/lib/module/Icons/Alert/assets/alert@3x.png +0 -0
  349. package/lib/module/Icons/Alert/index.js +22 -0
  350. package/lib/module/Icons/Alert/index.js.map +1 -0
  351. package/lib/module/Icons/Camera/assets/camera-muted.png +0 -0
  352. package/lib/module/Icons/Camera/assets/camera-muted@2x.png +0 -0
  353. package/lib/module/Icons/Camera/assets/camera-muted@3x.png +0 -0
  354. package/lib/module/Icons/Camera/assets/camera-unmuted.png +0 -0
  355. package/lib/module/Icons/Camera/assets/camera-unmuted@2x.png +0 -0
  356. package/lib/module/Icons/Camera/assets/camera-unmuted@3x.png +0 -0
  357. package/lib/module/Icons/Camera/index.js +23 -0
  358. package/lib/module/Icons/Camera/index.js.map +1 -0
  359. package/lib/module/Icons/Chat/assets/chat.png +0 -0
  360. package/lib/module/Icons/Chat/assets/chat@2x.png +0 -0
  361. package/lib/module/Icons/Chat/assets/chat@3x.png +0 -0
  362. package/lib/module/Icons/Chat/index.js +22 -0
  363. package/lib/module/Icons/Chat/index.js.map +1 -0
  364. package/lib/module/Icons/Chevron/assets/chevron-down.png +0 -0
  365. package/lib/module/Icons/Chevron/assets/chevron-down@2x.png +0 -0
  366. package/lib/module/Icons/Chevron/assets/chevron-down@3x.png +0 -0
  367. package/lib/module/Icons/Chevron/assets/chevron-left.png +0 -0
  368. package/lib/module/Icons/Chevron/assets/chevron-left@2x.png +0 -0
  369. package/lib/module/Icons/Chevron/assets/chevron-left@3x.png +0 -0
  370. package/lib/module/Icons/Chevron/index.js +23 -0
  371. package/lib/module/Icons/Chevron/index.js.map +1 -0
  372. package/lib/module/Icons/Clock/assets/clock.png +0 -0
  373. package/lib/module/Icons/Clock/assets/clock@2x.png +0 -0
  374. package/lib/module/Icons/Clock/assets/clock@3x.png +0 -0
  375. package/lib/module/Icons/Clock/index.js +22 -0
  376. package/lib/module/Icons/Clock/index.js.map +1 -0
  377. package/lib/module/Icons/Close/assets/close.png +0 -0
  378. package/lib/module/Icons/Close/assets/close@2x.png +0 -0
  379. package/lib/module/Icons/Close/assets/close@3x.png +0 -0
  380. package/lib/module/Icons/Close/index.js +22 -0
  381. package/lib/module/Icons/Close/index.js.map +1 -0
  382. package/lib/module/Icons/End/assets/end.png +0 -0
  383. package/lib/module/Icons/End/assets/end@2x.png +0 -0
  384. package/lib/module/Icons/End/assets/end@3x.png +0 -0
  385. package/lib/module/Icons/End/index.js +22 -0
  386. package/lib/module/Icons/End/index.js.map +1 -0
  387. package/lib/module/Icons/Hand/assets/hand.png +0 -0
  388. package/lib/module/Icons/Hand/assets/hand@2x.png +0 -0
  389. package/lib/module/Icons/Hand/assets/hand@3x.png +0 -0
  390. package/lib/module/Icons/Hand/index.js +24 -0
  391. package/lib/module/Icons/Hand/index.js.map +1 -0
  392. package/lib/module/Icons/Leave/assets/leave.png +0 -0
  393. package/lib/module/Icons/Leave/assets/leave@2x.png +0 -0
  394. package/lib/module/Icons/Leave/assets/leave@3x.png +0 -0
  395. package/lib/module/Icons/Leave/index.js +22 -0
  396. package/lib/module/Icons/Leave/index.js.map +1 -0
  397. package/lib/module/Icons/Mic/assets/mic-muted.png +0 -0
  398. package/lib/module/Icons/Mic/assets/mic-muted@2x.png +0 -0
  399. package/lib/module/Icons/Mic/assets/mic-muted@3x.png +0 -0
  400. package/lib/module/Icons/Mic/assets/mic-unmuted.png +0 -0
  401. package/lib/module/Icons/Mic/assets/mic-unmuted@2x.png +0 -0
  402. package/lib/module/Icons/Mic/assets/mic-unmuted@3x.png +0 -0
  403. package/lib/module/Icons/Mic/index.js +23 -0
  404. package/lib/module/Icons/Mic/index.js.map +1 -0
  405. package/lib/module/Icons/NetworkQuality/assets/network_0.png +0 -0
  406. package/lib/module/Icons/NetworkQuality/assets/network_0@2x.png +0 -0
  407. package/lib/module/Icons/NetworkQuality/assets/network_0@3x.png +0 -0
  408. package/lib/module/Icons/NetworkQuality/assets/network_1.png +0 -0
  409. package/lib/module/Icons/NetworkQuality/assets/network_1@2x.png +0 -0
  410. package/lib/module/Icons/NetworkQuality/assets/network_1@3x.png +0 -0
  411. package/lib/module/Icons/NetworkQuality/assets/network_2.png +0 -0
  412. package/lib/module/Icons/NetworkQuality/assets/network_2@2x.png +0 -0
  413. package/lib/module/Icons/NetworkQuality/assets/network_2@3x.png +0 -0
  414. package/lib/module/Icons/NetworkQuality/assets/network_3.png +0 -0
  415. package/lib/module/Icons/NetworkQuality/assets/network_3@2x.png +0 -0
  416. package/lib/module/Icons/NetworkQuality/assets/network_3@3x.png +0 -0
  417. package/lib/module/Icons/NetworkQuality/assets/network_4.png +0 -0
  418. package/lib/module/Icons/NetworkQuality/assets/network_4@2x.png +0 -0
  419. package/lib/module/Icons/NetworkQuality/assets/network_4@3x.png +0 -0
  420. package/lib/module/Icons/NetworkQuality/assets/network_5.png +0 -0
  421. package/lib/module/Icons/NetworkQuality/assets/network_5@2x.png +0 -0
  422. package/lib/module/Icons/NetworkQuality/assets/network_5@3x.png +0 -0
  423. package/lib/module/Icons/NetworkQuality/index.js +23 -0
  424. package/lib/module/Icons/NetworkQuality/index.js.map +1 -0
  425. package/lib/module/Icons/Participants/assets/participants.png +0 -0
  426. package/lib/module/Icons/Participants/assets/participants@2x.png +0 -0
  427. package/lib/module/Icons/Participants/assets/participants@3x.png +0 -0
  428. package/lib/module/Icons/Participants/index.js +22 -0
  429. package/lib/module/Icons/Participants/index.js.map +1 -0
  430. package/lib/module/Icons/RotateCamera/assets/rotate-camera.png +0 -0
  431. package/lib/module/Icons/RotateCamera/assets/rotate-camera@2x.png +0 -0
  432. package/lib/module/Icons/RotateCamera/assets/rotate-camera@3x.png +0 -0
  433. package/lib/module/Icons/RotateCamera/index.js +22 -0
  434. package/lib/module/Icons/RotateCamera/index.js.map +1 -0
  435. package/lib/module/Icons/ScreenShare/assets/screen-share.png +0 -0
  436. package/lib/module/Icons/ScreenShare/assets/screen-share@2x.png +0 -0
  437. package/lib/module/Icons/ScreenShare/assets/screen-share@3x.png +0 -0
  438. package/lib/module/Icons/ScreenShare/index.js +22 -0
  439. package/lib/module/Icons/ScreenShare/index.js.map +1 -0
  440. package/lib/module/Icons/Send/assets/send.png +0 -0
  441. package/lib/module/Icons/Send/assets/send@2x.png +0 -0
  442. package/lib/module/Icons/Send/assets/send@3x.png +0 -0
  443. package/lib/module/Icons/Send/index.js +22 -0
  444. package/lib/module/Icons/Send/index.js.map +1 -0
  445. package/lib/module/Icons/Settings/assets/settings.png +0 -0
  446. package/lib/module/Icons/Settings/assets/settings@2x.png +0 -0
  447. package/lib/module/Icons/Settings/assets/settings@3x.png +0 -0
  448. package/lib/module/Icons/Settings/index.js +22 -0
  449. package/lib/module/Icons/Settings/index.js.map +1 -0
  450. package/lib/module/Icons/Speaker/assets/speaker-muted.png +0 -0
  451. package/lib/module/Icons/Speaker/assets/speaker-muted@2x.png +0 -0
  452. package/lib/module/Icons/Speaker/assets/speaker-muted@3x.png +0 -0
  453. package/lib/module/Icons/Speaker/assets/speaker.png +0 -0
  454. package/lib/module/Icons/Speaker/assets/speaker@2x.png +0 -0
  455. package/lib/module/Icons/Speaker/assets/speaker@3x.png +0 -0
  456. package/lib/module/Icons/Speaker/index.js +23 -0
  457. package/lib/module/Icons/Speaker/index.js.map +1 -0
  458. package/lib/module/Icons/ThreeDots/assets/three-dots-vertical.png +0 -0
  459. package/lib/module/Icons/ThreeDots/assets/three-dots-vertical@2x.png +0 -0
  460. package/lib/module/Icons/ThreeDots/assets/three-dots-vertical@3x.png +0 -0
  461. package/lib/module/Icons/ThreeDots/index.js +23 -0
  462. package/lib/module/Icons/ThreeDots/index.js.map +1 -0
  463. package/lib/module/Icons/index.js +20 -0
  464. package/lib/module/Icons/index.js.map +1 -0
  465. package/lib/module/assets/100ms-logo.png +0 -0
  466. package/lib/module/assets/brb.png +0 -0
  467. package/lib/module/assets/icon.png +0 -0
  468. package/lib/module/assets/illustration.png +0 -0
  469. package/lib/module/assets/network_0.png +0 -0
  470. package/lib/module/assets/network_1.png +0 -0
  471. package/lib/module/assets/network_2.png +0 -0
  472. package/lib/module/assets/network_3.png +0 -0
  473. package/lib/module/assets/network_4.png +0 -0
  474. package/lib/module/assets/user_music.png +0 -0
  475. package/lib/module/components/AvatarView.js +39 -0
  476. package/lib/module/components/AvatarView.js.map +1 -0
  477. package/lib/module/components/BackButton.js +33 -0
  478. package/lib/module/components/BackButton.js.map +1 -0
  479. package/lib/module/components/Chat/ChatBanner.js +67 -0
  480. package/lib/module/components/Chat/ChatBanner.js.map +1 -0
  481. package/lib/module/components/Chat/ChatList.js +44 -0
  482. package/lib/module/components/Chat/ChatList.js.map +1 -0
  483. package/lib/module/components/Chat/ChatMessage.js +165 -0
  484. package/lib/module/components/Chat/ChatMessage.js.map +1 -0
  485. package/lib/module/components/Chat/PinnedMessage.js +75 -0
  486. package/lib/module/components/Chat/PinnedMessage.js.map +1 -0
  487. package/lib/module/components/Chat/index.js +5 -0
  488. package/lib/module/components/Chat/index.js.map +1 -0
  489. package/lib/module/components/ChatWindow.js +595 -0
  490. package/lib/module/components/ChatWindow.js.map +1 -0
  491. package/lib/module/components/CustomButton.js +46 -0
  492. package/lib/module/components/CustomButton.js.map +1 -0
  493. package/lib/module/components/CustomHLSPlayerControls.js +73 -0
  494. package/lib/module/components/CustomHLSPlayerControls.js.map +1 -0
  495. package/lib/module/components/CustomInput.js +83 -0
  496. package/lib/module/components/CustomInput.js.map +1 -0
  497. package/lib/module/components/DefaultModal.js +96 -0
  498. package/lib/module/components/DefaultModal.js.map +1 -0
  499. package/lib/module/components/DisplayTrack.js +63 -0
  500. package/lib/module/components/DisplayTrack.js.map +1 -0
  501. package/lib/module/components/DisplayView.js +203 -0
  502. package/lib/module/components/DisplayView.js.map +1 -0
  503. package/lib/module/components/Footer.js +76 -0
  504. package/lib/module/components/Footer.js.map +1 -0
  505. package/lib/module/components/FullScreenIndicator.js +17 -0
  506. package/lib/module/components/FullScreenIndicator.js.map +1 -0
  507. package/lib/module/components/GridView.js +90 -0
  508. package/lib/module/components/GridView.js.map +1 -0
  509. package/lib/module/components/HLSPlayerEmoticons.js +40 -0
  510. package/lib/module/components/HLSPlayerEmoticons.js.map +1 -0
  511. package/lib/module/components/HLSPlayerStatsView.js +56 -0
  512. package/lib/module/components/HLSPlayerStatsView.js.map +1 -0
  513. package/lib/module/components/HLSView.js +132 -0
  514. package/lib/module/components/HLSView.js.map +1 -0
  515. package/lib/module/components/HMSChat.js +22 -0
  516. package/lib/module/components/HMSChat.js.map +1 -0
  517. package/lib/module/components/HMSHLSNotStarted.js +50 -0
  518. package/lib/module/components/HMSHLSNotStarted.js.map +1 -0
  519. package/lib/module/components/HMSManageCameraRotation.js +33 -0
  520. package/lib/module/components/HMSManageCameraRotation.js.map +1 -0
  521. package/lib/module/components/HMSManageLeave.js +276 -0
  522. package/lib/module/components/HMSManageLeave.js.map +1 -0
  523. package/lib/module/components/HMSManageLocalAudio.js +37 -0
  524. package/lib/module/components/HMSManageLocalAudio.js.map +1 -0
  525. package/lib/module/components/HMSManageLocalVideo.js +37 -0
  526. package/lib/module/components/HMSManageLocalVideo.js.map +1 -0
  527. package/lib/module/components/HMSManageRaiseHand.js +39 -0
  528. package/lib/module/components/HMSManageRaiseHand.js.map +1 -0
  529. package/lib/module/components/HMSPreviewDeviceSettings.js +296 -0
  530. package/lib/module/components/HMSPreviewDeviceSettings.js.map +1 -0
  531. package/lib/module/components/HMSPreviewEditName.js +54 -0
  532. package/lib/module/components/HMSPreviewEditName.js.map +1 -0
  533. package/lib/module/components/HMSPreviewJoinButton.js +47 -0
  534. package/lib/module/components/HMSPreviewJoinButton.js.map +1 -0
  535. package/lib/module/components/HMSPreviewPeersList.js +80 -0
  536. package/lib/module/components/HMSPreviewPeersList.js.map +1 -0
  537. package/lib/module/components/HMSPreviewSubtitle.js +23 -0
  538. package/lib/module/components/HMSPreviewSubtitle.js.map +1 -0
  539. package/lib/module/components/HMSPreviewTile.js +129 -0
  540. package/lib/module/components/HMSPreviewTile.js.map +1 -0
  541. package/lib/module/components/HMSPreviewTitle.js +23 -0
  542. package/lib/module/components/HMSPreviewTitle.js.map +1 -0
  543. package/lib/module/components/HMSRoomOptions.js +96 -0
  544. package/lib/module/components/HMSRoomOptions.js.map +1 -0
  545. package/lib/module/components/HMSShareScreen.js +50 -0
  546. package/lib/module/components/HMSShareScreen.js.map +1 -0
  547. package/lib/module/components/HMSShowNetworkQuality.js +48 -0
  548. package/lib/module/components/HMSShowNetworkQuality.js.map +1 -0
  549. package/lib/module/components/Header.js +167 -0
  550. package/lib/module/components/Header.js.map +1 -0
  551. package/lib/module/components/LiveButton.js +61 -0
  552. package/lib/module/components/LiveButton.js.map +1 -0
  553. package/lib/module/components/Meeting.js +55 -0
  554. package/lib/module/components/Meeting.js.map +1 -0
  555. package/lib/module/components/MeetingScreenContent.js +89 -0
  556. package/lib/module/components/MeetingScreenContent.js.map +1 -0
  557. package/lib/module/components/MenuModal/Menu.js +242 -0
  558. package/lib/module/components/MenuModal/Menu.js.map +1 -0
  559. package/lib/module/components/MenuModal/MenuDivider.js +20 -0
  560. package/lib/module/components/MenuModal/MenuDivider.js.map +1 -0
  561. package/lib/module/components/MenuModal/MenuItem.js +53 -0
  562. package/lib/module/components/MenuModal/MenuItem.js.map +1 -0
  563. package/lib/module/components/MenuModal/index.js +4 -0
  564. package/lib/module/components/MenuModal/index.js.map +1 -0
  565. package/lib/module/components/Modals.js +1609 -0
  566. package/lib/module/components/Modals.js.map +1 -0
  567. package/lib/module/components/PIPView.js +23 -0
  568. package/lib/module/components/PIPView.js.map +1 -0
  569. package/lib/module/components/Participants/ParticipantsFilter.js +121 -0
  570. package/lib/module/components/Participants/ParticipantsFilter.js.map +1 -0
  571. package/lib/module/components/Participants/ParticipantsHeader.js +58 -0
  572. package/lib/module/components/Participants/ParticipantsHeader.js.map +1 -0
  573. package/lib/module/components/Participants/ParticipantsList.js +264 -0
  574. package/lib/module/components/Participants/ParticipantsList.js.map +1 -0
  575. package/lib/module/components/Participants/ParticipantsSeachInput.js +45 -0
  576. package/lib/module/components/Participants/ParticipantsSeachInput.js.map +1 -0
  577. package/lib/module/components/Participants/SearchableParticipantsView.js +18 -0
  578. package/lib/module/components/Participants/SearchableParticipantsView.js.map +1 -0
  579. package/lib/module/components/Participants/index.js +6 -0
  580. package/lib/module/components/Participants/index.js.map +1 -0
  581. package/lib/module/components/ParticipantsModal.js +34 -0
  582. package/lib/module/components/ParticipantsModal.js.map +1 -0
  583. package/lib/module/components/PeerDisplayView.js +71 -0
  584. package/lib/module/components/PeerDisplayView.js.map +1 -0
  585. package/lib/module/components/PeerRTCStatsContainer.js +60 -0
  586. package/lib/module/components/PeerRTCStatsContainer.js.map +1 -0
  587. package/lib/module/components/PeerRTCStatsView.js +46 -0
  588. package/lib/module/components/PeerRTCStatsView.js.map +1 -0
  589. package/lib/module/components/PeerSettingsModalContent.js +233 -0
  590. package/lib/module/components/PeerSettingsModalContent.js.map +1 -0
  591. package/lib/module/components/Picker.js +83 -0
  592. package/lib/module/components/Picker.js.map +1 -0
  593. package/lib/module/components/PressableIcon.js +37 -0
  594. package/lib/module/components/PressableIcon.js.map +1 -0
  595. package/lib/module/components/Preview.js +77 -0
  596. package/lib/module/components/Preview.js.map +1 -0
  597. package/lib/module/components/RoomSettingsModalContent.js +505 -0
  598. package/lib/module/components/RoomSettingsModalContent.js.map +1 -0
  599. package/lib/module/components/StatusBar.js +17 -0
  600. package/lib/module/components/StatusBar.js.map +1 -0
  601. package/lib/module/components/StreamingQualityModalContent.js +205 -0
  602. package/lib/module/components/StreamingQualityModalContent.js.map +1 -0
  603. package/lib/module/components/SwitchRow.js +41 -0
  604. package/lib/module/components/SwitchRow.js.map +1 -0
  605. package/lib/module/components/Tile.js +104 -0
  606. package/lib/module/components/Tile.js.map +1 -0
  607. package/lib/module/components/TilesContainer.js +31 -0
  608. package/lib/module/components/TilesContainer.js.map +1 -0
  609. package/lib/module/components/ZoomableView.js +76 -0
  610. package/lib/module/components/ZoomableView.js.map +1 -0
  611. package/lib/module/components/index.js +9 -0
  612. package/lib/module/components/index.js.map +1 -0
  613. package/lib/module/components/styles.js +959 -0
  614. package/lib/module/components/styles.js.map +1 -0
  615. package/lib/module/hooks/useHmsInstance.js +174 -0
  616. package/lib/module/hooks/useHmsInstance.js.map +1 -0
  617. package/lib/module/hooks-sdk-selectors.js +9 -0
  618. package/lib/module/hooks-sdk-selectors.js.map +1 -0
  619. package/lib/module/hooks-sdk.js +115 -0
  620. package/lib/module/hooks-sdk.js.map +1 -0
  621. package/lib/module/hooks-util-selectors.js +5 -0
  622. package/lib/module/hooks-util-selectors.js.map +1 -0
  623. package/lib/module/hooks-util.js +772 -0
  624. package/lib/module/hooks-util.js.map +1 -0
  625. package/lib/module/index.js +2 -0
  626. package/lib/module/index.js.map +1 -0
  627. package/lib/module/peerTrackNodeUtils.js +52 -0
  628. package/lib/module/peerTrackNodeUtils.js.map +1 -0
  629. package/lib/module/redux/actionTypes.js +67 -0
  630. package/lib/module/redux/actionTypes.js.map +1 -0
  631. package/lib/module/redux/actions/index.js +144 -0
  632. package/lib/module/redux/actions/index.js.map +1 -0
  633. package/lib/module/redux/index.js +4 -0
  634. package/lib/module/redux/index.js.map +1 -0
  635. package/lib/module/redux/reducers/appState.js +123 -0
  636. package/lib/module/redux/reducers/appState.js.map +1 -0
  637. package/lib/module/redux/reducers/chatWindow.js +38 -0
  638. package/lib/module/redux/reducers/chatWindow.js.map +1 -0
  639. package/lib/module/redux/reducers/hmsStates.js +60 -0
  640. package/lib/module/redux/reducers/hmsStates.js.map +1 -0
  641. package/lib/module/redux/reducers/index.js +14 -0
  642. package/lib/module/redux/reducers/index.js.map +1 -0
  643. package/lib/module/redux/reducers/message.js +34 -0
  644. package/lib/module/redux/reducers/message.js.map +1 -0
  645. package/lib/module/redux/reducers/userState.js +58 -0
  646. package/lib/module/redux/reducers/userState.js.map +1 -0
  647. package/lib/module/types.js +9 -0
  648. package/lib/module/types.js.map +1 -0
  649. package/lib/module/utils/dimension.js +53 -0
  650. package/lib/module/utils/dimension.js.map +1 -0
  651. package/lib/module/utils/functions.js +338 -0
  652. package/lib/module/utils/functions.js.map +1 -0
  653. package/lib/module/utils/getRoomLinkDetails.js +16 -0
  654. package/lib/module/utils/getRoomLinkDetails.js.map +1 -0
  655. package/lib/module/utils/hooks.js +39 -0
  656. package/lib/module/utils/hooks.js.map +1 -0
  657. package/lib/module/utils/theme.js +134 -0
  658. package/lib/module/utils/theme.js.map +1 -0
  659. package/lib/module/utils/types.js +90 -0
  660. package/lib/module/utils/types.js.map +1 -0
  661. package/lib/module/utils.js +23 -0
  662. package/lib/module/utils.js.map +1 -0
  663. package/lib/typescript/HMSContainer.d.ts +3 -0
  664. package/lib/typescript/HMSContainer.d.ts.map +1 -0
  665. package/lib/typescript/HMSInstanceSetup.d.ts +3 -0
  666. package/lib/typescript/HMSInstanceSetup.d.ts.map +1 -0
  667. package/lib/typescript/HMSPrebuilt.d.ts +18 -0
  668. package/lib/typescript/HMSPrebuilt.d.ts.map +1 -0
  669. package/lib/typescript/HMSRoomSetup.d.ts +3 -0
  670. package/lib/typescript/HMSRoomSetup.d.ts.map +1 -0
  671. package/lib/typescript/Icons/100ms/index.d.ts +7 -0
  672. package/lib/typescript/Icons/100ms/index.d.ts.map +1 -0
  673. package/lib/typescript/Icons/Alert/index.d.ts +7 -0
  674. package/lib/typescript/Icons/Alert/index.d.ts.map +1 -0
  675. package/lib/typescript/Icons/Camera/index.d.ts +8 -0
  676. package/lib/typescript/Icons/Camera/index.d.ts.map +1 -0
  677. package/lib/typescript/Icons/Chat/index.d.ts +7 -0
  678. package/lib/typescript/Icons/Chat/index.d.ts.map +1 -0
  679. package/lib/typescript/Icons/Chevron/index.d.ts +8 -0
  680. package/lib/typescript/Icons/Chevron/index.d.ts.map +1 -0
  681. package/lib/typescript/Icons/Clock/index.d.ts +7 -0
  682. package/lib/typescript/Icons/Clock/index.d.ts.map +1 -0
  683. package/lib/typescript/Icons/Close/index.d.ts +7 -0
  684. package/lib/typescript/Icons/Close/index.d.ts.map +1 -0
  685. package/lib/typescript/Icons/End/index.d.ts +7 -0
  686. package/lib/typescript/Icons/End/index.d.ts.map +1 -0
  687. package/lib/typescript/Icons/Hand/index.d.ts +7 -0
  688. package/lib/typescript/Icons/Hand/index.d.ts.map +1 -0
  689. package/lib/typescript/Icons/Leave/index.d.ts +7 -0
  690. package/lib/typescript/Icons/Leave/index.d.ts.map +1 -0
  691. package/lib/typescript/Icons/Mic/index.d.ts +8 -0
  692. package/lib/typescript/Icons/Mic/index.d.ts.map +1 -0
  693. package/lib/typescript/Icons/NetworkQuality/index.d.ts +8 -0
  694. package/lib/typescript/Icons/NetworkQuality/index.d.ts.map +1 -0
  695. package/lib/typescript/Icons/Participants/index.d.ts +7 -0
  696. package/lib/typescript/Icons/Participants/index.d.ts.map +1 -0
  697. package/lib/typescript/Icons/RotateCamera/index.d.ts +7 -0
  698. package/lib/typescript/Icons/RotateCamera/index.d.ts.map +1 -0
  699. package/lib/typescript/Icons/ScreenShare/index.d.ts +7 -0
  700. package/lib/typescript/Icons/ScreenShare/index.d.ts.map +1 -0
  701. package/lib/typescript/Icons/Send/index.d.ts +7 -0
  702. package/lib/typescript/Icons/Send/index.d.ts.map +1 -0
  703. package/lib/typescript/Icons/Settings/index.d.ts +7 -0
  704. package/lib/typescript/Icons/Settings/index.d.ts.map +1 -0
  705. package/lib/typescript/Icons/Speaker/index.d.ts +8 -0
  706. package/lib/typescript/Icons/Speaker/index.d.ts.map +1 -0
  707. package/lib/typescript/Icons/ThreeDots/index.d.ts +8 -0
  708. package/lib/typescript/Icons/ThreeDots/index.d.ts.map +1 -0
  709. package/lib/typescript/Icons/index.d.ts +20 -0
  710. package/lib/typescript/Icons/index.d.ts.map +1 -0
  711. package/lib/typescript/components/AvatarView.d.ts +10 -0
  712. package/lib/typescript/components/AvatarView.d.ts.map +1 -0
  713. package/lib/typescript/components/BackButton.d.ts +5 -0
  714. package/lib/typescript/components/BackButton.d.ts.map +1 -0
  715. package/lib/typescript/components/Chat/ChatBanner.d.ts +3 -0
  716. package/lib/typescript/components/Chat/ChatBanner.d.ts.map +1 -0
  717. package/lib/typescript/components/Chat/ChatList.d.ts +5 -0
  718. package/lib/typescript/components/Chat/ChatList.d.ts.map +1 -0
  719. package/lib/typescript/components/Chat/ChatMessage.d.ts +8 -0
  720. package/lib/typescript/components/Chat/ChatMessage.d.ts.map +1 -0
  721. package/lib/typescript/components/Chat/PinnedMessage.d.ts +3 -0
  722. package/lib/typescript/components/Chat/PinnedMessage.d.ts.map +1 -0
  723. package/lib/typescript/components/Chat/index.d.ts +5 -0
  724. package/lib/typescript/components/Chat/index.d.ts.map +1 -0
  725. package/lib/typescript/components/ChatWindow.d.ts +22 -0
  726. package/lib/typescript/components/ChatWindow.d.ts.map +1 -0
  727. package/lib/typescript/components/CustomButton.d.ts +14 -0
  728. package/lib/typescript/components/CustomButton.d.ts.map +1 -0
  729. package/lib/typescript/components/CustomHLSPlayerControls.d.ts +7 -0
  730. package/lib/typescript/components/CustomHLSPlayerControls.d.ts.map +1 -0
  731. package/lib/typescript/components/CustomInput.d.ts +24 -0
  732. package/lib/typescript/components/CustomInput.d.ts.map +1 -0
  733. package/lib/typescript/components/DefaultModal.d.ts +15 -0
  734. package/lib/typescript/components/DefaultModal.d.ts.map +1 -0
  735. package/lib/typescript/components/DisplayTrack.d.ts +9 -0
  736. package/lib/typescript/components/DisplayTrack.d.ts.map +1 -0
  737. package/lib/typescript/components/DisplayView.d.ts +10 -0
  738. package/lib/typescript/components/DisplayView.d.ts.map +1 -0
  739. package/lib/typescript/components/Footer.d.ts +9 -0
  740. package/lib/typescript/components/Footer.d.ts.map +1 -0
  741. package/lib/typescript/components/FullScreenIndicator.d.ts +3 -0
  742. package/lib/typescript/components/FullScreenIndicator.d.ts.map +1 -0
  743. package/lib/typescript/components/GridView.d.ts +14 -0
  744. package/lib/typescript/components/GridView.d.ts.map +1 -0
  745. package/lib/typescript/components/HLSPlayerEmoticons.d.ts +2 -0
  746. package/lib/typescript/components/HLSPlayerEmoticons.d.ts.map +1 -0
  747. package/lib/typescript/components/HLSPlayerStatsView.d.ts +6 -0
  748. package/lib/typescript/components/HLSPlayerStatsView.d.ts.map +1 -0
  749. package/lib/typescript/components/HLSView.d.ts +3 -0
  750. package/lib/typescript/components/HLSView.d.ts.map +1 -0
  751. package/lib/typescript/components/HMSChat.d.ts +3 -0
  752. package/lib/typescript/components/HMSChat.d.ts.map +1 -0
  753. package/lib/typescript/components/HMSHLSNotStarted.d.ts +3 -0
  754. package/lib/typescript/components/HMSHLSNotStarted.d.ts.map +1 -0
  755. package/lib/typescript/components/HMSManageCameraRotation.d.ts +3 -0
  756. package/lib/typescript/components/HMSManageCameraRotation.d.ts.map +1 -0
  757. package/lib/typescript/components/HMSManageLeave.d.ts +9 -0
  758. package/lib/typescript/components/HMSManageLeave.d.ts.map +1 -0
  759. package/lib/typescript/components/HMSManageLocalAudio.d.ts +3 -0
  760. package/lib/typescript/components/HMSManageLocalAudio.d.ts.map +1 -0
  761. package/lib/typescript/components/HMSManageLocalVideo.d.ts +3 -0
  762. package/lib/typescript/components/HMSManageLocalVideo.d.ts.map +1 -0
  763. package/lib/typescript/components/HMSManageRaiseHand.d.ts +3 -0
  764. package/lib/typescript/components/HMSManageRaiseHand.d.ts.map +1 -0
  765. package/lib/typescript/components/HMSPreviewDeviceSettings.d.ts +3 -0
  766. package/lib/typescript/components/HMSPreviewDeviceSettings.d.ts.map +1 -0
  767. package/lib/typescript/components/HMSPreviewEditName.d.ts +5 -0
  768. package/lib/typescript/components/HMSPreviewEditName.d.ts.map +1 -0
  769. package/lib/typescript/components/HMSPreviewJoinButton.d.ts +7 -0
  770. package/lib/typescript/components/HMSPreviewJoinButton.d.ts.map +1 -0
  771. package/lib/typescript/components/HMSPreviewPeersList.d.ts +5 -0
  772. package/lib/typescript/components/HMSPreviewPeersList.d.ts.map +1 -0
  773. package/lib/typescript/components/HMSPreviewSubtitle.d.ts +6 -0
  774. package/lib/typescript/components/HMSPreviewSubtitle.d.ts.map +1 -0
  775. package/lib/typescript/components/HMSPreviewTile.d.ts +3 -0
  776. package/lib/typescript/components/HMSPreviewTile.d.ts.map +1 -0
  777. package/lib/typescript/components/HMSPreviewTitle.d.ts +6 -0
  778. package/lib/typescript/components/HMSPreviewTitle.d.ts.map +1 -0
  779. package/lib/typescript/components/HMSRoomOptions.d.ts +6 -0
  780. package/lib/typescript/components/HMSRoomOptions.d.ts.map +1 -0
  781. package/lib/typescript/components/HMSShareScreen.d.ts +9 -0
  782. package/lib/typescript/components/HMSShareScreen.d.ts.map +1 -0
  783. package/lib/typescript/components/HMSShowNetworkQuality.d.ts +3 -0
  784. package/lib/typescript/components/HMSShowNetworkQuality.d.ts.map +1 -0
  785. package/lib/typescript/components/Header.d.ts +9 -0
  786. package/lib/typescript/components/Header.d.ts.map +1 -0
  787. package/lib/typescript/components/LiveButton.d.ts +17 -0
  788. package/lib/typescript/components/LiveButton.d.ts.map +1 -0
  789. package/lib/typescript/components/Meeting.d.ts +8 -0
  790. package/lib/typescript/components/Meeting.d.ts.map +1 -0
  791. package/lib/typescript/components/MeetingScreenContent.d.ts +8 -0
  792. package/lib/typescript/components/MeetingScreenContent.d.ts.map +1 -0
  793. package/lib/typescript/components/MenuModal/Menu.d.ts +45 -0
  794. package/lib/typescript/components/MenuModal/Menu.d.ts.map +1 -0
  795. package/lib/typescript/components/MenuModal/MenuDivider.d.ts +6 -0
  796. package/lib/typescript/components/MenuModal/MenuDivider.d.ts.map +1 -0
  797. package/lib/typescript/components/MenuModal/MenuItem.d.ts +12 -0
  798. package/lib/typescript/components/MenuModal/MenuItem.d.ts.map +1 -0
  799. package/lib/typescript/components/MenuModal/index.d.ts +7 -0
  800. package/lib/typescript/components/MenuModal/index.d.ts.map +1 -0
  801. package/lib/typescript/components/Modals.d.ts +96 -0
  802. package/lib/typescript/components/Modals.d.ts.map +1 -0
  803. package/lib/typescript/components/PIPView.d.ts +8 -0
  804. package/lib/typescript/components/PIPView.d.ts.map +1 -0
  805. package/lib/typescript/components/Participants/ParticipantsFilter.d.ts +6 -0
  806. package/lib/typescript/components/Participants/ParticipantsFilter.d.ts.map +1 -0
  807. package/lib/typescript/components/Participants/ParticipantsHeader.d.ts +9 -0
  808. package/lib/typescript/components/Participants/ParticipantsHeader.d.ts.map +1 -0
  809. package/lib/typescript/components/Participants/ParticipantsList.d.ts +7 -0
  810. package/lib/typescript/components/Participants/ParticipantsList.d.ts.map +1 -0
  811. package/lib/typescript/components/Participants/ParticipantsSeachInput.d.ts +8 -0
  812. package/lib/typescript/components/Participants/ParticipantsSeachInput.d.ts.map +1 -0
  813. package/lib/typescript/components/Participants/SearchableParticipantsView.d.ts +3 -0
  814. package/lib/typescript/components/Participants/SearchableParticipantsView.d.ts.map +1 -0
  815. package/lib/typescript/components/Participants/index.d.ts +6 -0
  816. package/lib/typescript/components/Participants/index.d.ts.map +1 -0
  817. package/lib/typescript/components/ParticipantsModal.d.ts +5 -0
  818. package/lib/typescript/components/ParticipantsModal.d.ts.map +1 -0
  819. package/lib/typescript/components/PeerDisplayView.d.ts +11 -0
  820. package/lib/typescript/components/PeerDisplayView.d.ts.map +1 -0
  821. package/lib/typescript/components/PeerRTCStatsContainer.d.ts +9 -0
  822. package/lib/typescript/components/PeerRTCStatsContainer.d.ts.map +1 -0
  823. package/lib/typescript/components/PeerRTCStatsView.d.ts +10 -0
  824. package/lib/typescript/components/PeerRTCStatsView.d.ts.map +1 -0
  825. package/lib/typescript/components/PeerSettingsModalContent.d.ts +13 -0
  826. package/lib/typescript/components/PeerSettingsModalContent.d.ts.map +1 -0
  827. package/lib/typescript/components/Picker.d.ts +9 -0
  828. package/lib/typescript/components/Picker.d.ts.map +1 -0
  829. package/lib/typescript/components/PressableIcon.d.ts +11 -0
  830. package/lib/typescript/components/PressableIcon.d.ts.map +1 -0
  831. package/lib/typescript/components/Preview.d.ts +6 -0
  832. package/lib/typescript/components/Preview.d.ts.map +1 -0
  833. package/lib/typescript/components/RoomSettingsModalContent.d.ts +17 -0
  834. package/lib/typescript/components/RoomSettingsModalContent.d.ts.map +1 -0
  835. package/lib/typescript/components/StatusBar.d.ts +7 -0
  836. package/lib/typescript/components/StatusBar.d.ts.map +1 -0
  837. package/lib/typescript/components/StreamingQualityModalContent.d.ts +9 -0
  838. package/lib/typescript/components/StreamingQualityModalContent.d.ts.map +1 -0
  839. package/lib/typescript/components/SwitchRow.d.ts +12 -0
  840. package/lib/typescript/components/SwitchRow.d.ts.map +1 -0
  841. package/lib/typescript/components/Tile.d.ts +12 -0
  842. package/lib/typescript/components/Tile.d.ts.map +1 -0
  843. package/lib/typescript/components/TilesContainer.d.ts +11 -0
  844. package/lib/typescript/components/TilesContainer.d.ts.map +1 -0
  845. package/lib/typescript/components/ZoomableView.d.ts +6 -0
  846. package/lib/typescript/components/ZoomableView.d.ts.map +1 -0
  847. package/lib/typescript/components/index.d.ts +9 -0
  848. package/lib/typescript/components/index.d.ts.map +1 -0
  849. package/lib/typescript/components/styles.d.ts +945 -0
  850. package/lib/typescript/components/styles.d.ts.map +1 -0
  851. package/lib/typescript/hooks/useHmsInstance.d.ts +1 -0
  852. package/lib/typescript/hooks/useHmsInstance.d.ts.map +1 -0
  853. package/lib/typescript/hooks-sdk-selectors.d.ts +4 -0
  854. package/lib/typescript/hooks-sdk-selectors.d.ts.map +1 -0
  855. package/lib/typescript/hooks-sdk.d.ts +12 -0
  856. package/lib/typescript/hooks-sdk.d.ts.map +1 -0
  857. package/lib/typescript/hooks-util-selectors.d.ts +3 -0
  858. package/lib/typescript/hooks-util-selectors.d.ts.map +1 -0
  859. package/lib/typescript/hooks-util.d.ts +53 -0
  860. package/lib/typescript/hooks-util.d.ts.map +1 -0
  861. package/lib/typescript/index.d.ts +2 -0
  862. package/lib/typescript/index.d.ts.map +1 -0
  863. package/lib/typescript/peerTrackNodeUtils.d.ts +10 -0
  864. package/lib/typescript/peerTrackNodeUtils.d.ts.map +1 -0
  865. package/lib/typescript/redux/actionTypes.d.ts +56 -0
  866. package/lib/typescript/redux/actionTypes.d.ts.map +1 -0
  867. package/lib/typescript/redux/actions/index.d.ts +199 -0
  868. package/lib/typescript/redux/actions/index.d.ts.map +1 -0
  869. package/lib/typescript/redux/index.d.ts +55 -0
  870. package/lib/typescript/redux/index.d.ts.map +1 -0
  871. package/lib/typescript/redux/reducers/appState.d.ts +32 -0
  872. package/lib/typescript/redux/reducers/appState.d.ts.map +1 -0
  873. package/lib/typescript/redux/reducers/chatWindow.d.ts +10 -0
  874. package/lib/typescript/redux/reducers/chatWindow.d.ts.map +1 -0
  875. package/lib/typescript/redux/reducers/hmsStates.d.ts +46 -0
  876. package/lib/typescript/redux/reducers/hmsStates.d.ts.map +1 -0
  877. package/lib/typescript/redux/reducers/index.d.ts +54 -0
  878. package/lib/typescript/redux/reducers/index.d.ts.map +1 -0
  879. package/lib/typescript/redux/reducers/message.d.ts +12 -0
  880. package/lib/typescript/redux/reducers/message.d.ts.map +1 -0
  881. package/lib/typescript/redux/reducers/userState.d.ts +26 -0
  882. package/lib/typescript/redux/reducers/userState.d.ts.map +1 -0
  883. package/lib/typescript/types.d.ts +8 -0
  884. package/lib/typescript/types.d.ts.map +1 -0
  885. package/lib/typescript/utils/dimension.d.ts +15 -0
  886. package/lib/typescript/utils/dimension.d.ts.map +1 -0
  887. package/lib/typescript/utils/functions.d.ts +47 -0
  888. package/lib/typescript/utils/functions.d.ts.map +1 -0
  889. package/lib/typescript/utils/getRoomLinkDetails.d.ts +5 -0
  890. package/lib/typescript/utils/getRoomLinkDetails.d.ts.map +1 -0
  891. package/lib/typescript/utils/hooks.d.ts +2 -0
  892. package/lib/typescript/utils/hooks.d.ts.map +1 -0
  893. package/lib/typescript/utils/theme.d.ts +126 -0
  894. package/lib/typescript/utils/theme.d.ts.map +1 -0
  895. package/lib/typescript/utils/types.d.ts +82 -0
  896. package/lib/typescript/utils/types.d.ts.map +1 -0
  897. package/lib/typescript/utils.d.ts +12 -0
  898. package/lib/typescript/utils.d.ts.map +1 -0
  899. package/package.json +182 -0
  900. package/src/HMSContainer.tsx +18 -0
  901. package/src/HMSInstanceSetup.tsx +196 -0
  902. package/src/HMSPrebuilt.tsx +36 -0
  903. package/src/HMSRoomSetup.tsx +281 -0
  904. package/src/Icons/100ms/assets/hms-logo.png +0 -0
  905. package/src/Icons/100ms/assets/hms-logo@2x.png +0 -0
  906. package/src/Icons/100ms/assets/hms-logo@3x.png +0 -0
  907. package/src/Icons/100ms/index.tsx +27 -0
  908. package/src/Icons/Alert/assets/alert.png +0 -0
  909. package/src/Icons/Alert/assets/alert@2x.png +0 -0
  910. package/src/Icons/Alert/assets/alert@3x.png +0 -0
  911. package/src/Icons/Alert/index.tsx +27 -0
  912. package/src/Icons/Camera/assets/camera-muted.png +0 -0
  913. package/src/Icons/Camera/assets/camera-muted@2x.png +0 -0
  914. package/src/Icons/Camera/assets/camera-muted@3x.png +0 -0
  915. package/src/Icons/Camera/assets/camera-unmuted.png +0 -0
  916. package/src/Icons/Camera/assets/camera-unmuted@2x.png +0 -0
  917. package/src/Icons/Camera/assets/camera-unmuted@3x.png +0 -0
  918. package/src/Icons/Camera/index.tsx +34 -0
  919. package/src/Icons/Chat/assets/chat.png +0 -0
  920. package/src/Icons/Chat/assets/chat@2x.png +0 -0
  921. package/src/Icons/Chat/assets/chat@3x.png +0 -0
  922. package/src/Icons/Chat/index.tsx +24 -0
  923. package/src/Icons/Chevron/assets/chevron-down.png +0 -0
  924. package/src/Icons/Chevron/assets/chevron-down@2x.png +0 -0
  925. package/src/Icons/Chevron/assets/chevron-down@3x.png +0 -0
  926. package/src/Icons/Chevron/assets/chevron-left.png +0 -0
  927. package/src/Icons/Chevron/assets/chevron-left@2x.png +0 -0
  928. package/src/Icons/Chevron/assets/chevron-left@3x.png +0 -0
  929. package/src/Icons/Chevron/index.tsx +34 -0
  930. package/src/Icons/Clock/assets/clock.png +0 -0
  931. package/src/Icons/Clock/assets/clock@2x.png +0 -0
  932. package/src/Icons/Clock/assets/clock@3x.png +0 -0
  933. package/src/Icons/Clock/index.tsx +27 -0
  934. package/src/Icons/Close/assets/close.png +0 -0
  935. package/src/Icons/Close/assets/close@2x.png +0 -0
  936. package/src/Icons/Close/assets/close@3x.png +0 -0
  937. package/src/Icons/Close/index.tsx +27 -0
  938. package/src/Icons/End/assets/end.png +0 -0
  939. package/src/Icons/End/assets/end@2x.png +0 -0
  940. package/src/Icons/End/assets/end@3x.png +0 -0
  941. package/src/Icons/End/index.tsx +24 -0
  942. package/src/Icons/Hand/assets/hand.png +0 -0
  943. package/src/Icons/Hand/assets/hand@2x.png +0 -0
  944. package/src/Icons/Hand/assets/hand@3x.png +0 -0
  945. package/src/Icons/Hand/index.tsx +27 -0
  946. package/src/Icons/Leave/assets/leave.png +0 -0
  947. package/src/Icons/Leave/assets/leave@2x.png +0 -0
  948. package/src/Icons/Leave/assets/leave@3x.png +0 -0
  949. package/src/Icons/Leave/index.tsx +27 -0
  950. package/src/Icons/Mic/assets/mic-muted.png +0 -0
  951. package/src/Icons/Mic/assets/mic-muted@2x.png +0 -0
  952. package/src/Icons/Mic/assets/mic-muted@3x.png +0 -0
  953. package/src/Icons/Mic/assets/mic-unmuted.png +0 -0
  954. package/src/Icons/Mic/assets/mic-unmuted@2x.png +0 -0
  955. package/src/Icons/Mic/assets/mic-unmuted@3x.png +0 -0
  956. package/src/Icons/Mic/index.tsx +34 -0
  957. package/src/Icons/NetworkQuality/assets/network_0.png +0 -0
  958. package/src/Icons/NetworkQuality/assets/network_0@2x.png +0 -0
  959. package/src/Icons/NetworkQuality/assets/network_0@3x.png +0 -0
  960. package/src/Icons/NetworkQuality/assets/network_1.png +0 -0
  961. package/src/Icons/NetworkQuality/assets/network_1@2x.png +0 -0
  962. package/src/Icons/NetworkQuality/assets/network_1@3x.png +0 -0
  963. package/src/Icons/NetworkQuality/assets/network_2.png +0 -0
  964. package/src/Icons/NetworkQuality/assets/network_2@2x.png +0 -0
  965. package/src/Icons/NetworkQuality/assets/network_2@3x.png +0 -0
  966. package/src/Icons/NetworkQuality/assets/network_3.png +0 -0
  967. package/src/Icons/NetworkQuality/assets/network_3@2x.png +0 -0
  968. package/src/Icons/NetworkQuality/assets/network_3@3x.png +0 -0
  969. package/src/Icons/NetworkQuality/assets/network_4.png +0 -0
  970. package/src/Icons/NetworkQuality/assets/network_4@2x.png +0 -0
  971. package/src/Icons/NetworkQuality/assets/network_4@3x.png +0 -0
  972. package/src/Icons/NetworkQuality/assets/network_5.png +0 -0
  973. package/src/Icons/NetworkQuality/assets/network_5@2x.png +0 -0
  974. package/src/Icons/NetworkQuality/assets/network_5@3x.png +0 -0
  975. package/src/Icons/NetworkQuality/index.tsx +42 -0
  976. package/src/Icons/Participants/assets/participants.png +0 -0
  977. package/src/Icons/Participants/assets/participants@2x.png +0 -0
  978. package/src/Icons/Participants/assets/participants@3x.png +0 -0
  979. package/src/Icons/Participants/index.tsx +27 -0
  980. package/src/Icons/RotateCamera/assets/rotate-camera.png +0 -0
  981. package/src/Icons/RotateCamera/assets/rotate-camera@2x.png +0 -0
  982. package/src/Icons/RotateCamera/assets/rotate-camera@3x.png +0 -0
  983. package/src/Icons/RotateCamera/index.tsx +27 -0
  984. package/src/Icons/ScreenShare/assets/screen-share.png +0 -0
  985. package/src/Icons/ScreenShare/assets/screen-share@2x.png +0 -0
  986. package/src/Icons/ScreenShare/assets/screen-share@3x.png +0 -0
  987. package/src/Icons/ScreenShare/index.tsx +27 -0
  988. package/src/Icons/Send/assets/send.png +0 -0
  989. package/src/Icons/Send/assets/send@2x.png +0 -0
  990. package/src/Icons/Send/assets/send@3x.png +0 -0
  991. package/src/Icons/Send/index.tsx +24 -0
  992. package/src/Icons/Settings/assets/settings.png +0 -0
  993. package/src/Icons/Settings/assets/settings@2x.png +0 -0
  994. package/src/Icons/Settings/assets/settings@3x.png +0 -0
  995. package/src/Icons/Settings/index.tsx +27 -0
  996. package/src/Icons/Speaker/assets/speaker-muted.png +0 -0
  997. package/src/Icons/Speaker/assets/speaker-muted@2x.png +0 -0
  998. package/src/Icons/Speaker/assets/speaker-muted@3x.png +0 -0
  999. package/src/Icons/Speaker/assets/speaker.png +0 -0
  1000. package/src/Icons/Speaker/assets/speaker@2x.png +0 -0
  1001. package/src/Icons/Speaker/assets/speaker@3x.png +0 -0
  1002. package/src/Icons/Speaker/index.tsx +34 -0
  1003. package/src/Icons/ThreeDots/assets/three-dots-vertical.png +0 -0
  1004. package/src/Icons/ThreeDots/assets/three-dots-vertical@2x.png +0 -0
  1005. package/src/Icons/ThreeDots/assets/three-dots-vertical@3x.png +0 -0
  1006. package/src/Icons/ThreeDots/index.tsx +34 -0
  1007. package/src/Icons/index.ts +19 -0
  1008. package/src/assets/100ms-logo.png +0 -0
  1009. package/src/assets/brb.png +0 -0
  1010. package/src/assets/icon.png +0 -0
  1011. package/src/assets/illustration.png +0 -0
  1012. package/src/assets/network_0.png +0 -0
  1013. package/src/assets/network_1.png +0 -0
  1014. package/src/assets/network_2.png +0 -0
  1015. package/src/assets/network_3.png +0 -0
  1016. package/src/assets/network_4.png +0 -0
  1017. package/src/assets/user_music.png +0 -0
  1018. package/src/components/AvatarView.tsx +54 -0
  1019. package/src/components/BackButton.tsx +42 -0
  1020. package/src/components/Chat/ChatBanner.tsx +70 -0
  1021. package/src/components/Chat/ChatList.tsx +60 -0
  1022. package/src/components/Chat/ChatMessage.tsx +237 -0
  1023. package/src/components/Chat/PinnedMessage.tsx +89 -0
  1024. package/src/components/Chat/index.ts +4 -0
  1025. package/src/components/ChatWindow.tsx +706 -0
  1026. package/src/components/CustomButton.tsx +80 -0
  1027. package/src/components/CustomHLSPlayerControls.tsx +92 -0
  1028. package/src/components/CustomInput.tsx +139 -0
  1029. package/src/components/DefaultModal.tsx +117 -0
  1030. package/src/components/DisplayTrack.tsx +92 -0
  1031. package/src/components/DisplayView.tsx +314 -0
  1032. package/src/components/Footer.tsx +109 -0
  1033. package/src/components/FullScreenIndicator.tsx +21 -0
  1034. package/src/components/GridView.tsx +124 -0
  1035. package/src/components/HLSPlayerEmoticons.tsx +60 -0
  1036. package/src/components/HLSPlayerStatsView.tsx +68 -0
  1037. package/src/components/HLSView.tsx +170 -0
  1038. package/src/components/HMSChat.tsx +36 -0
  1039. package/src/components/HMSHLSNotStarted.tsx +62 -0
  1040. package/src/components/HMSManageCameraRotation.tsx +48 -0
  1041. package/src/components/HMSManageLeave.tsx +349 -0
  1042. package/src/components/HMSManageLocalAudio.tsx +49 -0
  1043. package/src/components/HMSManageLocalVideo.tsx +49 -0
  1044. package/src/components/HMSManageRaiseHand.tsx +48 -0
  1045. package/src/components/HMSPreviewDeviceSettings.tsx +387 -0
  1046. package/src/components/HMSPreviewEditName.tsx +63 -0
  1047. package/src/components/HMSPreviewJoinButton.tsx +64 -0
  1048. package/src/components/HMSPreviewPeersList.tsx +108 -0
  1049. package/src/components/HMSPreviewSubtitle.tsx +26 -0
  1050. package/src/components/HMSPreviewTile.tsx +152 -0
  1051. package/src/components/HMSPreviewTitle.tsx +26 -0
  1052. package/src/components/HMSRoomOptions.tsx +141 -0
  1053. package/src/components/HMSShareScreen.tsx +71 -0
  1054. package/src/components/HMSShowNetworkQuality.tsx +67 -0
  1055. package/src/components/Header.tsx +185 -0
  1056. package/src/components/LiveButton.tsx +77 -0
  1057. package/src/components/Meeting.tsx +72 -0
  1058. package/src/components/MeetingScreenContent.tsx +109 -0
  1059. package/src/components/MenuModal/Menu.tsx +305 -0
  1060. package/src/components/MenuModal/MenuDivider.tsx +22 -0
  1061. package/src/components/MenuModal/MenuItem.tsx +67 -0
  1062. package/src/components/MenuModal/index.ts +7 -0
  1063. package/src/components/Modals.tsx +2103 -0
  1064. package/src/components/PIPView.tsx +30 -0
  1065. package/src/components/Participants/ParticipantsFilter.tsx +144 -0
  1066. package/src/components/Participants/ParticipantsHeader.tsx +64 -0
  1067. package/src/components/Participants/ParticipantsList.tsx +331 -0
  1068. package/src/components/Participants/ParticipantsSeachInput.tsx +55 -0
  1069. package/src/components/Participants/SearchableParticipantsView.tsx +21 -0
  1070. package/src/components/Participants/index.ts +5 -0
  1071. package/src/components/ParticipantsModal.tsx +46 -0
  1072. package/src/components/PeerDisplayView.tsx +112 -0
  1073. package/src/components/PeerRTCStatsContainer.tsx +82 -0
  1074. package/src/components/PeerRTCStatsView.tsx +110 -0
  1075. package/src/components/PeerSettingsModalContent.tsx +355 -0
  1076. package/src/components/Picker.tsx +108 -0
  1077. package/src/components/PressableIcon.tsx +54 -0
  1078. package/src/components/Preview.tsx +108 -0
  1079. package/src/components/RoomSettingsModalContent.tsx +743 -0
  1080. package/src/components/StatusBar.tsx +22 -0
  1081. package/src/components/StreamingQualityModalContent.tsx +266 -0
  1082. package/src/components/SwitchRow.tsx +55 -0
  1083. package/src/components/Tile.tsx +119 -0
  1084. package/src/components/TilesContainer.tsx +48 -0
  1085. package/src/components/ZoomableView.tsx +91 -0
  1086. package/src/components/index.ts +8 -0
  1087. package/src/components/styles.ts +961 -0
  1088. package/src/hooks/useHmsInstance.ts +173 -0
  1089. package/src/hooks-sdk-selectors.tsx +9 -0
  1090. package/src/hooks-sdk.ts +156 -0
  1091. package/src/hooks-util-selectors.tsx +4 -0
  1092. package/src/hooks-util.ts +1124 -0
  1093. package/src/index.ts +1 -0
  1094. package/src/peerTrackNodeUtils.tsx +114 -0
  1095. package/src/redux/actionTypes.ts +85 -0
  1096. package/src/redux/actions/index.ts +196 -0
  1097. package/src/redux/index.ts +8 -0
  1098. package/src/redux/reducers/appState.ts +143 -0
  1099. package/src/redux/reducers/chatWindow.ts +35 -0
  1100. package/src/redux/reducers/hmsStates.ts +126 -0
  1101. package/src/redux/reducers/index.ts +14 -0
  1102. package/src/redux/reducers/message.ts +36 -0
  1103. package/src/redux/reducers/userState.ts +88 -0
  1104. package/src/types.ts +7 -0
  1105. package/src/utils/dimension.ts +57 -0
  1106. package/src/utils/functions.ts +522 -0
  1107. package/src/utils/getRoomLinkDetails.ts +23 -0
  1108. package/src/utils/hooks.ts +104 -0
  1109. package/src/utils/theme.ts +130 -0
  1110. package/src/utils/types.ts +95 -0
  1111. package/src/utils.ts +24 -0
@@ -0,0 +1,2103 @@
1
+ import React, { useEffect, useState } from 'react';
2
+ import {
3
+ View,
4
+ TouchableOpacity,
5
+ Text,
6
+ ScrollView,
7
+ TextInput,
8
+ StyleSheet,
9
+ Image,
10
+ Platform,
11
+ InteractionManager,
12
+ useWindowDimensions,
13
+ } from 'react-native';
14
+ import type { ImageURISource } from 'react-native';
15
+ import Toast from 'react-native-simple-toast';
16
+ import { useDispatch, useSelector } from 'react-redux';
17
+ import {
18
+ HMSTrack,
19
+ HMSRole,
20
+ HMSSDK,
21
+ HMSTrackType,
22
+ HMSTrackSource,
23
+ HMSAudioDevice,
24
+ HMSAudioMode,
25
+ HMSAudioMixingMode,
26
+ HMSHLSMeetingURLVariant,
27
+ HMSHLSRecordingConfig,
28
+ HMSHLSConfig,
29
+ HMSRTMPConfig,
30
+ HMSLocalPeer,
31
+ HMSRemotePeer,
32
+ } from '@100mslive/react-native-hms';
33
+ import Feather from 'react-native-vector-icons/Feather';
34
+ import Entypo from 'react-native-vector-icons/Entypo';
35
+ import MaterialCommunityIcons from 'react-native-vector-icons/MaterialCommunityIcons';
36
+ import MaterialIcons from 'react-native-vector-icons/MaterialIcons';
37
+ import { Slider } from '@miblanchard/react-native-slider';
38
+ import RNFetchBlob from 'rn-fetch-blob';
39
+ import RNFS from 'react-native-fs';
40
+ import Share from 'react-native-share';
41
+
42
+ import { styles } from './styles';
43
+
44
+ import { CustomButton } from './CustomButton';
45
+ import { CustomInput } from './CustomInput';
46
+ import { Menu, MenuItem } from './MenuModal';
47
+
48
+ import { CustomPicker } from './Picker';
49
+ import {
50
+ changeHLSAspectRatio,
51
+ changeShowStats,
52
+ saveUserData,
53
+ } from '../redux/actions';
54
+ import { requestExternalStoragePermission, getTime } from '../utils/functions';
55
+ import {
56
+ LayoutParams,
57
+ ModalTypes,
58
+ SUPPORTED_ASPECT_RATIOS,
59
+ SortingType,
60
+ } from '../utils/types';
61
+ import { COLORS } from '../utils/theme';
62
+ import type { RootState } from '../redux';
63
+ import { SwitchRow } from './SwitchRow';
64
+ import { useHMSInstance } from '../hooks-util';
65
+
66
+ export const ChangeRoleModal = ({ cancelModal }: { cancelModal: Function }) => {
67
+ const instance = useHMSInstance();
68
+ const peer = useSelector((state: RootState) => state.app.peerToUpdate);
69
+ const roles = useSelector((state: RootState) => state.hmsStates.roles);
70
+
71
+ const [newRole, setNewRole] = useState<HMSRole>(peer?.role!);
72
+ const [request, setRequest] = useState<boolean>(false);
73
+ const [visible, setVisible] = useState<boolean>(false);
74
+
75
+ const hideMenu = () => setVisible(false);
76
+ const showMenu = () => setVisible(true);
77
+ const changeRole = () => {
78
+ instance?.changeRoleOfPeer(peer!, newRole, !request).catch((e) => {
79
+ console.log('Change Role of Peer Error: ', e);
80
+ Toast.showWithGravity((e as Error).message, Toast.LONG, Toast.TOP);
81
+ });
82
+ cancelModal();
83
+ };
84
+
85
+ return (
86
+ <View style={styles.roleChangeModal}>
87
+ <Text style={styles.roleChangeModalHeading}>Change Role</Text>
88
+ <Text style={styles.roleChangeModalDescription}>
89
+ Change the role of '{peer?.name}' to
90
+ </Text>
91
+ <Menu
92
+ visible={visible}
93
+ anchor={
94
+ <TouchableOpacity
95
+ style={styles.participantChangeRoleContainer}
96
+ onPress={showMenu}
97
+ >
98
+ <Text style={styles.participantFilterText} numberOfLines={1}>
99
+ {newRole?.name}
100
+ </Text>
101
+ <MaterialIcons
102
+ name={visible ? 'arrow-drop-up' : 'arrow-drop-down'}
103
+ style={styles.participantFilterIcon}
104
+ size={24}
105
+ />
106
+ </TouchableOpacity>
107
+ }
108
+ onRequestClose={hideMenu}
109
+ style={styles.participantsMenuContainer}
110
+ >
111
+ {roles?.map((knownRole) => {
112
+ return (
113
+ <MenuItem
114
+ onPress={() => {
115
+ hideMenu();
116
+ setNewRole(knownRole);
117
+ }}
118
+ key={knownRole.name}
119
+ >
120
+ <View style={styles.participantMenuItem}>
121
+ <Text style={styles.participantMenuItemName}>
122
+ {knownRole?.name}
123
+ </Text>
124
+ </View>
125
+ </MenuItem>
126
+ );
127
+ })}
128
+ </Menu>
129
+ {!peer?.isLocal && (
130
+ <TouchableOpacity
131
+ style={styles.roleChangeModalPermissionContainer}
132
+ onPress={() => {
133
+ setRequest(!request);
134
+ }}
135
+ >
136
+ <View style={styles.roleChangeModalCheckBox}>
137
+ {request && (
138
+ <Entypo
139
+ name="check"
140
+ style={styles.roleChangeModalCheck}
141
+ size={10}
142
+ />
143
+ )}
144
+ </View>
145
+ <Text style={styles.roleChangeModalPermission}>
146
+ Request permission from the user
147
+ </Text>
148
+ </TouchableOpacity>
149
+ )}
150
+ <View style={styles.roleChangeModalPermissionContainer}>
151
+ <CustomButton
152
+ title="Cancel"
153
+ onPress={cancelModal}
154
+ viewStyle={styles.roleChangeModalCancelButton}
155
+ textStyle={styles.roleChangeModalButtonText}
156
+ />
157
+ <CustomButton
158
+ title="Change"
159
+ onPress={changeRole}
160
+ viewStyle={styles.roleChangeModalSuccessButton}
161
+ textStyle={styles.roleChangeModalButtonText}
162
+ />
163
+ </View>
164
+ </View>
165
+ );
166
+ };
167
+
168
+ export const SaveScreenshot = ({
169
+ imageSource,
170
+ cancelModal,
171
+ }: {
172
+ imageSource?: Required<Pick<ImageURISource, 'uri'>> | null;
173
+ cancelModal: Function;
174
+ }) => {
175
+ const peer = useSelector(
176
+ (state: RootState) => state.hmsStates.localPeer || undefined
177
+ );
178
+
179
+ /**
180
+ * Get target path on external storage to save image
181
+ * @param {string} imageExtension file extension to use for image
182
+ * @param {string} peerName name of peer to use in image name
183
+ * @returns string - path on external storage to save image
184
+ */
185
+ const getTargetPath = (imageExtension: string, peerName?: string) => {
186
+ // formatting peer name
187
+ const formattedPeerName = peerName
188
+ ? peerName.replace(/ /g, '-').toLowerCase()
189
+ : '';
190
+
191
+ // name to use for image
192
+ const imageName = `${formattedPeerName}-snapshot-${Date.now()}.${imageExtension}`;
193
+
194
+ // directory for saving image
195
+ const targetDir =
196
+ Platform.OS === 'ios'
197
+ ? RNFetchBlob.fs.dirs.DocumentDir
198
+ : RNFetchBlob.fs.dirs.DCIMDir;
199
+
200
+ const targetLocation = `${targetDir}/${imageName}`;
201
+
202
+ return targetLocation;
203
+ };
204
+
205
+ const saveToDisk = async () => {
206
+ try {
207
+ // Requesting External Storage permission to save image to disk
208
+ const permission = await requestExternalStoragePermission();
209
+
210
+ // checking External Storage permission and availability of image source that we have to save to disk
211
+ if (permission && peer && imageSource) {
212
+ // Waiting for Interactions (Modal Close Animation) to finish
213
+ InteractionManager.runAfterInteractions(async () => {
214
+ // image extension to use
215
+ const imageExtension = 'png';
216
+
217
+ // Removing `file://` from URI if it exists, to keep it consistent with `base64` image case
218
+ const source = imageSource.uri.replace('file://', '');
219
+
220
+ // Checking if source is the local file on device
221
+ const isSourceLocalFile = imageSource.uri.startsWith('file://');
222
+
223
+ // if source is local file on ios device then we don't need to do any file system operation
224
+ // We can use that local file to show preview window to user on ios
225
+ const targetLocation =
226
+ isSourceLocalFile && Platform.OS === 'ios'
227
+ ? source
228
+ : getTargetPath(imageExtension, peer.name);
229
+
230
+ // if source is local file on android device, then we copy source file to target path
231
+ if (isSourceLocalFile) {
232
+ if (Platform.OS === 'android') {
233
+ await RNFS.copyFile(
234
+ source, // Source Dir
235
+ targetLocation // Target Dir
236
+ );
237
+ }
238
+ }
239
+ // if source is not local file, then we write to target path
240
+ else {
241
+ await RNFetchBlob.fs.writeFile(
242
+ targetLocation, // Target Dir
243
+ source.replace('data:image/png;base64,', ''), // Data to write to "Target Dir"
244
+ 'base64'
245
+ );
246
+ }
247
+
248
+ Share.open({ url: 'file://' + targetLocation })
249
+ .then(({ message }) => {
250
+ if (message.includes('SaveToCameraRoll')) {
251
+ Toast.showWithGravity(
252
+ 'Snapshot has been saved successfully',
253
+ Toast.LONG,
254
+ Toast.TOP
255
+ );
256
+ }
257
+ cancelModal();
258
+ })
259
+ .catch((error) => console.log('share error -> ', error))
260
+ .finally(() => {
261
+ // On Android, We have already saved image into DCIM dir
262
+ // Therefore, we can notify user about "save success" and close modal
263
+ if (Platform.OS === 'android') {
264
+ Toast.showWithGravity(
265
+ 'Snapshot has been saved successfully',
266
+ Toast.LONG,
267
+ Toast.TOP
268
+ );
269
+ cancelModal();
270
+ }
271
+ });
272
+ });
273
+ }
274
+ } catch (error) {
275
+ console.warn('Snapshot Save Error: ', error);
276
+ }
277
+ };
278
+
279
+ return (
280
+ <View style={[{ flexGrow: 1 }, styles.volumeModalContainer]}>
281
+ <Text style={styles.roleChangeModalHeading}>
282
+ {peer ? `${peer.name}'s Snapshot` : 'Snapshot'}
283
+ </Text>
284
+ {imageSource ? (
285
+ <Image
286
+ source={imageSource}
287
+ style={styles.screenshotImage}
288
+ resizeMode="contain"
289
+ />
290
+ ) : null}
291
+ <View style={styles.roleChangeModalPermissionContainer}>
292
+ <CustomButton
293
+ title="Cancel"
294
+ onPress={cancelModal}
295
+ viewStyle={[styles.roleChangeModalCancelButton, { width: '40%' }]}
296
+ textStyle={styles.roleChangeModalButtonText}
297
+ />
298
+ <CustomButton
299
+ title="Save to Disk"
300
+ onPress={saveToDisk}
301
+ viewStyle={[styles.roleChangeModalSuccessButton, { width: '56%' }]}
302
+ textStyle={styles.roleChangeModalButtonText}
303
+ />
304
+ </View>
305
+ </View>
306
+ );
307
+ };
308
+
309
+ export const ChangeVolumeModal = ({
310
+ cancelModal,
311
+ }: {
312
+ cancelModal: Function;
313
+ }) => {
314
+ const instance = useHMSInstance();
315
+ const peer = useSelector((state: RootState) => state.app.peerToUpdate);
316
+ const [volume, setVolume] = useState<number>(0);
317
+
318
+ const changeVolume = () => {
319
+ if (peer?.audioTrack) {
320
+ instance?.setVolume(peer?.audioTrack, volume);
321
+ }
322
+ cancelModal();
323
+ };
324
+
325
+ return (
326
+ <View style={styles.volumeModalContainer}>
327
+ <Text style={styles.roleChangeModalHeading}>Set Volume</Text>
328
+ <View style={styles.volumeModalSlider}>
329
+ <Text style={styles.roleChangeModalDescription}>Volume: {volume}</Text>
330
+ <Slider
331
+ value={volume}
332
+ maximumValue={10}
333
+ minimumValue={0}
334
+ step={1}
335
+ onValueChange={(value: any) => setVolume(value[0])}
336
+ />
337
+ </View>
338
+ <View style={styles.roleChangeModalPermissionContainer}>
339
+ <CustomButton
340
+ title="Cancel"
341
+ onPress={cancelModal}
342
+ viewStyle={styles.roleChangeModalCancelButton}
343
+ textStyle={styles.roleChangeModalButtonText}
344
+ />
345
+ <CustomButton
346
+ title="Change"
347
+ onPress={changeVolume}
348
+ viewStyle={styles.roleChangeModalSuccessButton}
349
+ textStyle={styles.roleChangeModalButtonText}
350
+ />
351
+ </View>
352
+ </View>
353
+ );
354
+ };
355
+
356
+ export const ChangeNameModal = ({ cancelModal }: { cancelModal: Function }) => {
357
+ const instance = useHMSInstance();
358
+ const peer = useSelector((state: RootState) => state.app.peerToUpdate);
359
+ const dispatch = useDispatch();
360
+
361
+ const [name, setName] = useState<string>(peer?.name!);
362
+
363
+ const changeName = () => {
364
+ if (name.length > 0) {
365
+ instance
366
+ ?.changeName(name)
367
+ .then((d) => {
368
+ dispatch(
369
+ saveUserData({
370
+ userName: name,
371
+ })
372
+ );
373
+ console.log('Change Name Success: ', d);
374
+ })
375
+ .catch((e) => console.log('Change Name Error: ', e));
376
+ }
377
+ cancelModal();
378
+ };
379
+
380
+ return (
381
+ <View style={styles.volumeModalContainer}>
382
+ <Text style={styles.roleChangeModalHeading}>Change Name</Text>
383
+ <View style={styles.volumeModalSlider}>
384
+ <CustomInput
385
+ value={name}
386
+ onChangeText={setName}
387
+ inputStyle={styles.participantChangeNameInput}
388
+ placeholderTextColor={COLORS.TEXT.DISABLED}
389
+ placeholder="Find what you’re looking for"
390
+ />
391
+ </View>
392
+ <View style={styles.roleChangeModalPermissionContainer}>
393
+ <CustomButton
394
+ title="Cancel"
395
+ onPress={cancelModal}
396
+ viewStyle={styles.roleChangeModalCancelButton}
397
+ textStyle={styles.roleChangeModalButtonText}
398
+ />
399
+ <CustomButton
400
+ title="Change"
401
+ onPress={changeName}
402
+ viewStyle={styles.roleChangeModalSuccessButton}
403
+ textStyle={styles.roleChangeModalButtonText}
404
+ />
405
+ </View>
406
+ </View>
407
+ );
408
+ };
409
+
410
+ interface RTCTrack {
411
+ name: string;
412
+ peerId?: string; // peerId is used to get audio track stats
413
+ track?: HMSTrack;
414
+ }
415
+
416
+ export const RtcStatsModal = () => {
417
+ const dispatch = useDispatch();
418
+ const instance = useSelector((state: RootState) => state.user.hmsInstance);
419
+ const showStatsOnTiles = useSelector(
420
+ (state: RootState) => state.app.joinConfig.showStats
421
+ );
422
+
423
+ const [localPeer, setLocalPeer] = useState<HMSLocalPeer | null>(null);
424
+ const [remotePeers, setRemotePeers] = useState<HMSRemotePeer[]>([]);
425
+ const [tracksListModalVisible, setTracksListModalVisible] =
426
+ useState<boolean>(false);
427
+ const [currentTrack, setCurrentTrack] = useState<RTCTrack | null>(null);
428
+
429
+ const hideMenu = () => setTracksListModalVisible(false);
430
+ const showMenu = () => setTracksListModalVisible(true);
431
+
432
+ const getStatsList = () => {
433
+ const list: RTCTrack[] = [];
434
+
435
+ if (localPeer?.audioTrack?.trackId) {
436
+ list.push({
437
+ name: localPeer?.name + "'s audio",
438
+ peerId: localPeer?.peerID,
439
+ track: localPeer?.audioTrack,
440
+ });
441
+ }
442
+ if (localPeer?.videoTrack?.trackId) {
443
+ list.push({
444
+ name: localPeer?.name + "'s video",
445
+ track: localPeer?.videoTrack,
446
+ });
447
+ }
448
+ remotePeers.forEach((remotePeer) => {
449
+ if (remotePeer?.audioTrack?.trackId) {
450
+ list.push({
451
+ name: remotePeer?.name + "'s audio",
452
+ peerId: remotePeer?.peerID,
453
+ track: remotePeer?.audioTrack,
454
+ });
455
+ }
456
+ if (remotePeer?.videoTrack?.trackId) {
457
+ list.push({
458
+ name: remotePeer?.name + "'s video",
459
+ track: remotePeer?.videoTrack,
460
+ });
461
+ }
462
+ });
463
+
464
+ return list;
465
+ };
466
+
467
+ // Getting Local Peer from hms instance
468
+ useEffect(() => {
469
+ if (instance) {
470
+ const updateLocalPeer = async () => {
471
+ setLocalPeer(await instance.getLocalPeer());
472
+ };
473
+
474
+ updateLocalPeer();
475
+ }
476
+ }, [instance]);
477
+
478
+ // Getting Remote Peers from hms instance
479
+ useEffect(() => {
480
+ if (instance) {
481
+ const updateRemotePeers = async () => {
482
+ setRemotePeers(await instance.getRemotePeers());
483
+ };
484
+
485
+ updateRemotePeers();
486
+ }
487
+ }, [instance]);
488
+
489
+ const isCurrentTrackSelected = currentTrack !== null;
490
+
491
+ const statsList = getStatsList();
492
+
493
+ const firstTrackInStatsList = statsList.length > 0 ? statsList[0] : null;
494
+
495
+ // If currentTrack is null and we have valid item in StatsList
496
+ // then showing stats for the first valid item in StatsList
497
+ useEffect(() => {
498
+ if (!isCurrentTrackSelected && firstTrackInStatsList) {
499
+ setCurrentTrack(firstTrackInStatsList);
500
+ }
501
+ }, [isCurrentTrackSelected, firstTrackInStatsList]);
502
+
503
+ const selectedTrackId = currentTrack
504
+ ? currentTrack.peerId || currentTrack.track?.trackId
505
+ : null;
506
+
507
+ const rtcStatsData = useSelector((state: RootState) =>
508
+ selectedTrackId ? state.app.rtcStats[selectedTrackId] : null
509
+ );
510
+
511
+ return (
512
+ <View style={styles.participantContainer}>
513
+ <View style={styles.participantsHeaderContainer}>
514
+ <Text style={styles.participantsHeading}>Stats for Nerds</Text>
515
+ </View>
516
+
517
+ <SwitchRow
518
+ text="Show Stats on Tiles"
519
+ value={showStatsOnTiles}
520
+ onChange={(value) => dispatch(changeShowStats(value))}
521
+ />
522
+
523
+ <Menu
524
+ visible={tracksListModalVisible}
525
+ anchor={
526
+ <TouchableOpacity style={styles.statsModalMenu} onPress={showMenu}>
527
+ <Text style={styles.participantFilterText} numberOfLines={1}>
528
+ {currentTrack?.name ?? 'Choose'}
529
+ </Text>
530
+ <MaterialIcons
531
+ name={
532
+ tracksListModalVisible ? 'arrow-drop-up' : 'arrow-drop-down'
533
+ }
534
+ style={styles.participantFilterIcon}
535
+ size={24}
536
+ />
537
+ </TouchableOpacity>
538
+ }
539
+ onRequestClose={hideMenu}
540
+ style={styles.participantsMenuContainer}
541
+ >
542
+ {statsList.map((trackObj) => {
543
+ return (
544
+ <MenuItem
545
+ onPress={() => {
546
+ hideMenu();
547
+ setCurrentTrack(trackObj);
548
+ }}
549
+ key={trackObj?.track?.trackId}
550
+ >
551
+ <View style={styles.participantMenuItem}>
552
+ <Text style={styles.participantMenuItemName}>
553
+ {trackObj?.name}
554
+ </Text>
555
+ </View>
556
+ </MenuItem>
557
+ );
558
+ })}
559
+ </Menu>
560
+
561
+ <ScrollView
562
+ contentContainerStyle={
563
+ Array.isArray(rtcStatsData) ? null : styles.statsModalCardContainer
564
+ }
565
+ >
566
+ {rtcStatsData ? (
567
+ Array.isArray(rtcStatsData) ? (
568
+ <View>
569
+ {rtcStatsData.map((rtcStatsItem) => {
570
+ return (
571
+ <View style={{ marginBottom: 12 }}>
572
+ <Text style={styles.statsModalCardDescription}>
573
+ {rtcStatsItem.layer}
574
+ </Text>
575
+
576
+ <View style={styles.statsModalCardContainer}>
577
+ {Object.entries(rtcStatsItem)
578
+ .filter((item) => item[0] !== 'layer')
579
+ .map((item) => {
580
+ const [key, value] = item;
581
+
582
+ return (
583
+ <View style={styles.statsModalCard} key={key}>
584
+ <Text style={styles.statsModalCardHeading}>
585
+ {key}
586
+ </Text>
587
+
588
+ <Text style={styles.statsModalCardDescription}>
589
+ {key === 'resolution'
590
+ ? `Height: ${value?.height ?? 0}, Width: ${
591
+ value?.width ?? 0
592
+ }`
593
+ : key === 'qualityLimitationReasons'
594
+ ? value.reason
595
+ : value}
596
+ </Text>
597
+ </View>
598
+ );
599
+ })}
600
+ </View>
601
+ </View>
602
+ );
603
+ })}
604
+ </View>
605
+ ) : (
606
+ Object.entries(rtcStatsData).map((item) => {
607
+ const [key, value] = item;
608
+
609
+ return (
610
+ <View style={styles.statsModalCard} key={key}>
611
+ <Text style={styles.statsModalCardHeading}>{key}</Text>
612
+
613
+ <Text style={styles.statsModalCardDescription}>
614
+ {key === 'resolution'
615
+ ? `Height: ${value?.height ?? 0}, Width: ${
616
+ value?.width ?? 0
617
+ }`
618
+ : value}
619
+ </Text>
620
+ </View>
621
+ );
622
+ })
623
+ )
624
+ ) : null}
625
+ </ScrollView>
626
+ </View>
627
+ );
628
+ };
629
+
630
+ export const LeaveRoomModal = ({
631
+ onSuccess,
632
+ cancelModal,
633
+ }: {
634
+ onSuccess: Function;
635
+ cancelModal: Function;
636
+ }) => {
637
+ const onLeave = () => {
638
+ cancelModal();
639
+ onSuccess();
640
+ };
641
+ return (
642
+ <View style={styles.volumeModalContainer}>
643
+ <View style={styles.participantMenuItem}>
644
+ <Feather
645
+ name="log-out"
646
+ style={styles.participantMenuItemIcon}
647
+ size={24}
648
+ />
649
+ <Text style={styles.roleChangeModalHeading}>Leave Studio</Text>
650
+ </View>
651
+ <View style={styles.roleChangeModalPermissionContainer}>
652
+ <Text style={styles.roleChangeModalDescription}>
653
+ Others will continue after you leave. You can join the studio again.
654
+ </Text>
655
+ </View>
656
+ <View style={styles.roleChangeModalPermissionContainer}>
657
+ <CustomButton
658
+ title="Don’t Leave"
659
+ onPress={cancelModal}
660
+ viewStyle={styles.roleChangeModalCancelButton}
661
+ textStyle={styles.roleChangeModalButtonText}
662
+ />
663
+ <CustomButton
664
+ title="Leave"
665
+ onPress={onLeave}
666
+ viewStyle={[
667
+ styles.roleChangeModalSuccessButton,
668
+ styles.errorContainer,
669
+ ]}
670
+ textStyle={styles.roleChangeModalButtonText}
671
+ />
672
+ </View>
673
+ </View>
674
+ );
675
+ };
676
+
677
+ export const EndRoomModal = ({
678
+ onSuccess,
679
+ cancelModal,
680
+ }: {
681
+ onSuccess: Function;
682
+ cancelModal: Function;
683
+ }) => {
684
+ const onEnd = () => {
685
+ cancelModal();
686
+ onSuccess();
687
+ };
688
+ return (
689
+ <View style={styles.volumeModalContainer}>
690
+ <View style={styles.participantMenuItem}>
691
+ <Feather
692
+ name="alert-triangle"
693
+ style={[styles.participantMenuItemIcon, styles.error]}
694
+ size={24}
695
+ />
696
+ <Text style={[styles.roleChangeModalHeading, styles.error]}>
697
+ End Session
698
+ </Text>
699
+ </View>
700
+ <View style={styles.roleChangeModalPermissionContainer}>
701
+ <Text style={styles.roleChangeModalDescription}>
702
+ The session will end for everyone and all the activities will stop.
703
+ You can’t undo this action.
704
+ </Text>
705
+ </View>
706
+ <View style={styles.roleChangeModalPermissionContainer}>
707
+ <CustomButton
708
+ title="Don’t End"
709
+ onPress={cancelModal}
710
+ viewStyle={styles.roleChangeModalCancelButton}
711
+ textStyle={styles.roleChangeModalButtonText}
712
+ />
713
+ <CustomButton
714
+ title="End Session"
715
+ onPress={onEnd}
716
+ viewStyle={[
717
+ styles.roleChangeModalSuccessButton,
718
+ styles.errorContainer,
719
+ ]}
720
+ textStyle={styles.roleChangeModalButtonText}
721
+ />
722
+ </View>
723
+ </View>
724
+ );
725
+ };
726
+
727
+ export const ChangeAudioOutputModal = ({
728
+ cancelModal,
729
+ }: {
730
+ cancelModal: Function;
731
+ }) => {
732
+ const instance = useHMSInstance();
733
+ const [currentOutputDevice, setCurrentOutputDevice] =
734
+ useState<HMSAudioDevice>(HMSAudioDevice.SPEAKER_PHONE);
735
+ const [audioOutputDevicesList, setAudioOutputDevicesList] = useState<
736
+ HMSAudioDevice[]
737
+ >([]);
738
+
739
+ const switchAudioOutput = () => {
740
+ instance?.switchAudioOutput(currentOutputDevice);
741
+ cancelModal();
742
+ };
743
+
744
+ useEffect(() => {
745
+ const getList = async () => {
746
+ setAudioOutputDevicesList(await instance?.getAudioDevicesList());
747
+ setCurrentOutputDevice(await instance?.getAudioOutputRouteType());
748
+ };
749
+ getList();
750
+ }, [instance]);
751
+
752
+ return (
753
+ <View style={styles.roleChangeModal}>
754
+ <Text style={styles.roleChangeModalHeading}>Switch Audio Output</Text>
755
+ {audioOutputDevicesList.map((device) => {
756
+ return (
757
+ <TouchableOpacity
758
+ key={device}
759
+ style={styles.roleChangeModalPermissionContainer}
760
+ onPress={() => {
761
+ setCurrentOutputDevice(device);
762
+ }}
763
+ >
764
+ <View style={styles.roleChangeModalCheckBox}>
765
+ {currentOutputDevice === device && (
766
+ <Entypo
767
+ name="check"
768
+ style={styles.roleChangeModalCheck}
769
+ size={10}
770
+ />
771
+ )}
772
+ </View>
773
+ <Text style={styles.roleChangeModalPermission}>{device}</Text>
774
+ </TouchableOpacity>
775
+ );
776
+ })}
777
+
778
+ <View style={styles.roleChangeModalPermissionContainer}>
779
+ <CustomButton
780
+ title="Cancel"
781
+ onPress={cancelModal}
782
+ viewStyle={styles.roleChangeModalCancelButton}
783
+ textStyle={styles.roleChangeModalButtonText}
784
+ />
785
+ <CustomButton
786
+ title="Change"
787
+ onPress={switchAudioOutput}
788
+ viewStyle={styles.roleChangeModalSuccessButton}
789
+ textStyle={styles.roleChangeModalButtonText}
790
+ />
791
+ </View>
792
+ </View>
793
+ );
794
+ };
795
+
796
+ export const ChangeAspectRatio = ({
797
+ cancelModal,
798
+ }: {
799
+ cancelModal: Function;
800
+ }) => {
801
+ const { height } = useWindowDimensions();
802
+ const dispatch = useDispatch();
803
+ const hlsPlayerAspectRatio = useSelector(
804
+ (state: RootState) => state.app.hlsAspectRatio
805
+ );
806
+ const [selectedRatio, setSelectedRatio] = useState(hlsPlayerAspectRatio);
807
+
808
+ const handleChangePress = () => {
809
+ cancelModal();
810
+ if (hlsPlayerAspectRatio.id !== selectedRatio.id) {
811
+ dispatch(changeHLSAspectRatio(selectedRatio));
812
+ }
813
+ };
814
+
815
+ return (
816
+ <View style={styles.roleChangeModal}>
817
+ <Text style={styles.roleChangeModalHeading}>Change Aspect Ratio</Text>
818
+ <Text style={styles.roleChangeModalDescription}>
819
+ Current: {hlsPlayerAspectRatio.id}
820
+ </Text>
821
+
822
+ <ScrollView style={{ maxHeight: height * 0.4 }}>
823
+ {SUPPORTED_ASPECT_RATIOS.map((ratio) => {
824
+ return (
825
+ <TouchableOpacity
826
+ key={ratio.id}
827
+ style={styles.roleChangeModalPermissionContainer}
828
+ onPress={() => setSelectedRatio(ratio)}
829
+ >
830
+ <View style={styles.roleChangeModalCheckBox}>
831
+ {selectedRatio.id === ratio.id ? (
832
+ <Entypo
833
+ name="check"
834
+ style={styles.roleChangeModalCheck}
835
+ size={10}
836
+ />
837
+ ) : null}
838
+ </View>
839
+ <Text style={styles.roleChangeModalPermission}>{ratio.id}</Text>
840
+ </TouchableOpacity>
841
+ );
842
+ })}
843
+ </ScrollView>
844
+
845
+ <View style={styles.roleChangeModalPermissionContainer}>
846
+ <CustomButton
847
+ title="Cancel"
848
+ onPress={cancelModal}
849
+ viewStyle={styles.roleChangeModalCancelButton}
850
+ textStyle={styles.roleChangeModalButtonText}
851
+ />
852
+ <CustomButton
853
+ title="Change"
854
+ onPress={handleChangePress}
855
+ viewStyle={styles.roleChangeModalSuccessButton}
856
+ textStyle={styles.roleChangeModalButtonText}
857
+ />
858
+ </View>
859
+ </View>
860
+ );
861
+ };
862
+
863
+ export const ChangeAudioModeModal = ({
864
+ cancelModal,
865
+ audioMode,
866
+ setAudioMode,
867
+ }: {
868
+ audioMode: HMSAudioMode;
869
+ setAudioMode: React.Dispatch<React.SetStateAction<HMSAudioMode>>;
870
+ cancelModal: Function;
871
+ }) => {
872
+ const instance = useHMSInstance();
873
+ const [currentAudioMode, setCurrentAudioMode] =
874
+ useState<HMSAudioMode>(audioMode);
875
+
876
+ const AudioModeList = [
877
+ 'MODE_NORMAL',
878
+ 'MODE_RINGTONE',
879
+ 'MODE_IN_CALL',
880
+ 'MODE_IN_COMMUNICATION',
881
+ 'MODE_CALL_SCREENING',
882
+ ];
883
+
884
+ const switchAudioMode = () => {
885
+ instance?.setAudioMode(currentAudioMode);
886
+ setAudioMode(currentAudioMode);
887
+ cancelModal();
888
+ };
889
+
890
+ return (
891
+ <View style={styles.roleChangeModal}>
892
+ <Text style={styles.roleChangeModalHeading}>Switch Audio Output</Text>
893
+ {AudioModeList.map((mode) => {
894
+ return (
895
+ <TouchableOpacity
896
+ key={mode}
897
+ style={styles.roleChangeModalPermissionContainer}
898
+ onPress={() => {
899
+ setCurrentAudioMode(AudioModeList.indexOf(mode));
900
+ }}
901
+ >
902
+ <View style={styles.roleChangeModalCheckBox}>
903
+ {currentAudioMode === AudioModeList.indexOf(mode) && (
904
+ <Entypo
905
+ name="check"
906
+ style={styles.roleChangeModalCheck}
907
+ size={10}
908
+ />
909
+ )}
910
+ </View>
911
+ <Text style={styles.roleChangeModalPermission}>{mode}</Text>
912
+ </TouchableOpacity>
913
+ );
914
+ })}
915
+
916
+ <View style={styles.roleChangeModalPermissionContainer}>
917
+ <CustomButton
918
+ title="Cancel"
919
+ onPress={cancelModal}
920
+ viewStyle={styles.roleChangeModalCancelButton}
921
+ textStyle={styles.roleChangeModalButtonText}
922
+ />
923
+ <CustomButton
924
+ title="Change"
925
+ onPress={switchAudioMode}
926
+ viewStyle={styles.roleChangeModalSuccessButton}
927
+ textStyle={styles.roleChangeModalButtonText}
928
+ />
929
+ </View>
930
+ </View>
931
+ );
932
+ };
933
+
934
+ export const ChangeAudioMixingModeModal = ({
935
+ newAudioMixingMode,
936
+ cancelModal,
937
+ setNewAudioMixingMode,
938
+ }: {
939
+ newAudioMixingMode: HMSAudioMixingMode;
940
+ cancelModal: Function;
941
+ setNewAudioMixingMode: React.Dispatch<
942
+ React.SetStateAction<HMSAudioMixingMode>
943
+ >;
944
+ }) => {
945
+ const instance = useHMSInstance();
946
+ const changeAudioMixingMode = async () => {
947
+ await instance?.setAudioMixingMode(newAudioMixingMode);
948
+ cancelModal();
949
+ };
950
+
951
+ return (
952
+ <View style={styles.roleChangeModal}>
953
+ <Text style={styles.roleChangeModalHeading}>
954
+ Change Audio Mixing Mode
955
+ </Text>
956
+ <Text style={styles.roleChangeModalDescription}>
957
+ TALK_ONLY : only data captured by mic will be streamed in the room,
958
+ TALK_AND_MUSIC : data captured by mic as well as playback audio being
959
+ captured from device will be streamed in the room, MUSIC_ONLY : only the
960
+ playback audio being captured from device will be streamed in the room
961
+ </Text>
962
+ {Object.keys(HMSAudioMixingMode).map((audioMixingMode) => {
963
+ return (
964
+ <TouchableOpacity
965
+ key={audioMixingMode}
966
+ style={styles.roleChangeModalPermissionContainer}
967
+ onPress={() => {
968
+ setNewAudioMixingMode(audioMixingMode as HMSAudioMixingMode);
969
+ }}
970
+ >
971
+ <View style={styles.roleChangeModalCheckBox}>
972
+ {newAudioMixingMode === audioMixingMode && (
973
+ <Entypo
974
+ name="check"
975
+ style={styles.roleChangeModalCheck}
976
+ size={10}
977
+ />
978
+ )}
979
+ </View>
980
+ <Text style={styles.roleChangeModalPermission}>
981
+ {audioMixingMode}
982
+ </Text>
983
+ </TouchableOpacity>
984
+ );
985
+ })}
986
+ <View style={styles.roleChangeModalPermissionContainer}>
987
+ <CustomButton
988
+ title="Cancel"
989
+ onPress={cancelModal}
990
+ viewStyle={styles.roleChangeModalCancelButton}
991
+ textStyle={styles.roleChangeModalButtonText}
992
+ />
993
+ <CustomButton
994
+ title="Change"
995
+ onPress={changeAudioMixingMode}
996
+ viewStyle={styles.roleChangeModalSuccessButton}
997
+ textStyle={styles.roleChangeModalButtonText}
998
+ />
999
+ </View>
1000
+ </View>
1001
+ );
1002
+ };
1003
+
1004
+ export const ChangeSortingModal = ({
1005
+ data,
1006
+ selectedItem,
1007
+ onItemSelected,
1008
+ cancelModal,
1009
+ }: {
1010
+ data: SortingType[];
1011
+ selectedItem: SortingType | undefined;
1012
+ onItemSelected: React.Dispatch<React.SetStateAction<SortingType | undefined>>;
1013
+ cancelModal: Function;
1014
+ }) => {
1015
+ const [sortingType, setSortingType] = useState<SortingType>(
1016
+ selectedItem || SortingType.DEFAULT
1017
+ );
1018
+
1019
+ const changeSorting = () => {
1020
+ onItemSelected(sortingType);
1021
+ cancelModal();
1022
+ };
1023
+
1024
+ return (
1025
+ <View style={styles.roleChangeModal}>
1026
+ <Text style={styles.roleChangeModalHeading}>Sorting Style</Text>
1027
+ <CustomPicker
1028
+ data={data}
1029
+ selectedItem={sortingType}
1030
+ onItemSelected={setSortingType}
1031
+ viewStyle={styles.picker}
1032
+ />
1033
+ <View style={styles.sortingButtonContainer}>
1034
+ <CustomButton
1035
+ title="Cancel"
1036
+ onPress={cancelModal}
1037
+ viewStyle={styles.roleChangeModalCancelButton}
1038
+ textStyle={styles.roleChangeModalButtonText}
1039
+ />
1040
+ <CustomButton
1041
+ title="Change"
1042
+ onPress={changeSorting}
1043
+ viewStyle={styles.roleChangeModalSuccessButton}
1044
+ textStyle={styles.roleChangeModalButtonText}
1045
+ />
1046
+ </View>
1047
+ </View>
1048
+ );
1049
+ };
1050
+
1051
+ export const ChangeLayoutModal = ({
1052
+ data,
1053
+ selectedItem,
1054
+ onItemSelected,
1055
+ cancelModal,
1056
+ }: {
1057
+ data: LayoutParams[];
1058
+ selectedItem: LayoutParams;
1059
+ onItemSelected: React.Dispatch<React.SetStateAction<LayoutParams>>;
1060
+ cancelModal: Function;
1061
+ }) => {
1062
+ const [layout, setLayout] = useState<LayoutParams>(selectedItem);
1063
+
1064
+ const changeLayout = () => {
1065
+ onItemSelected(layout);
1066
+ cancelModal();
1067
+ };
1068
+
1069
+ return (
1070
+ <View style={styles.roleChangeModal}>
1071
+ <Text style={styles.roleChangeModalHeading}>Layout Style</Text>
1072
+ <CustomPicker
1073
+ data={data}
1074
+ selectedItem={layout}
1075
+ onItemSelected={setLayout}
1076
+ viewStyle={styles.picker}
1077
+ />
1078
+ <View style={styles.sortingButtonContainer}>
1079
+ <CustomButton
1080
+ title="Cancel"
1081
+ onPress={cancelModal}
1082
+ viewStyle={styles.roleChangeModalCancelButton}
1083
+ textStyle={styles.roleChangeModalButtonText}
1084
+ />
1085
+ <CustomButton
1086
+ title="Change"
1087
+ onPress={changeLayout}
1088
+ viewStyle={styles.roleChangeModalSuccessButton}
1089
+ textStyle={styles.roleChangeModalButtonText}
1090
+ />
1091
+ </View>
1092
+ </View>
1093
+ );
1094
+ };
1095
+
1096
+ export const ChangeTrackStateForRoleModal = ({
1097
+ cancelModal,
1098
+ }: {
1099
+ cancelModal: Function;
1100
+ }) => {
1101
+ const instance = useHMSInstance();
1102
+ const roles = useSelector((state: RootState) => state.hmsStates.roles);
1103
+ const localPeerRole = useSelector(
1104
+ (state: RootState) => state.hmsStates.localPeer?.role
1105
+ );
1106
+
1107
+ const [role, setRole] = useState<HMSRole>(localPeerRole!);
1108
+ const [visible, setVisible] = useState<boolean>(false);
1109
+ const [trackType, setTrackType] = useState<HMSTrackType>(HMSTrackType.VIDEO);
1110
+ const [trackState, setTrackState] = useState<boolean>(false);
1111
+
1112
+ const hideMenu = () => setVisible(false);
1113
+ const showMenu = () => setVisible(true);
1114
+ const changeTrackState = async () => {
1115
+ const source = HMSTrackSource.REGULAR;
1116
+ await instance
1117
+ ?.changeTrackStateForRoles(trackState, trackType, source, [role])
1118
+ .then((d) => console.log('Change Track State For Role Success: ', d))
1119
+ .catch((e) => console.log('Change Track State For Role Error: ', e));
1120
+ cancelModal();
1121
+ };
1122
+
1123
+ return (
1124
+ <View style={styles.roleChangeModal}>
1125
+ <Text style={styles.roleChangeModalHeading}>
1126
+ Change Track State For Role
1127
+ </Text>
1128
+ <Menu
1129
+ visible={visible}
1130
+ anchor={
1131
+ <TouchableOpacity
1132
+ style={styles.participantChangeRoleContainer}
1133
+ onPress={showMenu}
1134
+ >
1135
+ <Text style={styles.participantFilterText} numberOfLines={1}>
1136
+ {role?.name}
1137
+ </Text>
1138
+ <MaterialIcons
1139
+ name={visible ? 'arrow-drop-up' : 'arrow-drop-down'}
1140
+ style={styles.participantFilterIcon}
1141
+ size={24}
1142
+ />
1143
+ </TouchableOpacity>
1144
+ }
1145
+ onRequestClose={hideMenu}
1146
+ style={styles.participantsMenuContainer}
1147
+ >
1148
+ {roles?.map((knownRole) => {
1149
+ return (
1150
+ <MenuItem
1151
+ onPress={() => {
1152
+ hideMenu();
1153
+ setRole(knownRole);
1154
+ }}
1155
+ key={knownRole.name}
1156
+ >
1157
+ <View style={styles.participantMenuItem}>
1158
+ <Text style={styles.participantMenuItemName}>
1159
+ {knownRole?.name}
1160
+ </Text>
1161
+ </View>
1162
+ </MenuItem>
1163
+ );
1164
+ })}
1165
+ </Menu>
1166
+ <View style={styles.roleChangeModalPermissionContainer}>
1167
+ <Text style={styles.changeTrackStateRoleOptionHeading}>
1168
+ {'Track State: '}
1169
+ </Text>
1170
+ {localPeerRole?.permissions?.mute && (
1171
+ <TouchableOpacity
1172
+ style={styles.changeTrackStateRoleOption}
1173
+ onPress={() => setTrackState(true)}
1174
+ >
1175
+ <View style={styles.roleChangeModalCheckBox}>
1176
+ {trackState && (
1177
+ <Entypo
1178
+ name="check"
1179
+ style={styles.roleChangeModalCheck}
1180
+ size={10}
1181
+ />
1182
+ )}
1183
+ </View>
1184
+ <Text style={styles.roleChangeModalPermission}>MUTE</Text>
1185
+ </TouchableOpacity>
1186
+ )}
1187
+ {localPeerRole?.permissions?.unmute && (
1188
+ <TouchableOpacity
1189
+ style={styles.changeTrackStateRoleOption}
1190
+ onPress={() => setTrackState(false)}
1191
+ >
1192
+ <View style={styles.roleChangeModalCheckBox}>
1193
+ {!trackState && (
1194
+ <Entypo
1195
+ name="check"
1196
+ style={styles.roleChangeModalCheck}
1197
+ size={10}
1198
+ />
1199
+ )}
1200
+ </View>
1201
+ <Text style={styles.roleChangeModalPermission}>UNMUTE</Text>
1202
+ </TouchableOpacity>
1203
+ )}
1204
+ </View>
1205
+ <View style={styles.roleChangeModalPermissionContainer}>
1206
+ <Text style={styles.changeTrackStateRoleOptionHeading}>
1207
+ {'Track Type: '}
1208
+ </Text>
1209
+ <TouchableOpacity
1210
+ style={styles.changeTrackStateRoleOption}
1211
+ onPress={() => setTrackType(HMSTrackType.AUDIO)}
1212
+ >
1213
+ <View style={styles.roleChangeModalCheckBox}>
1214
+ {trackType === HMSTrackType.AUDIO && (
1215
+ <Entypo
1216
+ name="check"
1217
+ style={styles.roleChangeModalCheck}
1218
+ size={10}
1219
+ />
1220
+ )}
1221
+ </View>
1222
+ <Text style={styles.roleChangeModalPermission}>
1223
+ {HMSTrackType.AUDIO}
1224
+ </Text>
1225
+ </TouchableOpacity>
1226
+ <TouchableOpacity
1227
+ style={styles.changeTrackStateRoleOption}
1228
+ onPress={() => setTrackType(HMSTrackType.VIDEO)}
1229
+ >
1230
+ <View style={styles.roleChangeModalCheckBox}>
1231
+ {trackType === HMSTrackType.VIDEO && (
1232
+ <Entypo
1233
+ name="check"
1234
+ style={styles.roleChangeModalCheck}
1235
+ size={10}
1236
+ />
1237
+ )}
1238
+ </View>
1239
+ <Text style={styles.roleChangeModalPermission}>
1240
+ {HMSTrackType.VIDEO}
1241
+ </Text>
1242
+ </TouchableOpacity>
1243
+ </View>
1244
+ <View style={styles.roleChangeModalPermissionContainer}>
1245
+ <CustomButton
1246
+ title="Cancel"
1247
+ onPress={cancelModal}
1248
+ viewStyle={styles.roleChangeModalCancelButton}
1249
+ textStyle={styles.roleChangeModalButtonText}
1250
+ />
1251
+ <CustomButton
1252
+ title="Change"
1253
+ onPress={changeTrackState}
1254
+ viewStyle={styles.roleChangeModalSuccessButton}
1255
+ textStyle={styles.roleChangeModalButtonText}
1256
+ />
1257
+ </View>
1258
+ </View>
1259
+ );
1260
+ };
1261
+
1262
+ export const ChangeTrackStateModal = ({
1263
+ roleChangeRequest,
1264
+ cancelModal,
1265
+ }: {
1266
+ roleChangeRequest: {
1267
+ requestedBy?: string;
1268
+ suggestedRole?: string;
1269
+ };
1270
+ cancelModal: Function;
1271
+ }) => {
1272
+ const localPeer = useSelector(
1273
+ (state: RootState) => state.hmsStates.localPeer
1274
+ );
1275
+
1276
+ const changeLayout = () => {
1277
+ if (roleChangeRequest?.suggestedRole?.toLocaleLowerCase() === 'video') {
1278
+ localPeer?.localVideoTrack()?.setMute(false);
1279
+ } else {
1280
+ localPeer?.localAudioTrack()?.setMute(false);
1281
+ }
1282
+ cancelModal();
1283
+ };
1284
+
1285
+ return (
1286
+ <View style={styles.roleChangeModal}>
1287
+ <Text style={styles.roleChangeModalHeading}>
1288
+ Change Track State Request
1289
+ </Text>
1290
+ <Text style={styles.roleChangeText}>
1291
+ {`${roleChangeRequest?.requestedBy?.toLocaleUpperCase()} requested to unmute your regular ${roleChangeRequest?.suggestedRole?.toLocaleUpperCase()}`}
1292
+ </Text>
1293
+ <View style={styles.sortingButtonContainer}>
1294
+ <CustomButton
1295
+ title="Reject"
1296
+ onPress={cancelModal}
1297
+ viewStyle={styles.roleChangeModalCancelButton}
1298
+ textStyle={styles.roleChangeModalButtonText}
1299
+ />
1300
+ <CustomButton
1301
+ title="Accept"
1302
+ onPress={changeLayout}
1303
+ viewStyle={styles.roleChangeModalSuccessButton}
1304
+ textStyle={styles.roleChangeModalButtonText}
1305
+ />
1306
+ </View>
1307
+ </View>
1308
+ );
1309
+ };
1310
+
1311
+ export const HlsStreamingModal = ({
1312
+ cancelModal,
1313
+ }: {
1314
+ cancelModal: Function;
1315
+ }) => {
1316
+ const instance = useHMSInstance();
1317
+ const roomID = useSelector((state: RootState) => state.user.roomID);
1318
+ const [hlsStreamingDetails, setHLSStreamingDetails] =
1319
+ useState<HMSHLSMeetingURLVariant>({
1320
+ meetingUrl: roomID ? roomID + '?skip_preview=true' : '',
1321
+ metadata: '',
1322
+ });
1323
+ const [startHlsRetry, setStartHlsRetry] = useState(true);
1324
+ const [hlsRecordingDetails, setHLSRecordingDetails] =
1325
+ useState<HMSHLSRecordingConfig>({
1326
+ singleFilePerLayer: false,
1327
+ videoOnDemand: false,
1328
+ });
1329
+
1330
+ const changeLayout = () => {
1331
+ instance
1332
+ ?.startHLSStreaming()
1333
+ .then((d) => console.log('Start HLS Streaming Success: ', d))
1334
+ .catch((err) => {
1335
+ if (startHlsRetry) {
1336
+ setStartHlsRetry(false);
1337
+ const hmsHLSConfig = new HMSHLSConfig({
1338
+ hlsRecordingConfig: hlsRecordingDetails,
1339
+ meetingURLVariants: [hlsStreamingDetails],
1340
+ });
1341
+ instance
1342
+ ?.startHLSStreaming(hmsHLSConfig)
1343
+ .then((d) => console.log('Start HLS Streaming Success: ', d))
1344
+ .catch((e) => console.log('Start HLS Streaming Error: ', e));
1345
+ } else {
1346
+ console.log('Start HLS Streaming Error: ', err);
1347
+ }
1348
+ });
1349
+ cancelModal();
1350
+ };
1351
+
1352
+ return (
1353
+ <View style={styles.roleChangeModal}>
1354
+ <Text style={styles.roleChangeModalHeading}>HLS Streaming Details</Text>
1355
+ <TextInput
1356
+ onChangeText={(value) => {
1357
+ setHLSStreamingDetails({ ...hlsStreamingDetails, meetingUrl: value });
1358
+ }}
1359
+ placeholderTextColor={COLORS.SECONDARY.DEFAULT}
1360
+ placeholder="Enter meeting url"
1361
+ style={styles.input}
1362
+ defaultValue={hlsStreamingDetails.meetingUrl}
1363
+ returnKeyType="done"
1364
+ multiline
1365
+ blurOnSubmit
1366
+ />
1367
+ <TouchableOpacity
1368
+ style={styles.checkboxButtonContainer}
1369
+ onPress={() => {
1370
+ setHLSRecordingDetails({
1371
+ ...hlsRecordingDetails,
1372
+ singleFilePerLayer: !hlsRecordingDetails.singleFilePerLayer,
1373
+ });
1374
+ }}
1375
+ >
1376
+ <View style={styles.roleChangeModalCheckBox}>
1377
+ {hlsRecordingDetails.singleFilePerLayer && (
1378
+ <Entypo
1379
+ name="check"
1380
+ style={styles.roleChangeModalCheck}
1381
+ size={10}
1382
+ />
1383
+ )}
1384
+ </View>
1385
+ <Text style={styles.roleChangeModalPermission}>SingleFilePerLayer</Text>
1386
+ </TouchableOpacity>
1387
+ <TouchableOpacity
1388
+ style={styles.checkboxButtonContainer}
1389
+ onPress={() => {
1390
+ setHLSRecordingDetails({
1391
+ ...hlsRecordingDetails,
1392
+ videoOnDemand: !hlsRecordingDetails.videoOnDemand,
1393
+ });
1394
+ }}
1395
+ >
1396
+ <View style={styles.roleChangeModalCheckBox}>
1397
+ {hlsRecordingDetails.videoOnDemand && (
1398
+ <Entypo
1399
+ name="check"
1400
+ style={styles.roleChangeModalCheck}
1401
+ size={10}
1402
+ />
1403
+ )}
1404
+ </View>
1405
+ <Text style={styles.roleChangeModalPermission}>VideoOnDemand</Text>
1406
+ </TouchableOpacity>
1407
+ <View style={styles.roleChangeModalPermissionContainer}>
1408
+ <CustomButton
1409
+ title="Cancel"
1410
+ onPress={cancelModal}
1411
+ viewStyle={styles.roleChangeModalCancelButton}
1412
+ textStyle={styles.roleChangeModalButtonText}
1413
+ />
1414
+ <CustomButton
1415
+ title="Start"
1416
+ onPress={changeLayout}
1417
+ viewStyle={styles.roleChangeModalSuccessButton}
1418
+ textStyle={styles.roleChangeModalButtonText}
1419
+ />
1420
+ </View>
1421
+ </View>
1422
+ );
1423
+ };
1424
+
1425
+ export const RecordingModal = ({
1426
+ recordingModal,
1427
+ setModalVisible,
1428
+ }: {
1429
+ recordingModal: boolean;
1430
+ setModalVisible(modalType: ModalTypes, delay?: any): void;
1431
+ }) => {
1432
+ const instance = useHMSInstance();
1433
+ const roomID = useSelector((state: RootState) => state.user.roomID);
1434
+ const [resolutionDetails, setResolutionDetails] = useState<boolean>(false);
1435
+ const [recordingDetails, setRecordingDetails] = useState<HMSRTMPConfig>({
1436
+ record: false,
1437
+ meetingURL: roomID ? roomID + '?token=beam_recording' : undefined,
1438
+ });
1439
+
1440
+ const changeLayout = () => {
1441
+ instance
1442
+ ?.startRTMPOrRecording(recordingDetails)
1443
+ .then((d) => console.log('Start RTMP Or Recording Success: ', d))
1444
+ .catch((e) => console.log('Start RTMP Or Recording Error: ', e));
1445
+ setModalVisible(ModalTypes.DEFAULT);
1446
+ };
1447
+
1448
+ return recordingModal ? (
1449
+ <View style={styles.roleChangeModal}>
1450
+ <Text style={styles.roleChangeModalHeading}>Recording Details</Text>
1451
+ <TextInput
1452
+ onChangeText={(value) => {
1453
+ setRecordingDetails({ ...recordingDetails, meetingURL: value });
1454
+ }}
1455
+ placeholderTextColor={COLORS.SECONDARY.DEFAULT}
1456
+ placeholder="Enter meeting url"
1457
+ style={styles.input}
1458
+ defaultValue={recordingDetails.meetingURL || ''}
1459
+ returnKeyType="done"
1460
+ multiline
1461
+ blurOnSubmit
1462
+ />
1463
+ <TextInput
1464
+ onChangeText={(value) => {
1465
+ if (value === '') {
1466
+ setRecordingDetails({ ...recordingDetails, rtmpURLs: undefined });
1467
+ } else {
1468
+ setRecordingDetails({ ...recordingDetails, rtmpURLs: [value] });
1469
+ }
1470
+ }}
1471
+ placeholderTextColor={COLORS.SECONDARY.DEFAULT}
1472
+ placeholder="Enter rtmp url"
1473
+ style={styles.input}
1474
+ defaultValue={
1475
+ recordingDetails.rtmpURLs ? recordingDetails.rtmpURLs[0] : ''
1476
+ }
1477
+ returnKeyType="done"
1478
+ multiline
1479
+ blurOnSubmit
1480
+ />
1481
+ <TouchableOpacity
1482
+ style={styles.checkboxButtonContainer}
1483
+ onPress={() => {
1484
+ setRecordingDetails({
1485
+ ...recordingDetails,
1486
+ record: !recordingDetails.record,
1487
+ });
1488
+ }}
1489
+ >
1490
+ <View style={styles.roleChangeModalCheckBox}>
1491
+ {recordingDetails.record && (
1492
+ <Entypo
1493
+ name="check"
1494
+ style={styles.roleChangeModalCheck}
1495
+ size={10}
1496
+ />
1497
+ )}
1498
+ </View>
1499
+ <Text style={styles.roleChangeModalPermission}>Record</Text>
1500
+ </TouchableOpacity>
1501
+ <TouchableOpacity
1502
+ style={styles.checkboxButtonContainer}
1503
+ onPress={() => {
1504
+ setResolutionDetails(!resolutionDetails);
1505
+ if (!resolutionDetails) {
1506
+ setModalVisible(ModalTypes.RESOLUTION, true);
1507
+ setRecordingDetails({
1508
+ ...recordingDetails,
1509
+ resolution: {
1510
+ height: 720,
1511
+ width: 1280,
1512
+ },
1513
+ });
1514
+ } else {
1515
+ setRecordingDetails({
1516
+ ...recordingDetails,
1517
+ resolution: undefined,
1518
+ });
1519
+ }
1520
+ }}
1521
+ >
1522
+ <View style={styles.roleChangeModalCheckBox}>
1523
+ {resolutionDetails && (
1524
+ <Entypo
1525
+ name="check"
1526
+ style={styles.roleChangeModalCheck}
1527
+ size={10}
1528
+ />
1529
+ )}
1530
+ </View>
1531
+ <Text style={styles.roleChangeModalPermission}>Resolution</Text>
1532
+ </TouchableOpacity>
1533
+ <View style={styles.roleChangeModalPermissionContainer}>
1534
+ <CustomButton
1535
+ title="Cancel"
1536
+ onPress={() => setModalVisible(ModalTypes.DEFAULT)}
1537
+ viewStyle={styles.roleChangeModalCancelButton}
1538
+ textStyle={styles.roleChangeModalButtonText}
1539
+ />
1540
+ <CustomButton
1541
+ title="Start"
1542
+ onPress={changeLayout}
1543
+ viewStyle={styles.roleChangeModalSuccessButton}
1544
+ textStyle={styles.roleChangeModalButtonText}
1545
+ />
1546
+ </View>
1547
+ </View>
1548
+ ) : (
1549
+ <View style={styles.roleChangeModal}>
1550
+ <Text style={styles.roleChangeModalHeading}>Resolution Details</Text>
1551
+ <View style={styles.resolutionContainer}>
1552
+ <View style={styles.resolutionDetails}>
1553
+ <Text style={styles.interRegular}>Height :</Text>
1554
+ <Text style={styles.resolutionValue}>
1555
+ {recordingDetails.resolution?.height}
1556
+ </Text>
1557
+ </View>
1558
+ <Slider
1559
+ value={recordingDetails.resolution?.height}
1560
+ maximumValue={1280}
1561
+ minimumValue={480}
1562
+ step={10}
1563
+ onValueChange={(value: any) => {
1564
+ setRecordingDetails({
1565
+ ...recordingDetails,
1566
+ resolution: {
1567
+ height: parseInt(value),
1568
+ width: recordingDetails.resolution?.width ?? 1280,
1569
+ },
1570
+ });
1571
+ }}
1572
+ />
1573
+ <View style={styles.resolutionDetails}>
1574
+ <Text style={styles.interRegular}>Width :</Text>
1575
+ <Text style={styles.resolutionValue}>
1576
+ {recordingDetails.resolution?.width}
1577
+ </Text>
1578
+ </View>
1579
+ <Slider
1580
+ value={recordingDetails.resolution?.width}
1581
+ maximumValue={1280}
1582
+ minimumValue={500}
1583
+ step={10}
1584
+ onValueChange={(value: any) => {
1585
+ setRecordingDetails({
1586
+ ...recordingDetails,
1587
+ resolution: {
1588
+ width: parseInt(value),
1589
+ height: recordingDetails.resolution?.height ?? 720,
1590
+ },
1591
+ });
1592
+ }}
1593
+ />
1594
+ </View>
1595
+ <View style={styles.sortingButtonContainer}>
1596
+ <CustomButton
1597
+ title="Back"
1598
+ onPress={() => setModalVisible(ModalTypes.RECORDING, true)}
1599
+ viewStyle={styles.backButton}
1600
+ textStyle={styles.roleChangeModalButtonText}
1601
+ />
1602
+ </View>
1603
+ </View>
1604
+ );
1605
+ };
1606
+
1607
+ export const ChangeRoleAccepteModal = ({
1608
+ instance,
1609
+ roleChangeRequest,
1610
+ cancelModal,
1611
+ }: {
1612
+ instance?: HMSSDK;
1613
+ roleChangeRequest: {
1614
+ requestedBy?: string;
1615
+ suggestedRole?: string;
1616
+ };
1617
+ cancelModal: Function;
1618
+ }) => {
1619
+ const changeLayout = () => {
1620
+ instance?.acceptRoleChange();
1621
+ cancelModal();
1622
+ };
1623
+
1624
+ return (
1625
+ <View style={styles.roleChangeModal}>
1626
+ <Text style={styles.roleChangeModalHeading}>Role Change Details</Text>
1627
+ <Text style={styles.roleChangeText}>
1628
+ {`Role change requested by ${roleChangeRequest?.requestedBy?.toLocaleUpperCase()}. Changing role to ${roleChangeRequest?.suggestedRole?.toLocaleUpperCase()}`}
1629
+ </Text>
1630
+ <View style={styles.sortingButtonContainer}>
1631
+ <CustomButton
1632
+ title="Reject"
1633
+ onPress={cancelModal}
1634
+ viewStyle={styles.roleChangeModalCancelButton}
1635
+ textStyle={styles.roleChangeModalButtonText}
1636
+ />
1637
+ <CustomButton
1638
+ title="Accept"
1639
+ onPress={changeLayout}
1640
+ viewStyle={styles.roleChangeModalSuccessButton}
1641
+ textStyle={styles.roleChangeModalButtonText}
1642
+ />
1643
+ </View>
1644
+ </View>
1645
+ );
1646
+ };
1647
+
1648
+ export const EndHlsModal = ({
1649
+ onSuccess,
1650
+ cancelModal,
1651
+ }: {
1652
+ onSuccess: Function;
1653
+ cancelModal: Function;
1654
+ }) => {
1655
+ const onEnd = () => {
1656
+ cancelModal();
1657
+ onSuccess();
1658
+ };
1659
+ return (
1660
+ <View style={styles.volumeModalContainer}>
1661
+ <View style={styles.participantMenuItem}>
1662
+ <Feather
1663
+ name="alert-triangle"
1664
+ style={[styles.participantMenuItemIcon, styles.error]}
1665
+ size={24}
1666
+ />
1667
+ <Text style={[styles.roleChangeModalHeading, styles.error]}>
1668
+ End live stream for all?
1669
+ </Text>
1670
+ </View>
1671
+ <View style={styles.roleChangeModalPermissionContainer}>
1672
+ <Text style={styles.roleChangeModalDescription}>
1673
+ Your stream will end and everone will go offline immediately in this
1674
+ room. You can’t undo this action.
1675
+ </Text>
1676
+ </View>
1677
+ <View style={styles.roleChangeModalPermissionContainer}>
1678
+ <CustomButton
1679
+ title="Don’t End"
1680
+ onPress={cancelModal}
1681
+ viewStyle={styles.roleChangeModalCancelButton}
1682
+ textStyle={styles.roleChangeModalButtonText}
1683
+ />
1684
+ <CustomButton
1685
+ title="End Stream"
1686
+ onPress={onEnd}
1687
+ viewStyle={[
1688
+ styles.roleChangeModalSuccessButton,
1689
+ styles.errorContainer,
1690
+ ]}
1691
+ textStyle={styles.roleChangeModalButtonText}
1692
+ />
1693
+ </View>
1694
+ </View>
1695
+ );
1696
+ };
1697
+
1698
+ export const RealTime = ({ startedAt }: { startedAt?: Date }) => {
1699
+ const [hour, setHour] = useState(0);
1700
+ const [minute, setMinute] = useState(0);
1701
+ const [second, setSecond] = useState(0);
1702
+
1703
+ useEffect(() => {
1704
+ if (startedAt) {
1705
+ const millisecs = Date.now() - startedAt.getTime();
1706
+ const [h, min, sec] = getTime(Math.abs(millisecs));
1707
+ if (h > 0) {
1708
+ setHour(h);
1709
+ }
1710
+ if (min > 0) {
1711
+ setMinute(min);
1712
+ }
1713
+ if (sec > 0) {
1714
+ setSecond(sec);
1715
+ }
1716
+ }
1717
+ }, [startedAt]);
1718
+
1719
+ useEffect(() => {
1720
+ const updatePostInfo = setInterval(() => {
1721
+ setSecond((sec) => sec + 1);
1722
+ }, 1000);
1723
+
1724
+ return () => {
1725
+ clearInterval(updatePostInfo);
1726
+ };
1727
+ }, []);
1728
+
1729
+ useEffect(() => {
1730
+ if (second === 60) {
1731
+ setSecond(0);
1732
+ setMinute((min) => min + 1);
1733
+ }
1734
+ }, [second]);
1735
+
1736
+ useEffect(() => {
1737
+ if (minute === 60) {
1738
+ setMinute(0);
1739
+ setHour((hr) => hr + 1);
1740
+ }
1741
+ }, [minute]);
1742
+
1743
+ return (
1744
+ <View style={styles.liveTextContainer}>
1745
+ {hour > 0 && (
1746
+ <Text style={styles.liveTimeText}>
1747
+ {hour < 10 ? '0' + hour : hour}:
1748
+ </Text>
1749
+ )}
1750
+ <Text style={styles.liveTimeText}>
1751
+ {minute < 10 ? '0' + minute : minute}:
1752
+ </Text>
1753
+ <Text style={styles.liveTimeText}>
1754
+ {second < 10 ? '0' + second : second}
1755
+ </Text>
1756
+ </View>
1757
+ );
1758
+ };
1759
+
1760
+ export const AudioShareSetVolumeModal = ({
1761
+ success,
1762
+ cancel,
1763
+ }: {
1764
+ success: Function;
1765
+ cancel: Function;
1766
+ }) => {
1767
+ const [volume, setVolume] = useState<number>(0);
1768
+
1769
+ const changeVolume = () => {
1770
+ success(volume);
1771
+ cancel();
1772
+ };
1773
+
1774
+ return (
1775
+ <View style={styles.volumeModalContainer}>
1776
+ <Text style={styles.roleChangeModalHeading}>Set Volume</Text>
1777
+ <View style={styles.volumeModalSlider}>
1778
+ <Text style={styles.roleChangeModalDescription}>Volume: {volume}</Text>
1779
+ <Slider
1780
+ value={volume}
1781
+ maximumValue={1}
1782
+ minimumValue={0}
1783
+ step={0.1}
1784
+ onValueChange={(value: any) => setVolume(value[0])}
1785
+ />
1786
+ </View>
1787
+ <View style={styles.roleChangeModalPermissionContainer}>
1788
+ <CustomButton
1789
+ title="Cancel"
1790
+ onPress={cancel}
1791
+ viewStyle={styles.roleChangeModalCancelButton}
1792
+ textStyle={styles.roleChangeModalButtonText}
1793
+ />
1794
+ <CustomButton
1795
+ title="Change"
1796
+ onPress={changeVolume}
1797
+ viewStyle={styles.roleChangeModalSuccessButton}
1798
+ textStyle={styles.roleChangeModalButtonText}
1799
+ />
1800
+ </View>
1801
+ </View>
1802
+ );
1803
+ };
1804
+
1805
+ interface ChangeBulkRoleModalProps {
1806
+ cancelModal(): void;
1807
+ }
1808
+
1809
+ enum RoleSelection {
1810
+ TARGET = 'TARGET',
1811
+ TO_CHANGE = 'TO_CHANGE',
1812
+ }
1813
+
1814
+ export const ChangeBulkRoleModal: React.FC<ChangeBulkRoleModalProps> = ({
1815
+ cancelModal,
1816
+ }) => {
1817
+ const hmsInstance = useSelector((state: RootState) => state.user.hmsInstance);
1818
+ const roles = useSelector((state: RootState) => state.hmsStates.roles);
1819
+ const [showRolesSelectionView, setShowRolesSelectionView] =
1820
+ useState<null | RoleSelection>(null);
1821
+ const [targetRole, setTargetRole] = useState<HMSRole | null>(null);
1822
+ const [rolesToChange, setRolesToChange] = useState<HMSRole[]>([]);
1823
+
1824
+ const changeRole = async () => {
1825
+ if (!hmsInstance || !targetRole) {
1826
+ return;
1827
+ }
1828
+
1829
+ hmsInstance.changeRoleOfPeersWithRoles(
1830
+ rolesToChange.filter(
1831
+ (roleToChange) => roleToChange.name !== targetRole.name
1832
+ ),
1833
+ targetRole
1834
+ );
1835
+
1836
+ cancelModal();
1837
+ };
1838
+
1839
+ const handleRoleSelection = (roleSelected: HMSRole) => {
1840
+ if (showRolesSelectionView === RoleSelection.TARGET) {
1841
+ setTargetRole(roleSelected);
1842
+ } else {
1843
+ setRolesToChange((prevRolesToChange) => {
1844
+ if (
1845
+ prevRolesToChange.findIndex(
1846
+ (role) => role.name === roleSelected.name
1847
+ ) >= 0
1848
+ ) {
1849
+ return prevRolesToChange.filter(
1850
+ (role) => role.name !== roleSelected.name
1851
+ );
1852
+ }
1853
+
1854
+ return [...prevRolesToChange, roleSelected];
1855
+ });
1856
+ }
1857
+ };
1858
+
1859
+ // if targetRole is not available, OR
1860
+ // role or rolesToChange is not available. then "Change" button should be disabled
1861
+ const changeSubmitDisabled = !targetRole || rolesToChange.length === 0;
1862
+
1863
+ return (
1864
+ <View style={bulkRoleStyles.container}>
1865
+ <Text style={styles.roleChangeModalHeading}>Bulk Role Change</Text>
1866
+
1867
+ <View style={bulkRoleStyles.contentContainer}>
1868
+ <View style={bulkRoleStyles.row}>
1869
+ <Text style={bulkRoleStyles.label}>Select Roles to Change</Text>
1870
+
1871
+ <TouchableOpacity
1872
+ style={bulkRoleStyles.btn}
1873
+ onPress={() => setShowRolesSelectionView(RoleSelection.TO_CHANGE)}
1874
+ >
1875
+ <Text style={bulkRoleStyles.value} numberOfLines={1}>
1876
+ {rolesToChange.map((role) => role.name).join(', ') ||
1877
+ 'Select Roles'}
1878
+ </Text>
1879
+
1880
+ <MaterialCommunityIcons
1881
+ name="chevron-right"
1882
+ size={16}
1883
+ style={bulkRoleStyles.chevronIcon}
1884
+ />
1885
+ </TouchableOpacity>
1886
+ </View>
1887
+
1888
+ <View style={bulkRoleStyles.row}>
1889
+ <Text style={bulkRoleStyles.label}>Target Role</Text>
1890
+
1891
+ <TouchableOpacity
1892
+ style={bulkRoleStyles.btn}
1893
+ onPress={() => setShowRolesSelectionView(RoleSelection.TARGET)}
1894
+ >
1895
+ <Text style={bulkRoleStyles.value}>
1896
+ {targetRole ? targetRole.name : 'Select Role'}
1897
+ </Text>
1898
+
1899
+ <MaterialCommunityIcons
1900
+ name="chevron-right"
1901
+ size={16}
1902
+ style={bulkRoleStyles.chevronIcon}
1903
+ />
1904
+ </TouchableOpacity>
1905
+ </View>
1906
+ </View>
1907
+
1908
+ <View style={styles.roleChangeModalPermissionContainer}>
1909
+ <CustomButton
1910
+ title="Cancel"
1911
+ onPress={cancelModal}
1912
+ viewStyle={styles.roleChangeModalCancelButton}
1913
+ textStyle={styles.roleChangeModalButtonText}
1914
+ />
1915
+ <CustomButton
1916
+ disabled={changeSubmitDisabled}
1917
+ title="Change"
1918
+ onPress={changeRole}
1919
+ viewStyle={styles.roleChangeModalSuccessButton}
1920
+ textStyle={styles.roleChangeModalButtonText}
1921
+ />
1922
+ </View>
1923
+
1924
+ {showRolesSelectionView ? (
1925
+ <View style={bulkRoleStyles.roleSelectionBackdrop}>
1926
+ <View style={bulkRoleStyles.roleSelectionContainer}>
1927
+ <Text style={bulkRoleStyles.heading}>
1928
+ {showRolesSelectionView === RoleSelection.TARGET
1929
+ ? 'Select Target Role'
1930
+ : 'Select Role to Change'}
1931
+ </Text>
1932
+
1933
+ <ScrollView
1934
+ centerContent={true}
1935
+ contentContainerStyle={bulkRoleStyles.scrollContainer}
1936
+ >
1937
+ {roles.map((role) => {
1938
+ const selected =
1939
+ showRolesSelectionView === RoleSelection.TARGET
1940
+ ? role.name === targetRole?.name
1941
+ : rolesToChange.findIndex(
1942
+ (roleToChange) => roleToChange.name === role.name
1943
+ ) >= 0;
1944
+
1945
+ return (
1946
+ <TouchableOpacity
1947
+ key={role.name}
1948
+ style={bulkRoleStyles.roleBtn}
1949
+ onPress={() => handleRoleSelection(role)}
1950
+ >
1951
+ <View style={bulkRoleStyles.checkboxContainer}>
1952
+ {showRolesSelectionView === RoleSelection.TARGET ? (
1953
+ <MaterialCommunityIcons
1954
+ name={selected ? 'radiobox-marked' : 'radiobox-blank'}
1955
+ style={styles.roleChangeModalCheck}
1956
+ size={20}
1957
+ />
1958
+ ) : (
1959
+ <MaterialCommunityIcons
1960
+ name={
1961
+ selected
1962
+ ? 'checkbox-outline'
1963
+ : 'checkbox-blank-outline'
1964
+ }
1965
+ style={styles.roleChangeModalCheck}
1966
+ size={24}
1967
+ />
1968
+ )}
1969
+ </View>
1970
+
1971
+ <Text style={bulkRoleStyles.checkboxLabel}>
1972
+ {role.name}
1973
+ </Text>
1974
+ </TouchableOpacity>
1975
+ );
1976
+ })}
1977
+ </ScrollView>
1978
+
1979
+ <TouchableOpacity
1980
+ style={bulkRoleStyles.roleSelectionDone}
1981
+ onPress={() => setShowRolesSelectionView(null)}
1982
+ >
1983
+ <Text style={bulkRoleStyles.roleSelectionDoneText}>Done</Text>
1984
+ </TouchableOpacity>
1985
+ </View>
1986
+ </View>
1987
+ ) : null}
1988
+ </View>
1989
+ );
1990
+ };
1991
+
1992
+ const bulkRoleStyles = StyleSheet.create({
1993
+ container: {
1994
+ padding: 24,
1995
+ position: 'relative',
1996
+ height: 320,
1997
+ },
1998
+ contentContainer: {
1999
+ flex: 1,
2000
+ justifyContent: 'center',
2001
+ marginTop: 24,
2002
+ },
2003
+ row: {
2004
+ // flexGrow: 1,
2005
+ marginVertical: 20,
2006
+ flexDirection: 'row',
2007
+ alignItems: 'center',
2008
+ justifyContent: 'space-between',
2009
+ },
2010
+ label: {
2011
+ color: COLORS.TEXT.HIGH_EMPHASIS,
2012
+ },
2013
+ value: {
2014
+ flex: 1,
2015
+ color: COLORS.TEXT.MEDIUM_EMPHASIS,
2016
+ textAlign: 'right',
2017
+ },
2018
+ toggleContainer: {
2019
+ width: 160,
2020
+ borderRadius: 6,
2021
+ backgroundColor: COLORS.SECONDARY.DARK,
2022
+ flexDirection: 'row',
2023
+ paddingVertical: 2,
2024
+ paddingHorizontal: 2,
2025
+ },
2026
+ toggleItem: {
2027
+ flex: 1,
2028
+ alignItems: 'center',
2029
+ paddingVertical: 6,
2030
+ },
2031
+ toggleActiveItem: {
2032
+ flex: 1,
2033
+ alignItems: 'center',
2034
+ paddingVertical: 6,
2035
+ borderRadius: 4,
2036
+ backgroundColor: COLORS.SECONDARY.DEFAULT,
2037
+ },
2038
+ btn: {
2039
+ flex: 1,
2040
+ flexDirection: 'row',
2041
+ alignItems: 'center',
2042
+ justifyContent: 'flex-end',
2043
+ marginLeft: 4,
2044
+ },
2045
+ chevronIcon: {
2046
+ color: COLORS.TEXT.MEDIUM_EMPHASIS,
2047
+ },
2048
+ roleSelectionBackdrop: {
2049
+ position: 'absolute',
2050
+ top: 24,
2051
+ left: 24,
2052
+ width: '100%',
2053
+ height: '100%',
2054
+ shadowColor: COLORS.SURFACE.LIGHT,
2055
+ shadowOpacity: 0.5,
2056
+ shadowRadius: 24,
2057
+ padding: 8,
2058
+ },
2059
+ roleSelectionContainer: {
2060
+ flex: 1,
2061
+ padding: 12,
2062
+ backgroundColor: COLORS.SURFACE.LIGHT,
2063
+ borderRadius: 8,
2064
+ borderWidth: 0.5,
2065
+ borderColor: COLORS.BORDER.LIGHT,
2066
+ },
2067
+ heading: {
2068
+ fontSize: 16,
2069
+ lineHeight: 24,
2070
+ color: COLORS.TEXT.HIGH_EMPHASIS,
2071
+ marginVertical: 4,
2072
+ marginLeft: 4,
2073
+ },
2074
+ scrollContainer: {
2075
+ paddingHorizontal: 12,
2076
+ },
2077
+ checkboxContainer: {
2078
+ marginRight: 12,
2079
+ justifyContent: 'center',
2080
+ alignItems: 'center',
2081
+ },
2082
+ checkboxLabel: {
2083
+ color: COLORS.TEXT.MEDIUM_EMPHASIS,
2084
+ },
2085
+ roleBtn: {
2086
+ paddingVertical: 12,
2087
+ flexDirection: 'row',
2088
+ alignItems: 'center',
2089
+ },
2090
+ roleSelectionDone: {
2091
+ flexDirection: 'row',
2092
+ alignItems: 'center',
2093
+ justifyContent: 'center',
2094
+ marginTop: 4,
2095
+ paddingVertical: 6,
2096
+ },
2097
+ roleSelectionDoneText: {
2098
+ fontSize: 14,
2099
+ lineHeight: 22,
2100
+ fontFamily: 'Inter-Medium',
2101
+ color: COLORS.TEXT.HIGH_EMPHASIS,
2102
+ },
2103
+ });