@100mslive/react-native-room-kit 0.0.2 → 0.0.4

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 (413) hide show
  1. package/lib/commonjs/HMSInstanceSetup.js +1 -14
  2. package/lib/commonjs/HMSInstanceSetup.js.map +1 -1
  3. package/lib/commonjs/HMSPrebuilt.js +13 -4
  4. package/lib/commonjs/HMSPrebuilt.js.map +1 -1
  5. package/lib/commonjs/HMSRoomSetup.js +38 -14
  6. package/lib/commonjs/HMSRoomSetup.js.map +1 -1
  7. package/lib/commonjs/Icons/AnswerPhone/assets/answer-phone.png +0 -0
  8. package/lib/commonjs/Icons/AnswerPhone/assets/answer-phone@2x.png +0 -0
  9. package/lib/commonjs/Icons/AnswerPhone/assets/answer-phone@3x.png +0 -0
  10. package/lib/commonjs/Icons/AnswerPhone/index.js +30 -0
  11. package/lib/commonjs/Icons/AnswerPhone/index.js.map +1 -0
  12. package/lib/commonjs/Icons/Bluetooth/assets/bluetooth-on.png +0 -0
  13. package/lib/commonjs/Icons/Bluetooth/assets/bluetooth-on@2x.png +0 -0
  14. package/lib/commonjs/Icons/Bluetooth/assets/bluetooth-on@3x.png +0 -0
  15. package/lib/commonjs/Icons/Bluetooth/index.js +30 -0
  16. package/lib/commonjs/Icons/Bluetooth/index.js.map +1 -0
  17. package/lib/commonjs/Icons/Check/assets/check.png +0 -0
  18. package/lib/commonjs/Icons/Check/assets/check@2x.png +0 -0
  19. package/lib/commonjs/Icons/Check/assets/check@3x.png +0 -0
  20. package/lib/commonjs/Icons/Check/index.js +30 -0
  21. package/lib/commonjs/Icons/Check/index.js.map +1 -0
  22. package/lib/commonjs/Icons/GenericLogo/assets/generic-logo.png +0 -0
  23. package/lib/commonjs/Icons/GenericLogo/assets/generic-logo@2x.png +0 -0
  24. package/lib/commonjs/Icons/GenericLogo/assets/generic-logo@3x.png +0 -0
  25. package/lib/commonjs/Icons/GenericLogo/index.js +30 -0
  26. package/lib/commonjs/Icons/GenericLogo/index.js.map +1 -0
  27. package/lib/commonjs/Icons/Headphones/assets/headphones.png +0 -0
  28. package/lib/commonjs/Icons/Headphones/assets/headphones@2x.png +0 -0
  29. package/lib/commonjs/Icons/Headphones/assets/headphones@3x.png +0 -0
  30. package/lib/commonjs/Icons/Headphones/index.js +30 -0
  31. package/lib/commonjs/Icons/Headphones/index.js.map +1 -0
  32. package/lib/commonjs/Icons/Person/assets/person.png +0 -0
  33. package/lib/commonjs/Icons/Person/assets/person@2x.png +0 -0
  34. package/lib/commonjs/Icons/Person/assets/person@3x.png +0 -0
  35. package/lib/commonjs/Icons/Person/index.js +30 -0
  36. package/lib/commonjs/Icons/Person/index.js.map +1 -0
  37. package/lib/commonjs/Icons/Radio/assets/radio.png +0 -0
  38. package/lib/commonjs/Icons/Radio/assets/radio@2x.png +0 -0
  39. package/lib/commonjs/Icons/Radio/assets/radio@3x.png +0 -0
  40. package/lib/commonjs/Icons/Radio/index.js +30 -0
  41. package/lib/commonjs/Icons/Radio/index.js.map +1 -0
  42. package/lib/commonjs/Icons/Speaker/assets/speaker-large.png +0 -0
  43. package/lib/commonjs/Icons/Speaker/assets/speaker-large@2x.png +0 -0
  44. package/lib/commonjs/Icons/Speaker/assets/speaker-large@3x.png +0 -0
  45. package/lib/commonjs/Icons/Speaker/index.js +7 -2
  46. package/lib/commonjs/Icons/Speaker/index.js.map +1 -1
  47. package/lib/commonjs/Icons/Wave/assets/wave.png +0 -0
  48. package/lib/commonjs/Icons/Wave/assets/wave@2x.png +0 -0
  49. package/lib/commonjs/Icons/Wave/assets/wave@3x.png +0 -0
  50. package/lib/commonjs/Icons/Wave/index.js +30 -0
  51. package/lib/commonjs/Icons/Wave/index.js.map +1 -0
  52. package/lib/commonjs/Icons/index.js +88 -0
  53. package/lib/commonjs/Icons/index.js.map +1 -1
  54. package/lib/commonjs/components/BackButton.js +3 -3
  55. package/lib/commonjs/components/BackButton.js.map +1 -1
  56. package/lib/commonjs/components/DisplayView.js +0 -6
  57. package/lib/commonjs/components/DisplayView.js.map +1 -1
  58. package/lib/commonjs/components/HMSHLSStreamLoading.js +56 -0
  59. package/lib/commonjs/components/HMSHLSStreamLoading.js.map +1 -0
  60. package/lib/commonjs/components/HMSLocalVideoView.js +41 -0
  61. package/lib/commonjs/components/HMSLocalVideoView.js.map +1 -0
  62. package/lib/commonjs/components/{HMSPreviewDeviceSettings.js → HMSManageAudioOutput.js} +97 -161
  63. package/lib/commonjs/components/HMSManageAudioOutput.js.map +1 -0
  64. package/lib/commonjs/components/HMSManageLeave.js +7 -60
  65. package/lib/commonjs/components/HMSManageLeave.js.map +1 -1
  66. package/lib/commonjs/components/HMSMeetingEnded.js +36 -0
  67. package/lib/commonjs/components/HMSMeetingEnded.js.map +1 -0
  68. package/lib/commonjs/components/HMSPreviewEditName.js +7 -4
  69. package/lib/commonjs/components/HMSPreviewEditName.js.map +1 -1
  70. package/lib/commonjs/components/HMSPreviewHLSLiveIndicator.js +64 -0
  71. package/lib/commonjs/components/HMSPreviewHLSLiveIndicator.js.map +1 -0
  72. package/lib/commonjs/components/HMSPreviewJoinButton.js +25 -6
  73. package/lib/commonjs/components/HMSPreviewJoinButton.js.map +1 -1
  74. package/lib/commonjs/components/HMSPreviewNetworkQuality.js +43 -0
  75. package/lib/commonjs/components/HMSPreviewNetworkQuality.js.map +1 -0
  76. package/lib/commonjs/components/HMSPreviewPeersList.js +4 -50
  77. package/lib/commonjs/components/HMSPreviewPeersList.js.map +1 -1
  78. package/lib/commonjs/components/HMSPreviewSubtitle.js +26 -3
  79. package/lib/commonjs/components/HMSPreviewSubtitle.js.map +1 -1
  80. package/lib/commonjs/components/HMSPreviewTile.js +11 -77
  81. package/lib/commonjs/components/HMSPreviewTile.js.map +1 -1
  82. package/lib/commonjs/components/HMSPreviewTitle.js +0 -1
  83. package/lib/commonjs/components/HMSPreviewTitle.js.map +1 -1
  84. package/lib/commonjs/components/HMSRoomOptions.js +2 -3
  85. package/lib/commonjs/components/HMSRoomOptions.js.map +1 -1
  86. package/lib/commonjs/components/HMSShowNetworkQuality.js +0 -2
  87. package/lib/commonjs/components/HMSShowNetworkQuality.js.map +1 -1
  88. package/lib/commonjs/components/Meeting.js +7 -0
  89. package/lib/commonjs/components/Meeting.js.map +1 -1
  90. package/lib/commonjs/components/MenuModal/Menu.js +1 -2
  91. package/lib/commonjs/components/MenuModal/Menu.js.map +1 -1
  92. package/lib/commonjs/components/Modals.js +39 -299
  93. package/lib/commonjs/components/Modals.js.map +1 -1
  94. package/lib/commonjs/components/Participants/ParticipantsList.js +1 -20
  95. package/lib/commonjs/components/Participants/ParticipantsList.js.map +1 -1
  96. package/lib/commonjs/components/PeerSettingsModalContent.js +2 -13
  97. package/lib/commonjs/components/PeerSettingsModalContent.js.map +1 -1
  98. package/lib/commonjs/components/Preview.js +87 -28
  99. package/lib/commonjs/components/Preview.js.map +1 -1
  100. package/lib/commonjs/components/RoomSettingsModalContent.js +2 -101
  101. package/lib/commonjs/components/RoomSettingsModalContent.js.map +1 -1
  102. package/lib/commonjs/components/index.js +0 -11
  103. package/lib/commonjs/components/index.js.map +1 -1
  104. package/lib/commonjs/hooks/useHmsInstance.js +0 -1
  105. package/lib/commonjs/hooks/useHmsInstance.js.map +1 -1
  106. package/lib/commonjs/hooks-util-selectors.js +8 -1
  107. package/lib/commonjs/hooks-util-selectors.js.map +1 -1
  108. package/lib/commonjs/hooks-util.js +140 -82
  109. package/lib/commonjs/hooks-util.js.map +1 -1
  110. package/lib/commonjs/redux/actionTypes.js +7 -1
  111. package/lib/commonjs/redux/actionTypes.js.map +1 -1
  112. package/lib/commonjs/redux/actions/index.js +25 -1
  113. package/lib/commonjs/redux/actions/index.js.map +1 -1
  114. package/lib/commonjs/redux/reducers/appState.js +14 -1
  115. package/lib/commonjs/redux/reducers/appState.js.map +1 -1
  116. package/lib/commonjs/redux/reducers/hmsStates.js +12 -1
  117. package/lib/commonjs/redux/reducers/hmsStates.js.map +1 -1
  118. package/lib/commonjs/utils/theme.js +6 -1
  119. package/lib/commonjs/utils/theme.js.map +1 -1
  120. package/lib/commonjs/utils/types.js +0 -1
  121. package/lib/commonjs/utils/types.js.map +1 -1
  122. package/lib/commonjs/utils.js +2 -2
  123. package/lib/commonjs/utils.js.map +1 -1
  124. package/lib/module/HMSInstanceSetup.js +1 -14
  125. package/lib/module/HMSInstanceSetup.js.map +1 -1
  126. package/lib/module/HMSPrebuilt.js +13 -3
  127. package/lib/module/HMSPrebuilt.js.map +1 -1
  128. package/lib/module/HMSRoomSetup.js +43 -19
  129. package/lib/module/HMSRoomSetup.js.map +1 -1
  130. package/lib/module/Icons/AnswerPhone/assets/answer-phone.png +0 -0
  131. package/lib/module/Icons/AnswerPhone/assets/answer-phone@2x.png +0 -0
  132. package/lib/module/Icons/AnswerPhone/assets/answer-phone@3x.png +0 -0
  133. package/lib/module/Icons/AnswerPhone/index.js +22 -0
  134. package/lib/module/Icons/AnswerPhone/index.js.map +1 -0
  135. package/lib/module/Icons/Bluetooth/assets/bluetooth-on.png +0 -0
  136. package/lib/module/Icons/Bluetooth/assets/bluetooth-on@2x.png +0 -0
  137. package/lib/module/Icons/Bluetooth/assets/bluetooth-on@3x.png +0 -0
  138. package/lib/module/Icons/Bluetooth/index.js +22 -0
  139. package/lib/module/Icons/Bluetooth/index.js.map +1 -0
  140. package/lib/module/Icons/Check/assets/check.png +0 -0
  141. package/lib/module/Icons/Check/assets/check@2x.png +0 -0
  142. package/lib/module/Icons/Check/assets/check@3x.png +0 -0
  143. package/lib/module/Icons/Check/index.js +22 -0
  144. package/lib/module/Icons/Check/index.js.map +1 -0
  145. package/lib/module/Icons/GenericLogo/assets/generic-logo.png +0 -0
  146. package/lib/module/Icons/GenericLogo/assets/generic-logo@2x.png +0 -0
  147. package/lib/module/Icons/GenericLogo/assets/generic-logo@3x.png +0 -0
  148. package/lib/module/Icons/GenericLogo/index.js +22 -0
  149. package/lib/module/Icons/GenericLogo/index.js.map +1 -0
  150. package/lib/module/Icons/Headphones/assets/headphones.png +0 -0
  151. package/lib/module/Icons/Headphones/assets/headphones@2x.png +0 -0
  152. package/lib/module/Icons/Headphones/assets/headphones@3x.png +0 -0
  153. package/lib/module/Icons/Headphones/index.js +22 -0
  154. package/lib/module/Icons/Headphones/index.js.map +1 -0
  155. package/lib/module/Icons/Person/assets/person.png +0 -0
  156. package/lib/module/Icons/Person/assets/person@2x.png +0 -0
  157. package/lib/module/Icons/Person/assets/person@3x.png +0 -0
  158. package/lib/module/Icons/Person/index.js +22 -0
  159. package/lib/module/Icons/Person/index.js.map +1 -0
  160. package/lib/module/Icons/Radio/assets/radio.png +0 -0
  161. package/lib/module/Icons/Radio/assets/radio@2x.png +0 -0
  162. package/lib/module/Icons/Radio/assets/radio@3x.png +0 -0
  163. package/lib/module/Icons/Radio/index.js +22 -0
  164. package/lib/module/Icons/Radio/index.js.map +1 -0
  165. package/lib/module/Icons/Speaker/assets/speaker-large.png +0 -0
  166. package/lib/module/Icons/Speaker/assets/speaker-large@2x.png +0 -0
  167. package/lib/module/Icons/Speaker/assets/speaker-large@3x.png +0 -0
  168. package/lib/module/Icons/Speaker/index.js +7 -2
  169. package/lib/module/Icons/Speaker/index.js.map +1 -1
  170. package/lib/module/Icons/Wave/assets/wave.png +0 -0
  171. package/lib/module/Icons/Wave/assets/wave@2x.png +0 -0
  172. package/lib/module/Icons/Wave/assets/wave@3x.png +0 -0
  173. package/lib/module/Icons/Wave/index.js +22 -0
  174. package/lib/module/Icons/Wave/index.js.map +1 -0
  175. package/lib/module/Icons/index.js +8 -0
  176. package/lib/module/Icons/index.js.map +1 -1
  177. package/lib/module/components/BackButton.js +4 -4
  178. package/lib/module/components/BackButton.js.map +1 -1
  179. package/lib/module/components/DisplayView.js +1 -7
  180. package/lib/module/components/DisplayView.js.map +1 -1
  181. package/lib/module/components/HMSHLSStreamLoading.js +47 -0
  182. package/lib/module/components/HMSHLSStreamLoading.js.map +1 -0
  183. package/lib/module/components/HMSLocalVideoView.js +32 -0
  184. package/lib/module/components/HMSLocalVideoView.js.map +1 -0
  185. package/lib/module/components/HMSManageAudioOutput.js +232 -0
  186. package/lib/module/components/HMSManageAudioOutput.js.map +1 -0
  187. package/lib/module/components/HMSManageLeave.js +9 -62
  188. package/lib/module/components/HMSManageLeave.js.map +1 -1
  189. package/lib/module/components/HMSMeetingEnded.js +27 -0
  190. package/lib/module/components/HMSMeetingEnded.js.map +1 -0
  191. package/lib/module/components/HMSPreviewEditName.js +8 -5
  192. package/lib/module/components/HMSPreviewEditName.js.map +1 -1
  193. package/lib/module/components/HMSPreviewHLSLiveIndicator.js +55 -0
  194. package/lib/module/components/HMSPreviewHLSLiveIndicator.js.map +1 -0
  195. package/lib/module/components/HMSPreviewJoinButton.js +25 -6
  196. package/lib/module/components/HMSPreviewJoinButton.js.map +1 -1
  197. package/lib/module/components/HMSPreviewNetworkQuality.js +34 -0
  198. package/lib/module/components/HMSPreviewNetworkQuality.js.map +1 -0
  199. package/lib/module/components/HMSPreviewPeersList.js +4 -50
  200. package/lib/module/components/HMSPreviewPeersList.js.map +1 -1
  201. package/lib/module/components/HMSPreviewSubtitle.js +26 -3
  202. package/lib/module/components/HMSPreviewSubtitle.js.map +1 -1
  203. package/lib/module/components/HMSPreviewTile.js +12 -78
  204. package/lib/module/components/HMSPreviewTile.js.map +1 -1
  205. package/lib/module/components/HMSPreviewTitle.js +0 -1
  206. package/lib/module/components/HMSPreviewTitle.js.map +1 -1
  207. package/lib/module/components/HMSRoomOptions.js +2 -3
  208. package/lib/module/components/HMSRoomOptions.js.map +1 -1
  209. package/lib/module/components/HMSShowNetworkQuality.js +0 -2
  210. package/lib/module/components/HMSShowNetworkQuality.js.map +1 -1
  211. package/lib/module/components/Meeting.js +7 -0
  212. package/lib/module/components/Meeting.js.map +1 -1
  213. package/lib/module/components/MenuModal/Menu.js +1 -2
  214. package/lib/module/components/MenuModal/Menu.js.map +1 -1
  215. package/lib/module/components/Modals.js +40 -298
  216. package/lib/module/components/Modals.js.map +1 -1
  217. package/lib/module/components/Participants/ParticipantsList.js +1 -20
  218. package/lib/module/components/Participants/ParticipantsList.js.map +1 -1
  219. package/lib/module/components/PeerSettingsModalContent.js +2 -13
  220. package/lib/module/components/PeerSettingsModalContent.js.map +1 -1
  221. package/lib/module/components/Preview.js +88 -30
  222. package/lib/module/components/Preview.js.map +1 -1
  223. package/lib/module/components/RoomSettingsModalContent.js +3 -100
  224. package/lib/module/components/RoomSettingsModalContent.js.map +1 -1
  225. package/lib/module/components/index.js +0 -1
  226. package/lib/module/components/index.js.map +1 -1
  227. package/lib/module/hooks/useHmsInstance.js +0 -1
  228. package/lib/module/hooks/useHmsInstance.js.map +1 -1
  229. package/lib/module/hooks-util-selectors.js +6 -0
  230. package/lib/module/hooks-util-selectors.js.map +1 -1
  231. package/lib/module/hooks-util.js +142 -86
  232. package/lib/module/hooks-util.js.map +1 -1
  233. package/lib/module/redux/actionTypes.js +7 -1
  234. package/lib/module/redux/actionTypes.js.map +1 -1
  235. package/lib/module/redux/actions/index.js +20 -0
  236. package/lib/module/redux/actions/index.js.map +1 -1
  237. package/lib/module/redux/reducers/appState.js +14 -1
  238. package/lib/module/redux/reducers/appState.js.map +1 -1
  239. package/lib/module/redux/reducers/hmsStates.js +12 -1
  240. package/lib/module/redux/reducers/hmsStates.js.map +1 -1
  241. package/lib/module/utils/theme.js +6 -1
  242. package/lib/module/utils/theme.js.map +1 -1
  243. package/lib/module/utils/types.js +0 -1
  244. package/lib/module/utils/types.js.map +1 -1
  245. package/lib/module/utils.js +2 -2
  246. package/lib/module/utils.js.map +1 -1
  247. package/lib/typescript/HMSInstanceSetup.d.ts.map +1 -1
  248. package/lib/typescript/HMSPrebuilt.d.ts +2 -3
  249. package/lib/typescript/HMSPrebuilt.d.ts.map +1 -1
  250. package/lib/typescript/HMSRoomSetup.d.ts.map +1 -1
  251. package/lib/typescript/Icons/AnswerPhone/index.d.ts +7 -0
  252. package/lib/typescript/Icons/AnswerPhone/index.d.ts.map +1 -0
  253. package/lib/typescript/Icons/Bluetooth/index.d.ts +7 -0
  254. package/lib/typescript/Icons/Bluetooth/index.d.ts.map +1 -0
  255. package/lib/typescript/Icons/Check/index.d.ts +7 -0
  256. package/lib/typescript/Icons/Check/index.d.ts.map +1 -0
  257. package/lib/typescript/Icons/GenericLogo/index.d.ts +7 -0
  258. package/lib/typescript/Icons/GenericLogo/index.d.ts.map +1 -0
  259. package/lib/typescript/Icons/Headphones/index.d.ts +7 -0
  260. package/lib/typescript/Icons/Headphones/index.d.ts.map +1 -0
  261. package/lib/typescript/Icons/Person/index.d.ts +7 -0
  262. package/lib/typescript/Icons/Person/index.d.ts.map +1 -0
  263. package/lib/typescript/Icons/Radio/index.d.ts +7 -0
  264. package/lib/typescript/Icons/Radio/index.d.ts.map +1 -0
  265. package/lib/typescript/Icons/Speaker/index.d.ts +1 -0
  266. package/lib/typescript/Icons/Speaker/index.d.ts.map +1 -1
  267. package/lib/typescript/Icons/Wave/index.d.ts +7 -0
  268. package/lib/typescript/Icons/Wave/index.d.ts.map +1 -0
  269. package/lib/typescript/Icons/index.d.ts +8 -0
  270. package/lib/typescript/Icons/index.d.ts.map +1 -1
  271. package/lib/typescript/components/CustomInput.d.ts +1 -1
  272. package/lib/typescript/components/DisplayView.d.ts.map +1 -1
  273. package/lib/typescript/components/HMSHLSStreamLoading.d.ts +3 -0
  274. package/lib/typescript/components/HMSHLSStreamLoading.d.ts.map +1 -0
  275. package/lib/typescript/components/HMSLocalVideoView.d.ts +3 -0
  276. package/lib/typescript/components/HMSLocalVideoView.d.ts.map +1 -0
  277. package/lib/typescript/components/HMSManageAudioOutput.d.ts +3 -0
  278. package/lib/typescript/components/HMSManageAudioOutput.d.ts.map +1 -0
  279. package/lib/typescript/components/HMSManageLeave.d.ts.map +1 -1
  280. package/lib/typescript/components/HMSMeetingEnded.d.ts +3 -0
  281. package/lib/typescript/components/HMSMeetingEnded.d.ts.map +1 -0
  282. package/lib/typescript/components/HMSPreviewHLSLiveIndicator.d.ts +3 -0
  283. package/lib/typescript/components/HMSPreviewHLSLiveIndicator.d.ts.map +1 -0
  284. package/lib/typescript/components/HMSPreviewJoinButton.d.ts.map +1 -1
  285. package/lib/typescript/components/HMSPreviewNetworkQuality.d.ts +3 -0
  286. package/lib/typescript/components/HMSPreviewNetworkQuality.d.ts.map +1 -0
  287. package/lib/typescript/components/HMSPreviewPeersList.d.ts.map +1 -1
  288. package/lib/typescript/components/HMSPreviewSubtitle.d.ts.map +1 -1
  289. package/lib/typescript/components/HMSPreviewTile.d.ts.map +1 -1
  290. package/lib/typescript/components/HMSRoomOptions.d.ts.map +1 -1
  291. package/lib/typescript/components/HMSShowNetworkQuality.d.ts.map +1 -1
  292. package/lib/typescript/components/Meeting.d.ts.map +1 -1
  293. package/lib/typescript/components/MenuModal/Menu.d.ts.map +1 -1
  294. package/lib/typescript/components/Modals.d.ts +1 -9
  295. package/lib/typescript/components/Modals.d.ts.map +1 -1
  296. package/lib/typescript/components/Participants/ParticipantsList.d.ts.map +1 -1
  297. package/lib/typescript/components/PeerSettingsModalContent.d.ts.map +1 -1
  298. package/lib/typescript/components/Preview.d.ts.map +1 -1
  299. package/lib/typescript/components/RoomSettingsModalContent.d.ts.map +1 -1
  300. package/lib/typescript/components/index.d.ts +0 -1
  301. package/lib/typescript/components/index.d.ts.map +1 -1
  302. package/lib/typescript/hooks-util-selectors.d.ts +2 -0
  303. package/lib/typescript/hooks-util-selectors.d.ts.map +1 -1
  304. package/lib/typescript/hooks-util.d.ts +9 -2
  305. package/lib/typescript/hooks-util.d.ts.map +1 -1
  306. package/lib/typescript/redux/actionTypes.d.ts +5 -1
  307. package/lib/typescript/redux/actionTypes.d.ts.map +1 -1
  308. package/lib/typescript/redux/actions/index.d.ts +24 -3
  309. package/lib/typescript/redux/actions/index.d.ts.map +1 -1
  310. package/lib/typescript/redux/index.d.ts +4 -1
  311. package/lib/typescript/redux/index.d.ts.map +1 -1
  312. package/lib/typescript/redux/reducers/appState.d.ts +3 -0
  313. package/lib/typescript/redux/reducers/appState.d.ts.map +1 -1
  314. package/lib/typescript/redux/reducers/hmsStates.d.ts +11 -2
  315. package/lib/typescript/redux/reducers/hmsStates.d.ts.map +1 -1
  316. package/lib/typescript/redux/reducers/index.d.ts +4 -1
  317. package/lib/typescript/redux/reducers/index.d.ts.map +1 -1
  318. package/lib/typescript/redux/reducers/userState.d.ts +2 -2
  319. package/lib/typescript/redux/reducers/userState.d.ts.map +1 -1
  320. package/lib/typescript/utils/theme.d.ts +5 -0
  321. package/lib/typescript/utils/theme.d.ts.map +1 -1
  322. package/lib/typescript/utils/types.d.ts +3 -4
  323. package/lib/typescript/utils/types.d.ts.map +1 -1
  324. package/package.json +11 -17
  325. package/src/HMSInstanceSetup.tsx +4 -31
  326. package/src/HMSPrebuilt.tsx +24 -6
  327. package/src/HMSRoomSetup.tsx +55 -17
  328. package/src/Icons/AnswerPhone/assets/answer-phone.png +0 -0
  329. package/src/Icons/AnswerPhone/assets/answer-phone@2x.png +0 -0
  330. package/src/Icons/AnswerPhone/assets/answer-phone@3x.png +0 -0
  331. package/src/Icons/AnswerPhone/index.tsx +27 -0
  332. package/src/Icons/Bluetooth/assets/bluetooth-on.png +0 -0
  333. package/src/Icons/Bluetooth/assets/bluetooth-on@2x.png +0 -0
  334. package/src/Icons/Bluetooth/assets/bluetooth-on@3x.png +0 -0
  335. package/src/Icons/Bluetooth/index.tsx +27 -0
  336. package/src/Icons/Check/assets/check.png +0 -0
  337. package/src/Icons/Check/assets/check@2x.png +0 -0
  338. package/src/Icons/Check/assets/check@3x.png +0 -0
  339. package/src/Icons/Check/index.tsx +27 -0
  340. package/src/Icons/GenericLogo/assets/generic-logo.png +0 -0
  341. package/src/Icons/GenericLogo/assets/generic-logo@2x.png +0 -0
  342. package/src/Icons/GenericLogo/assets/generic-logo@3x.png +0 -0
  343. package/src/Icons/GenericLogo/index.tsx +27 -0
  344. package/src/Icons/Headphones/assets/headphones.png +0 -0
  345. package/src/Icons/Headphones/assets/headphones@2x.png +0 -0
  346. package/src/Icons/Headphones/assets/headphones@3x.png +0 -0
  347. package/src/Icons/Headphones/index.tsx +27 -0
  348. package/src/Icons/Person/assets/person.png +0 -0
  349. package/src/Icons/Person/assets/person@2x.png +0 -0
  350. package/src/Icons/Person/assets/person@3x.png +0 -0
  351. package/src/Icons/Person/index.tsx +27 -0
  352. package/src/Icons/Radio/assets/radio.png +0 -0
  353. package/src/Icons/Radio/assets/radio@2x.png +0 -0
  354. package/src/Icons/Radio/assets/radio@3x.png +0 -0
  355. package/src/Icons/Radio/index.tsx +27 -0
  356. package/src/Icons/Speaker/assets/speaker-large.png +0 -0
  357. package/src/Icons/Speaker/assets/speaker-large@2x.png +0 -0
  358. package/src/Icons/Speaker/assets/speaker-large@3x.png +0 -0
  359. package/src/Icons/Speaker/index.tsx +10 -2
  360. package/src/Icons/Wave/assets/wave.png +0 -0
  361. package/src/Icons/Wave/assets/wave@2x.png +0 -0
  362. package/src/Icons/Wave/assets/wave@3x.png +0 -0
  363. package/src/Icons/Wave/index.tsx +24 -0
  364. package/src/Icons/index.ts +8 -0
  365. package/src/components/BackButton.tsx +4 -4
  366. package/src/components/DisplayView.tsx +0 -10
  367. package/src/components/HMSHLSStreamLoading.tsx +57 -0
  368. package/src/components/HMSLocalVideoView.tsx +42 -0
  369. package/src/components/HMSManageAudioOutput.tsx +311 -0
  370. package/src/components/HMSManageLeave.tsx +6 -77
  371. package/src/components/HMSMeetingEnded.tsx +29 -0
  372. package/src/components/HMSPreviewEditName.tsx +6 -5
  373. package/src/components/HMSPreviewHLSLiveIndicator.tsx +58 -0
  374. package/src/components/HMSPreviewJoinButton.tsx +44 -4
  375. package/src/components/HMSPreviewNetworkQuality.tsx +40 -0
  376. package/src/components/HMSPreviewPeersList.tsx +12 -72
  377. package/src/components/HMSPreviewSubtitle.tsx +27 -3
  378. package/src/components/HMSPreviewTile.tsx +13 -91
  379. package/src/components/HMSPreviewTitle.tsx +0 -1
  380. package/src/components/HMSRoomOptions.tsx +2 -8
  381. package/src/components/HMSShowNetworkQuality.tsx +0 -1
  382. package/src/components/Meeting.tsx +11 -0
  383. package/src/components/MenuModal/Menu.tsx +1 -1
  384. package/src/components/Modals.tsx +4 -299
  385. package/src/components/Participants/ParticipantsList.tsx +0 -24
  386. package/src/components/PeerSettingsModalContent.tsx +9 -23
  387. package/src/components/Preview.tsx +131 -48
  388. package/src/components/RoomSettingsModalContent.tsx +1 -138
  389. package/src/components/index.ts +0 -1
  390. package/src/hooks/useHmsInstance.ts +0 -1
  391. package/src/hooks-util-selectors.tsx +10 -0
  392. package/src/hooks-util.ts +168 -89
  393. package/src/redux/actionTypes.ts +8 -0
  394. package/src/redux/actions/index.ts +23 -2
  395. package/src/redux/reducers/appState.ts +9 -0
  396. package/src/redux/reducers/hmsStates.ts +28 -1
  397. package/src/redux/reducers/userState.ts +2 -2
  398. package/src/utils/theme.ts +6 -1
  399. package/src/utils/types.ts +3 -4
  400. package/src/utils.ts +2 -2
  401. package/lib/commonjs/components/HMSPreviewDeviceSettings.js.map +0 -1
  402. package/lib/commonjs/components/ZoomableView.js +0 -84
  403. package/lib/commonjs/components/ZoomableView.js.map +0 -1
  404. package/lib/module/components/HMSPreviewDeviceSettings.js +0 -296
  405. package/lib/module/components/HMSPreviewDeviceSettings.js.map +0 -1
  406. package/lib/module/components/ZoomableView.js +0 -76
  407. package/lib/module/components/ZoomableView.js.map +0 -1
  408. package/lib/typescript/components/HMSPreviewDeviceSettings.d.ts +0 -3
  409. package/lib/typescript/components/HMSPreviewDeviceSettings.d.ts.map +0 -1
  410. package/lib/typescript/components/ZoomableView.d.ts +0 -6
  411. package/lib/typescript/components/ZoomableView.d.ts.map +0 -1
  412. package/src/components/HMSPreviewDeviceSettings.tsx +0 -387
  413. package/src/components/ZoomableView.tsx +0 -91
@@ -1,4 +1,4 @@
1
- import React, { useRef } from 'react';
1
+ import React from 'react';
2
2
  import {
3
3
  View,
4
4
  StyleSheet,
@@ -11,7 +11,6 @@ import {
11
11
  InteractionManager,
12
12
  } from 'react-native';
13
13
  import {
14
- HMSAudioFilePlayerNode,
15
14
  HMSAudioMixingMode,
16
15
  HMSUpdateListenerActions,
17
16
  } from '@100mslive/react-native-hms';
@@ -21,7 +20,6 @@ import MaterialCommunityIcons from 'react-native-vector-icons/MaterialCommunityI
21
20
  import Ionicons from 'react-native-vector-icons/Ionicons';
22
21
  import MaterialIcons from 'react-native-vector-icons/MaterialIcons';
23
22
  import EntypoIcons from 'react-native-vector-icons/Entypo';
24
- import DocumentPicker from 'react-native-document-picker';
25
23
  import { openSettings, requestNotifications } from 'react-native-permissions';
26
24
 
27
25
  import { COLORS } from '../utils/theme';
@@ -34,7 +32,6 @@ import {
34
32
  } from '../redux/actions';
35
33
  import { ModalTypes, PipModes } from '../utils/types';
36
34
  import { parseMetadata } from '../utils/functions';
37
- import { getJoinConfig } from '../utils';
38
35
  import { HMSShareScreen } from './HMSShareScreen';
39
36
  import { ScreenShareIcon } from '../Icons';
40
37
 
@@ -63,11 +60,6 @@ export const RoomSettingsModalContent: React.FC<
63
60
  setAudioDeviceListenerAdded,
64
61
  setMuteAllTracksAudio,
65
62
  }) => {
66
- // REFS
67
- const audioFilePlayerNodeRef = useRef(
68
- new HMSAudioFilePlayerNode('audio_file_player_node')
69
- );
70
-
71
63
  // REDUX STATES & DISPATCH
72
64
  const dispatch = useDispatch();
73
65
  const hmsInstance = useSelector((state: RootState) => state.user.hmsInstance);
@@ -308,73 +300,6 @@ export const RoomSettingsModalContent: React.FC<
308
300
  .catch((e) => console.log('Start Audioshare Error: ', e));
309
301
  }
310
302
  };
311
-
312
- // iOS Audioshare
313
- const setAudioShareVolume = () =>
314
- setModalVisible(ModalTypes.SET_AUDIO_SHARE_VOLUME, true);
315
-
316
- // iOS Audioshare
317
- const playAudioShare = () => {
318
- closeRoomSettingsModal();
319
- setTimeout(() => {
320
- DocumentPicker.pickSingle()
321
- .then((result) => {
322
- console.log('Document Picker Success: ', result);
323
- audioFilePlayerNodeRef.current
324
- .play(result?.uri, false, false)
325
- .then((d) => {
326
- console.log('Start Audioshare Success: ', d);
327
- })
328
- .catch((e) => console.log('Start Audioshare Error: ', e));
329
- })
330
- .catch((e) => console.log('Document Picker Error: ', e));
331
- }, 500);
332
- };
333
-
334
- // iOS Audioshare
335
- const stopAudioShare = () => {
336
- closeRoomSettingsModal();
337
- audioFilePlayerNodeRef.current.stop();
338
- };
339
-
340
- // iOS Audioshare
341
- const pauseAudioShare = () => {
342
- closeRoomSettingsModal();
343
- audioFilePlayerNodeRef.current.pause();
344
- };
345
-
346
- // iOS Audioshare
347
- const resumeAudioShare = () => {
348
- closeRoomSettingsModal();
349
- audioFilePlayerNodeRef.current.resume();
350
- };
351
-
352
- // iOS Audioshare
353
- const isAudioSharePlaying = () => {
354
- closeRoomSettingsModal();
355
- audioFilePlayerNodeRef.current
356
- .isPlaying()
357
- .then((d) => console.log('Audioshare isPlaying: ', d))
358
- .catch((e) => console.log('Audioshare isPlaying: ', e));
359
- };
360
-
361
- // iOS Audioshare
362
- const getAudioShareDuration = () => {
363
- closeRoomSettingsModal();
364
- audioFilePlayerNodeRef.current
365
- .duration()
366
- .then((d) => console.log('Audioshare duration: ', d))
367
- .catch((e) => console.log('Audioshare duration: ', e));
368
- };
369
-
370
- // iOS Audioshare
371
- const getAudioShareCurrentDuration = () => {
372
- closeRoomSettingsModal();
373
- audioFilePlayerNodeRef.current
374
- .currentDuration()
375
- .then((d) => console.log('Audioshare currentDuration: ', d))
376
- .catch((e) => console.log('Audioshare currentDuration: ', e));
377
- };
378
303
  //#endregion
379
304
 
380
305
  return (
@@ -582,68 +507,6 @@ export const RoomSettingsModalContent: React.FC<
582
507
  />
583
508
  </>
584
509
  ) : null}
585
-
586
- {Platform.OS === 'ios' &&
587
- getJoinConfig().audioMixer &&
588
- localPeerRole?.publishSettings?.allowed?.includes('audio') ? (
589
- <>
590
- <SettingItem
591
- onPress={playAudioShare}
592
- text="Play Audio Share"
593
- IconType={Ionicons}
594
- iconName="play-outline"
595
- />
596
-
597
- <SettingItem
598
- onPress={stopAudioShare}
599
- text="Stop Audio Share"
600
- IconType={Ionicons}
601
- iconName="stop-outline"
602
- />
603
-
604
- <SettingItem
605
- onPress={setAudioShareVolume}
606
- text="Set Audio Share Volume"
607
- IconType={Ionicons}
608
- iconName="volume-high-outline"
609
- />
610
-
611
- <SettingItem
612
- onPress={pauseAudioShare}
613
- text="Pause Audio Share"
614
- IconType={Ionicons}
615
- iconName="pause-outline"
616
- />
617
-
618
- <SettingItem
619
- onPress={resumeAudioShare}
620
- text="Resume Audio Share"
621
- IconType={Ionicons}
622
- iconName="play-skip-forward-outline"
623
- />
624
-
625
- <SettingItem
626
- onPress={isAudioSharePlaying}
627
- text="Is Audio Share Playing"
628
- IconType={MaterialCommunityIcons}
629
- iconName="file-question-outline"
630
- />
631
-
632
- <SettingItem
633
- onPress={getAudioShareDuration}
634
- text="Audio Share Duration"
635
- IconType={Ionicons}
636
- iconName="timer-outline"
637
- />
638
-
639
- <SettingItem
640
- onPress={getAudioShareCurrentDuration}
641
- text="Audio Share Current Duration"
642
- IconType={Ionicons}
643
- iconName="timer-outline"
644
- />
645
- </>
646
- ) : null}
647
510
  </>
648
511
  ) : null}
649
512
  </ScrollView>
@@ -1,7 +1,6 @@
1
1
  export * from './ChatWindow';
2
2
  export * from './Preview';
3
3
  export * from './Picker';
4
- export * from './ZoomableView';
5
4
  export * from './CustomInput';
6
5
  export * from './CustomButton';
7
6
  export * from './DefaultModal';
@@ -12,7 +12,6 @@
12
12
  // HMSVideoTrackSettings,
13
13
  // } from '@100mslive/react-native-hms';
14
14
  // import { useEffect, useState } from 'react';
15
- // import { getModel } from 'react-native-device-info';
16
15
 
17
16
  // export const useHmsInstance = () => {
18
17
  // const [hmsInstance, setHmsInstance] = useState(null);
@@ -1,4 +1,14 @@
1
1
  import type { HMSPeer } from '@100mslive/react-native-hms';
2
2
 
3
+ import type { RootState } from './redux';
4
+
3
5
  export const selectIsHLSViewer = (peer: HMSPeer | null | undefined) =>
4
6
  peer?.role?.name?.includes('hls') ?? false;
7
+
8
+ export const selectShouldGoLive = (state: RootState) => {
9
+ const isHLSStreaming = state.hmsStates.room?.hlsStreamingState.running;
10
+ const canStartHLSStreaming =
11
+ state.hmsStates.localPeer?.role?.permissions?.hlsStreaming;
12
+
13
+ return canStartHLSStreaming && !isHLSStreaming;
14
+ };
package/src/hooks-util.ts CHANGED
@@ -23,18 +23,29 @@ import type {
23
23
  HMSSessionStoreValue,
24
24
  } from '@100mslive/react-native-hms';
25
25
  import Toast from 'react-native-simple-toast';
26
- import { useRef, useCallback, useEffect, useState, useMemo } from 'react';
26
+ import {
27
+ useRef,
28
+ useCallback,
29
+ useEffect,
30
+ useState,
31
+ useMemo,
32
+ useContext,
33
+ } from 'react';
27
34
 
28
35
  import { ModalTypes, PipModes } from './utils/types';
29
36
  import type { PeerTrackNode } from './utils/types';
30
37
  import { createPeerTrackNode, parseMetadata } from './utils/functions';
31
- import { useDispatch, useSelector, useStore } from 'react-redux';
38
+ import { batch, useDispatch, useSelector, useStore } from 'react-redux';
32
39
  import type { RootState } from './redux';
33
40
  import {
34
41
  addMessage,
35
42
  addPinnedMessage,
43
+ addToPreviewPeersList,
44
+ changeMeetingState,
36
45
  changePipModeStatus,
46
+ changeStartingHLSStream,
37
47
  clearStore,
48
+ removeFromPreviewPeersList,
38
49
  saveUserData,
39
50
  setHMSLocalPeerState,
40
51
  setHMSRoleState,
@@ -59,7 +70,7 @@ import {
59
70
  LayoutAnimation,
60
71
  Platform,
61
72
  } from 'react-native';
62
- import { useNavigation } from '@react-navigation/native';
73
+ import { NavigationContext } from '@react-navigation/native';
63
74
  import {
64
75
  useIsLandscapeOrientation,
65
76
  useIsPortraitOrientation,
@@ -68,27 +79,24 @@ import {
68
79
  useSafeAreaFrame,
69
80
  useSafeAreaInsets,
70
81
  } from 'react-native-safe-area-context';
71
- import { selectIsHLSViewer } from './hooks-util-selectors';
82
+ import { selectIsHLSViewer, selectShouldGoLive } from './hooks-util-selectors';
72
83
 
73
84
  export const useHMSListeners = (
74
- setPeerTrackNodes: React.Dispatch<React.SetStateAction<PeerTrackNode[]>>,
75
- setMeetingState: React.Dispatch<React.SetStateAction<MeetingState>>
85
+ setPeerTrackNodes: React.Dispatch<React.SetStateAction<PeerTrackNode[]>>
76
86
  ) => {
77
87
  const hmsInstance = useHMSInstance();
78
88
  const updateLocalPeer = useUpdateHMSLocalPeer(hmsInstance);
79
89
 
80
- useHMSRoomUpdate(hmsInstance, setMeetingState);
90
+ useHMSRoomUpdate(hmsInstance);
81
91
 
82
92
  useHMSPeersUpdate(hmsInstance, updateLocalPeer, setPeerTrackNodes);
83
93
 
84
94
  useHMSTrackUpdate(hmsInstance, updateLocalPeer, setPeerTrackNodes);
85
95
  };
86
96
 
87
- const useHMSRoomUpdate = (
88
- hmsInstance: HMSSDK,
89
- setMeetingState: React.Dispatch<React.SetStateAction<MeetingState>>
90
- ) => {
97
+ const useHMSRoomUpdate = (hmsInstance: HMSSDK) => {
91
98
  const dispatch = useDispatch();
99
+ const reduxStore = useStore();
92
100
 
93
101
  useEffect(() => {
94
102
  const roomUpdateHandler = (data: {
@@ -104,12 +112,14 @@ const useHMSRoomUpdate = (
104
112
  * before ON_JOIN, if ON_ROOM comes then we can show Meeting screen to user, instead of Loader or Preview
105
113
  */
106
114
  if (room.localPeer.role?.name?.includes('hls-') ?? false) {
107
- dispatch(setHMSLocalPeerState(room.localPeer));
108
- setMeetingState((prevMeetingScreen) => {
109
- if (prevMeetingScreen !== MeetingState.IN_MEETING) {
110
- return MeetingState.IN_MEETING;
115
+ const meetingState = (reduxStore.getState() as RootState).app
116
+ .meetingState;
117
+
118
+ batch(() => {
119
+ dispatch(setHMSLocalPeerState(room.localPeer));
120
+ if (meetingState !== MeetingState.IN_MEETING) {
121
+ dispatch(changeMeetingState(MeetingState.IN_MEETING));
111
122
  }
112
- return prevMeetingScreen;
113
123
  });
114
124
  }
115
125
 
@@ -135,6 +145,8 @@ const useHMSRoomUpdate = (
135
145
  Toast.TOP
136
146
  );
137
147
  } else if (type === HMSRoomUpdate.HLS_STREAMING_STATE_UPDATED) {
148
+ dispatch(changeStartingHLSStream(false));
149
+
138
150
  let streaming = room?.hlsStreamingState?.running;
139
151
 
140
152
  Toast.showWithGravity(
@@ -208,64 +220,23 @@ const useHMSPeersUpdate = (
208
220
  updateLocalPeer: () => void,
209
221
  setPeerTrackNodes: React.Dispatch<React.SetStateAction<PeerTrackNode[]>>
210
222
  ) => {
211
- // useHMSPeerUpdates(
212
- // ({ peer, type }: PeerUpdate) => {
213
- // if (type === HMSPeerUpdate.PEER_JOINED) {
214
- // return;
215
- // }
216
- // if (type === HMSPeerUpdate.PEER_LEFT) {
217
- // setPeerTrackNodes((prevPeerTrackNodes) =>
218
- // removePeerTrackNodes(prevPeerTrackNodes, peer)
219
- // );
220
- // return;
221
- // }
222
- // if (peer.isLocal) {
223
- // setPeerTrackNodes((prevPeerTrackNodes) => {
224
- // if (peerTrackNodeExistForPeer(prevPeerTrackNodes, peer)) {
225
- // return replacePeerTrackNodes(prevPeerTrackNodes, peer);
226
- // }
227
- // return prevPeerTrackNodes;
228
- // });
229
-
230
- // // - TODO: update local localPeer state
231
- // // - Pass this updated data to Meeting component -> DisplayView component
232
- // updateLocalPeer();
233
- // return;
234
- // }
235
- // if (type === HMSPeerUpdate.ROLE_CHANGED) {
236
- // if (
237
- // peer.role?.publishSettings?.allowed === undefined ||
238
- // (peer.role?.publishSettings?.allowed &&
239
- // peer.role?.publishSettings?.allowed.length < 1)
240
- // ) {
241
- // setPeerTrackNodes((prevPeerTrackNodes) => {
242
- // if (peerTrackNodeExistForPeer(prevPeerTrackNodes, peer)) {
243
- // return removePeerTrackNodes(prevPeerTrackNodes, peer);
244
- // }
245
- // return prevPeerTrackNodes;
246
- // });
247
- // }
248
- // return;
249
- // }
250
- // if (
251
- // type === HMSPeerUpdate.METADATA_CHANGED ||
252
- // type === HMSPeerUpdate.NAME_CHANGED ||
253
- // type === HMSPeerUpdate.NETWORK_QUALITY_UPDATED
254
- // ) {
255
- // setPeerTrackNodes((prevPeerTrackNodes) => {
256
- // if (peerTrackNodeExistForPeer(prevPeerTrackNodes, peer)) {
257
- // return replacePeerTrackNodes(prevPeerTrackNodes, peer);
258
- // }
259
- // return prevPeerTrackNodes;
260
- // });
261
- // return;
262
- // }
263
- // },
264
- // [hmsInstance]
265
- // );
223
+ const dispatch = useDispatch();
224
+ const inMeeting = useSelector(
225
+ (state: RootState) => state.app.meetingState === MeetingState.IN_MEETING
226
+ );
266
227
 
267
228
  useEffect(() => {
268
229
  const peerUpdateHandler = ({ peer, type }: PeerUpdate) => {
230
+ // Handle State from Preview screen
231
+ if (!inMeeting) {
232
+ if (type === HMSPeerUpdate.PEER_JOINED) {
233
+ dispatch(addToPreviewPeersList(peer));
234
+ } else if (type === HMSPeerUpdate.PEER_LEFT) {
235
+ dispatch(removeFromPreviewPeersList(peer));
236
+ }
237
+ }
238
+
239
+ // Handle State for Meeting screen
269
240
  if (type === HMSPeerUpdate.PEER_JOINED) {
270
241
  return;
271
242
  }
@@ -326,7 +297,7 @@ const useHMSPeersUpdate = (
326
297
  return () => {
327
298
  hmsInstance.removeEventListener(HMSUpdateListenerActions.ON_PEER_UPDATE);
328
299
  };
329
- }, [hmsInstance]);
300
+ }, [inMeeting, hmsInstance]); // TODO: When `inMeeting` becomes true Peer Update is resubscribed, we might lose some events during that time
330
301
  };
331
302
 
332
303
  type TrackUpdate = {
@@ -773,7 +744,7 @@ export const useHMSPIPRoomLeave = () => {
773
744
  const hmsInstance = useHMSInstance();
774
745
  const dispatch = useDispatch();
775
746
  // TODO: What if this is undefined?
776
- const navigation = useNavigation();
747
+ const navigation = useContext(NavigationContext);
777
748
 
778
749
  useEffect(() => {
779
750
  const pipRoomLeaveHandler = () => {
@@ -801,13 +772,15 @@ export const useHMSPIPRoomLeave = () => {
801
772
  // dispatch(clearPeerData());
802
773
  // dispatch(clearHmsReference());
803
774
 
804
- // if (navigation.canGoBack()) {
805
- // navigation.goBack();
806
- // } else {
807
- // TODO: remove this later
808
- navigation.navigate('QRCodeScreen' as never);
809
- dispatch(clearStore());
810
- // }
775
+ if (navigation && navigation.canGoBack()) {
776
+ navigation.goBack();
777
+ dispatch(clearStore());
778
+ } else {
779
+ // TODO: call onLeave Callback if provided
780
+ // Otherwise default action is to show "Meeting Ended" screen
781
+ dispatch(clearStore()); // TODO: We need different clearStore for MeetingEnded
782
+ dispatch(changeMeetingState(MeetingState.MEETING_ENDED));
783
+ }
811
784
  })
812
785
  .catch((e) => {
813
786
  console.log(`Destroy HMS instance Error: ${e}`);
@@ -834,7 +807,7 @@ export const useHMSRemovedFromRoomUpdate = () => {
834
807
  const hmsInstance = useHMSInstance();
835
808
  const dispatch = useDispatch();
836
809
  // TODO: What if this is undefined?
837
- const navigation = useNavigation();
810
+ const navigation = useContext(NavigationContext);
838
811
 
839
812
  useEffect(() => {
840
813
  const removedFromRoomHandler = () => {
@@ -862,13 +835,15 @@ export const useHMSRemovedFromRoomUpdate = () => {
862
835
  // dispatch(clearPeerData());
863
836
  // dispatch(clearHmsReference());
864
837
 
865
- // if (navigation.canGoBack()) {
866
- // navigation.goBack();
867
- // } else {
868
- // TODO: remove this later
869
- navigation.navigate('QRCodeScreen' as never);
870
- dispatch(clearStore());
871
- // }
838
+ if (navigation && navigation.canGoBack()) {
839
+ navigation.goBack();
840
+ dispatch(clearStore());
841
+ } else {
842
+ // TODO: call onLeave Callback if provided
843
+ // Otherwise default action is to show "Meeting Ended" screen
844
+ dispatch(clearStore()); // TODO: We need different clearStore for MeetingEnded
845
+ dispatch(changeMeetingState(MeetingState.MEETING_ENDED));
846
+ }
872
847
  })
873
848
  .catch((e) => {
874
849
  console.log(`Destroy HMS instance Error: ${e}`);
@@ -1050,7 +1025,18 @@ export const useHMSConfig = () => {
1050
1025
  return hmsConfig;
1051
1026
  }, [hmsInstance]);
1052
1027
 
1053
- return { clearConfig, getConfig };
1028
+ const updateConfig = useCallback((data: Partial<HMSConfig>) => {
1029
+ if (!hmsConfig) {
1030
+ throw new Error('No HMSConfig is available to update!');
1031
+ }
1032
+
1033
+ Object.entries(data).forEach(([key, value]) => {
1034
+ // @ts-ignore
1035
+ hmsConfig[key] = value;
1036
+ });
1037
+ }, []);
1038
+
1039
+ return { clearConfig, updateConfig, getConfig };
1054
1040
  };
1055
1041
 
1056
1042
  export const useSafeDimensions = () => {
@@ -1186,3 +1172,96 @@ export const useFilteredParticipants = () => {
1186
1172
  setSearchText: setParticipantsSearchInput,
1187
1173
  };
1188
1174
  };
1175
+
1176
+ export const useShouldGoLive = () => {
1177
+ const shouldGoLive = useSelector(selectShouldGoLive);
1178
+
1179
+ return shouldGoLive;
1180
+ };
1181
+
1182
+ export const useLeaveMethods = () => {
1183
+ const navigation = useContext(NavigationContext);
1184
+ const hmsInstance = useHMSInstance();
1185
+ const dispatch = useDispatch();
1186
+
1187
+ const destroy = useCallback(async () => {
1188
+ try {
1189
+ const s = await hmsInstance.destroy();
1190
+ console.log('Destroy Success: ', s);
1191
+ // TODOS:
1192
+ // - If show `Meeting_Ended` is true, show Meeting screen by setting state to MEETING_ENDED
1193
+ // - Reset Redux States
1194
+ // - HMSInstance will not be available now
1195
+ // - When your presses "Re Join" Action button, restart process from root component
1196
+ // - When your presses "Done" Action button
1197
+ // - If we have callback fn, call it
1198
+ // - Otherwise try our best to navigate away from current screen
1199
+ //
1200
+ // - No screen to show
1201
+ // - No need to reset redux state?
1202
+ // - HMSInstance will be available till this point
1203
+ // - If we have callback fn, call it
1204
+ // - Otherwise try our best to navigate away from current screen
1205
+ // - When we are navigated away from screen, HMSInstance will be not available
1206
+
1207
+ // dispatch(clearMessageData());
1208
+ // dispatch(clearPeerData());
1209
+ // dispatch(clearHmsReference());
1210
+
1211
+ if (navigation && navigation.canGoBack()) {
1212
+ navigation.goBack();
1213
+ dispatch(clearStore());
1214
+ } else {
1215
+ // TODO: call onLeave Callback if provided
1216
+ // Otherwise default action is to show "Meeting Ended" screen
1217
+ dispatch(clearStore()); // TODO: We need different clearStore for MeetingEnded
1218
+ dispatch(changeMeetingState(MeetingState.MEETING_ENDED));
1219
+ }
1220
+ } catch (e) {
1221
+ console.log(`Destroy HMS instance Error: ${e}`);
1222
+ Toast.showWithGravity(
1223
+ `Destroy HMS instance Error: ${e}`,
1224
+ Toast.LONG,
1225
+ Toast.TOP
1226
+ );
1227
+ return Promise.reject(e);
1228
+ }
1229
+ }, [hmsInstance]);
1230
+
1231
+ const leave = useCallback(async () => {
1232
+ try {
1233
+ const d = await hmsInstance.leave();
1234
+ console.log('Leave Success: ', d);
1235
+ await destroy();
1236
+ } catch (e) {
1237
+ console.log(`Leave Room Error: ${e}`);
1238
+ Toast.showWithGravity(`Leave Room Error: ${e}`, Toast.LONG, Toast.TOP);
1239
+ }
1240
+ }, [destroy, hmsInstance]);
1241
+
1242
+ const goToPreview = useCallback(async () => {
1243
+ try {
1244
+ await hmsInstance.leave();
1245
+ await hmsInstance.destroy();
1246
+ dispatch(clearStore());
1247
+ } catch (error) {
1248
+ Toast.showWithGravity(
1249
+ `Unable to go to Preview: ${error}`,
1250
+ Toast.LONG,
1251
+ Toast.TOP
1252
+ );
1253
+ }
1254
+ }, [hmsInstance]);
1255
+
1256
+ const endRoom = useCallback(async () => {
1257
+ try {
1258
+ const d = await hmsInstance.endRoom('Host ended the room');
1259
+ console.log('EndRoom Success: ', d);
1260
+ await destroy();
1261
+ } catch (e) {
1262
+ console.log('EndRoom Error: ', e);
1263
+ }
1264
+ }, [destroy, hmsInstance]);
1265
+
1266
+ return { destroy, leave, endRoom, goToPreview };
1267
+ };
@@ -48,6 +48,10 @@ const SET_MODAL_TYPE = 'SET_MODAL_TYPE';
48
48
 
49
49
  const SET_PEER_TO_UPDATE = 'SET_PEER_TO_UPDATE';
50
50
 
51
+ const SET_MEETING_STATE = 'SET_MEETING_STATE';
52
+
53
+ const SET_STARTING_HLS_STREAM = 'SET_STARTING_HLS_STREAM';
54
+
51
55
  export default {
52
56
  ADD_PINNED_MESSAGE,
53
57
  ADD_MESSAGE,
@@ -69,6 +73,8 @@ export default {
69
73
  SET_RTC_STATS,
70
74
  SET_MODAL_TYPE,
71
75
  SET_PEER_TO_UPDATE,
76
+ SET_MEETING_STATE,
77
+ SET_STARTING_HLS_STREAM,
72
78
  };
73
79
 
74
80
  export enum HmsStateActionTypes {
@@ -82,4 +88,6 @@ export enum HmsStateActionTypes {
82
88
  SET_IS_LOCAL_SCREEN_SHARED_STATE = 'SET_IS_LOCAL_SCREEN_SHARED_STATE',
83
89
  SET_ROOM_LOCALLY_MUTED = 'SET_ROOM_LOCALLY_MUTED',
84
90
  SET_USER_NAME = 'SET_USER_NAME',
91
+ ADD_TO_PREVIEW_PEERS_LIST = 'ADD_TO_PREVIEW_PEERS_LIST',
92
+ REMOVE_FROM_PREVIEW_PEERS_LIST = 'REMOVE_FROM_PREVIEW_PEERS_LIST',
85
93
  }
@@ -11,12 +11,13 @@ import type {
11
11
  HMSSessionStore,
12
12
  } from '@100mslive/react-native-hms';
13
13
  import type {
14
- IOSBuildConfig,
14
+ HMSIOSScreenShareConfig,
15
15
  ModalTypes,
16
16
  PeerTrackNode,
17
17
  PipModes,
18
18
  } from '../../utils/types';
19
19
  import actionTypes, { HmsStateActionTypes } from '../actionTypes';
20
+ import { MeetingState } from '../../types';
20
21
 
21
22
  export const setPrebuiltData = (data: {
22
23
  roomCode: string;
@@ -28,7 +29,7 @@ export const setPrebuiltData = (data: {
28
29
  init: string;
29
30
  token: string;
30
31
  };
31
- ios?: IOSBuildConfig;
32
+ ios?: HMSIOSScreenShareConfig;
32
33
  };
33
34
  }) => ({
34
35
  type: HmsStateActionTypes.SET_PREBUILT_DATA,
@@ -194,3 +195,23 @@ export const setPeerToUpdate = (peerToUpdate: HMSPeer) => ({
194
195
  type: actionTypes.SET_PEER_TO_UPDATE,
195
196
  payload: { peerToUpdate },
196
197
  });
198
+
199
+ export const addToPreviewPeersList = (peer: HMSPeer) => ({
200
+ type: HmsStateActionTypes.ADD_TO_PREVIEW_PEERS_LIST,
201
+ peer,
202
+ });
203
+
204
+ export const removeFromPreviewPeersList = (peer: HMSPeer) => ({
205
+ type: HmsStateActionTypes.REMOVE_FROM_PREVIEW_PEERS_LIST,
206
+ peerId: peer.peerID,
207
+ });
208
+
209
+ export const changeMeetingState = (meetingState: MeetingState) => ({
210
+ type: actionTypes.SET_MEETING_STATE,
211
+ payload: { meetingState },
212
+ });
213
+
214
+ export const changeStartingHLSStream = (startingHLSStream: boolean) => ({
215
+ type: actionTypes.SET_STARTING_HLS_STREAM,
216
+ payload: { startingHLSStream },
217
+ });
@@ -9,6 +9,7 @@ import {
9
9
  HMSRemoteAudioStats,
10
10
  HMSRemoteVideoStats,
11
11
  } from '@100mslive/react-native-hms';
12
+ import { MeetingState } from '../../types';
12
13
 
13
14
  type ActionType = {
14
15
  payload: { [key: string]: any };
@@ -37,6 +38,8 @@ type IntialStateType = {
37
38
  };
38
39
  modalType: ModalTypes;
39
40
  peerToUpdate: HMSPeer | null;
41
+ meetingState: MeetingState;
42
+ startingHLSStream: boolean;
40
43
  };
41
44
 
42
45
  const INITIAL_STATE: IntialStateType = {
@@ -54,6 +57,8 @@ const INITIAL_STATE: IntialStateType = {
54
57
  },
55
58
  modalType: ModalTypes.DEFAULT,
56
59
  peerToUpdate: null,
60
+ meetingState: MeetingState.NOT_JOINED,
61
+ startingHLSStream: false,
57
62
  };
58
63
 
59
64
  const appReducer = (
@@ -133,6 +138,10 @@ const appReducer = (
133
138
  [action.payload.trackId]: action.payload.stats,
134
139
  },
135
140
  };
141
+ case ActionTypes.SET_MEETING_STATE:
142
+ return { ...state, meetingState: action.payload.meetingState };
143
+ case ActionTypes.SET_STARTING_HLS_STREAM:
144
+ return { ...state, startingHLSStream: action.payload.startingHLSStream };
136
145
  case HmsStateActionTypes.CLEAR_STATES:
137
146
  return INITIAL_STATE;
138
147
  default: