@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
@@ -0,0 +1,311 @@
1
+ import * as React from 'react';
2
+ import Modal from 'react-native-modal';
3
+ import {
4
+ Platform,
5
+ ScrollView,
6
+ StyleSheet,
7
+ Text,
8
+ TouchableOpacity,
9
+ View,
10
+ } from 'react-native';
11
+ import Toast from 'react-native-simple-toast';
12
+ import { useSelector } from 'react-redux';
13
+ import {
14
+ HMSUpdateListenerActions,
15
+ HMSAudioDevice,
16
+ } from '@100mslive/react-native-hms';
17
+
18
+ import {
19
+ AnswerPhoneIcon,
20
+ BluetoothIcon,
21
+ CheckIcon,
22
+ HeadphonesIcon,
23
+ SpeakerIcon,
24
+ WaveIcon,
25
+ } from '../Icons';
26
+ import { PressableIcon } from './PressableIcon';
27
+ import { COLORS } from '../utils/theme';
28
+ import { CloseIcon } from '../Icons';
29
+ import { useHMSInstance } from '../hooks-util';
30
+ import type { RootState } from '../redux';
31
+
32
+ export const HMSManageAudioOutput: React.FC = () => {
33
+ const hmsInstance = useHMSInstance();
34
+ const [settingsModalVisible, setSettingsModalVisible] = React.useState(false);
35
+
36
+ const [currentAudioOutputDevice, setCurrentAudioOutputDevice] =
37
+ React.useState<HMSAudioDevice | null>(null);
38
+ const [availableAudioOutputDevices, setAvailableAudioOutputDevices] =
39
+ React.useState<HMSAudioDevice[]>([]);
40
+
41
+ const debugMode = useSelector((state: RootState) => state.user.debugMode);
42
+
43
+ // Fetch current selected audio device and audio devices list on Android
44
+ React.useEffect(() => {
45
+ if (Platform.OS === 'android') {
46
+ let ignore = false;
47
+
48
+ const getCurrentAudioOutputDevice = async () => {
49
+ const device = await hmsInstance.getAudioOutputRouteType();
50
+ if (!ignore) {
51
+ setCurrentAudioOutputDevice(device);
52
+ }
53
+ };
54
+
55
+ const getAvailableAudioOutputDevices = async () => {
56
+ const devices = await hmsInstance.getAudioDevicesList();
57
+ if (!ignore) {
58
+ setAvailableAudioOutputDevices(devices);
59
+ }
60
+ };
61
+
62
+ getCurrentAudioOutputDevice();
63
+ getAvailableAudioOutputDevices();
64
+
65
+ return () => {
66
+ ignore = true;
67
+ };
68
+ }
69
+ }, [hmsInstance]);
70
+
71
+ // closes modal and no action will be taken after modal has been closed
72
+ const dismissModal = () => {
73
+ setSettingsModalVisible(false);
74
+ };
75
+
76
+ // Handles showing Modal for changing Audio device
77
+ const handleSpeakerChange = () => {
78
+ if (Platform.OS === 'ios') {
79
+ hmsInstance.switchAudioOutputUsingIOSUI();
80
+ } else {
81
+ if (availableAudioOutputDevices.length === 0) {
82
+ hmsInstance
83
+ .getAudioDevicesList()
84
+ .then((devices) => setAvailableAudioOutputDevices(devices)); // TODO(set-state-after-unmount): setting state irrespective of component unmount check
85
+ }
86
+ setSettingsModalVisible(true);
87
+ }
88
+ };
89
+
90
+ // Add audio device change listeners
91
+ React.useEffect(() => {
92
+ if (Platform.OS === 'android') {
93
+ let ignore = false;
94
+ hmsInstance.setAudioDeviceChangeListener((data: any) => {
95
+ if (!ignore && data) {
96
+ setCurrentAudioOutputDevice(data.device);
97
+ }
98
+
99
+ if (debugMode) {
100
+ Toast.showWithGravity(
101
+ `Audio Device Output changed to: ${data?.device}`,
102
+ Toast.LONG,
103
+ Toast.TOP
104
+ );
105
+ }
106
+ });
107
+
108
+ return () => {
109
+ ignore = true;
110
+
111
+ hmsInstance.removeEventListener(
112
+ HMSUpdateListenerActions.ON_AUDIO_DEVICE_CHANGED
113
+ );
114
+ };
115
+ }
116
+ }, [hmsInstance, debugMode]);
117
+
118
+ // Handle changing selected audio device
119
+ const handleSelectAudioDevice = (device: HMSAudioDevice) => {
120
+ hmsInstance.switchAudioOutput(device);
121
+ setSettingsModalVisible(false);
122
+ };
123
+
124
+ return (
125
+ <View>
126
+ <PressableIcon onPress={handleSpeakerChange}>
127
+ {Platform.OS === 'ios' ? (
128
+ <SpeakerIcon muted={false} />
129
+ ) : (
130
+ getIcon(currentAudioOutputDevice || HMSAudioDevice.AUTOMATIC)
131
+ )}
132
+ </PressableIcon>
133
+
134
+ <Modal
135
+ isVisible={settingsModalVisible}
136
+ animationIn={'slideInUp'}
137
+ animationOut={'slideOutDown'}
138
+ backdropColor={COLORS.BACKGROUND.DIM}
139
+ backdropOpacity={0.3}
140
+ onBackButtonPress={dismissModal}
141
+ onBackdropPress={dismissModal}
142
+ useNativeDriver={true}
143
+ useNativeDriverForBackdrop={true}
144
+ hideModalContentWhileAnimating={true}
145
+ // swipeDirection={['up', 'down']}
146
+ // swipe
147
+ style={styles.modal}
148
+ >
149
+ <View style={styles.container}>
150
+ <View style={styles.header}>
151
+ <Text style={styles.headerText}>Audio Output</Text>
152
+
153
+ <TouchableOpacity
154
+ onPress={dismissModal}
155
+ hitSlop={styles.closeIconHitSlop}
156
+ >
157
+ <CloseIcon />
158
+ </TouchableOpacity>
159
+ </View>
160
+
161
+ {availableAudioOutputDevices.length === 0 ? (
162
+ <View style={styles.emptyView}>
163
+ <Text style={styles.itemText}>No other devices available!</Text>
164
+ </View>
165
+ ) : (
166
+ <ScrollView showsVerticalScrollIndicator={true}>
167
+ {availableAudioOutputDevices
168
+ .sort(
169
+ (a, b) => audioDeviceSortOrder[a] - audioDeviceSortOrder[b]
170
+ )
171
+ .map((device) => (
172
+ <React.Fragment key={device}>
173
+ <View style={styles.divider} />
174
+
175
+ <TouchableOpacity
176
+ style={styles.audioDeviceItem}
177
+ onPress={() => handleSelectAudioDevice(device)}
178
+ >
179
+ <View style={styles.itemTextWrapper}>
180
+ {getIcon(
181
+ device === HMSAudioDevice.AUTOMATIC &&
182
+ currentAudioOutputDevice
183
+ ? currentAudioOutputDevice
184
+ : device
185
+ )}
186
+
187
+ <Text style={styles.itemText}>
188
+ {getDescription(device, currentAudioOutputDevice)}
189
+ </Text>
190
+ </View>
191
+
192
+ {device === currentAudioOutputDevice ? (
193
+ <CheckIcon />
194
+ ) : null}
195
+ </TouchableOpacity>
196
+ </React.Fragment>
197
+ ))}
198
+ </ScrollView>
199
+ )}
200
+ </View>
201
+ </Modal>
202
+ </View>
203
+ );
204
+ };
205
+
206
+ const styles = StyleSheet.create({
207
+ modal: {
208
+ margin: 0,
209
+ justifyContent: 'flex-end',
210
+ },
211
+ container: {
212
+ backgroundColor: COLORS.BACKGROUND.DEFAULT,
213
+ borderTopLeftRadius: 16,
214
+ borderTopRightRadius: 16,
215
+ paddingTop: 24,
216
+ paddingHorizontal: 16,
217
+ paddingBottom: 32,
218
+ },
219
+ header: {
220
+ flexDirection: 'row',
221
+ alignItems: 'center',
222
+ justifyContent: 'space-between',
223
+ marginBottom: 16,
224
+ },
225
+ headerText: {
226
+ color: COLORS.SURFACE.ON_SURFACE.HIGH,
227
+ fontSize: 16,
228
+ fontFamily: 'Inter',
229
+ fontWeight: '500',
230
+ lineHeight: 24,
231
+ letterSpacing: 0.15,
232
+ },
233
+ closeIconHitSlop: {
234
+ bottom: 16,
235
+ left: 16,
236
+ right: 16,
237
+ top: 16,
238
+ },
239
+ itemTextWrapper: {
240
+ flexDirection: 'row',
241
+ alignItems: 'center',
242
+ justifyContent: 'center',
243
+ },
244
+ itemText: {
245
+ marginHorizontal: 16,
246
+ color: COLORS.SURFACE.ON_SURFACE.HIGH,
247
+ fontSize: 14,
248
+ fontFamily: 'Inter',
249
+ fontWeight: '600',
250
+ lineHeight: 20,
251
+ letterSpacing: 0.1,
252
+ },
253
+ emptyView: {
254
+ height: 160,
255
+ alignItems: 'center',
256
+ justifyContent: 'center',
257
+ },
258
+ audioDeviceItem: {
259
+ flexDirection: 'row',
260
+ alignItems: 'center',
261
+ justifyContent: 'space-between',
262
+ paddingVertical: 20,
263
+ },
264
+ divider: {
265
+ height: 1,
266
+ backgroundColor: COLORS.BORDER.DEFAULT,
267
+ },
268
+ });
269
+
270
+ const getIcon = (ofDevice: HMSAudioDevice) => {
271
+ switch (ofDevice) {
272
+ case HMSAudioDevice.AUTOMATIC:
273
+ return <WaveIcon />;
274
+ case HMSAudioDevice.BLUETOOTH:
275
+ return <BluetoothIcon />;
276
+ case HMSAudioDevice.EARPIECE:
277
+ return <AnswerPhoneIcon />;
278
+ case HMSAudioDevice.SPEAKER_PHONE:
279
+ return <SpeakerIcon muted={false} />;
280
+ case HMSAudioDevice.WIRED_HEADSET:
281
+ return <HeadphonesIcon />;
282
+ }
283
+ };
284
+
285
+ const getDescription = (
286
+ ofDevice: HMSAudioDevice,
287
+ currentDevice: HMSAudioDevice | null
288
+ ): string => {
289
+ switch (ofDevice) {
290
+ case HMSAudioDevice.AUTOMATIC:
291
+ return currentDevice && currentDevice !== HMSAudioDevice.AUTOMATIC
292
+ ? `Default (${getDescription(currentDevice, currentDevice)})`
293
+ : 'Automatic';
294
+ case HMSAudioDevice.BLUETOOTH:
295
+ return 'Bluetooth Device';
296
+ case HMSAudioDevice.EARPIECE:
297
+ return 'Phone';
298
+ case HMSAudioDevice.SPEAKER_PHONE:
299
+ return 'Speaker';
300
+ case HMSAudioDevice.WIRED_HEADSET:
301
+ return 'Earphone';
302
+ }
303
+ };
304
+
305
+ const audioDeviceSortOrder = {
306
+ [HMSAudioDevice.AUTOMATIC]: 0,
307
+ [HMSAudioDevice.SPEAKER_PHONE]: 1,
308
+ [HMSAudioDevice.WIRED_HEADSET]: 2,
309
+ [HMSAudioDevice.EARPIECE]: 3,
310
+ [HMSAudioDevice.BLUETOOTH]: 4,
311
+ } as const;
@@ -1,15 +1,12 @@
1
- import { useNavigation } from '@react-navigation/native';
2
1
  import * as React from 'react';
3
2
  import { StyleSheet, Text, TouchableOpacity, View } from 'react-native';
4
3
  import Modal from 'react-native-modal';
5
4
  import { useSafeAreaInsets } from 'react-native-safe-area-context';
6
- import Toast from 'react-native-simple-toast';
7
- import { useDispatch, useSelector } from 'react-redux';
5
+ import { useSelector } from 'react-redux';
8
6
 
9
7
  import { AlertIcon, LeaveIcon } from '../Icons';
10
- import { useHMSInstance } from '../hooks-util';
8
+ import { useLeaveMethods } from '../hooks-util';
11
9
  import type { RootState } from '../redux';
12
- import { clearStore } from '../redux/actions';
13
10
  import { COLORS } from '../utils/theme';
14
11
  import { ModalTypes } from '../utils/types';
15
12
  import { DefaultModal } from './DefaultModal';
@@ -36,10 +33,6 @@ type LeaveButtonProps =
36
33
  };
37
34
 
38
35
  const LeaveButton: React.FC<LeaveButtonProps> = (props) => {
39
- // TODO: What if useNavigation context is undefined?
40
- const navigation = useNavigation();
41
- const hmsInstance = useHMSInstance();
42
- const dispatch = useDispatch();
43
36
  const leavePopCloseAction = React.useRef(ModalTypes.DEFAULT);
44
37
 
45
38
  const [leavePopVisible, setLeavePopVisible] = React.useState(false);
@@ -97,71 +90,7 @@ const LeaveButton: React.FC<LeaveButtonProps> = (props) => {
97
90
 
98
91
  const dismissModal = () => setLeaveModalType(ModalTypes.DEFAULT);
99
92
 
100
- const destroy = () => {
101
- hmsInstance
102
- .destroy()
103
- .then((s) => {
104
- console.log('Destroy Success: ', s);
105
- // TODOS:
106
- // - If show `Meeting_Ended` is true, show Meeting screen by setting state to MEETING_ENDED
107
- // - Reset Redux States
108
- // - HMSInstance will not be available now
109
- // - When your presses "Re Join" Action button, restart process from root component
110
- // - When your presses "Done" Action button
111
- // - If we have callback fn, call it
112
- // - Otherwise try our best to navigate away from current screen
113
- //
114
- // - No screen to show
115
- // - No need to reset redux state?
116
- // - HMSInstance will be available till this point
117
- // - If we have callback fn, call it
118
- // - Otherwise try our best to navigate away from current screen
119
- // - When we are navigated away from screen, HMSInstance will be not available
120
-
121
- // dispatch(clearMessageData());
122
- // dispatch(clearPeerData());
123
- // dispatch(clearHmsReference());
124
-
125
- // if (navigation.canGoBack()) {
126
- // navigation.goBack();
127
- // } else {
128
- // TODO: remove this later
129
- navigation.navigate('QRCodeScreen' as never);
130
- dispatch(clearStore());
131
- // }
132
- })
133
- .catch((e) => {
134
- console.log(`Destroy HMS instance Error: ${e}`);
135
- Toast.showWithGravity(
136
- `Destroy HMS instance Error: ${e}`,
137
- Toast.LONG,
138
- Toast.TOP
139
- );
140
- });
141
- };
142
-
143
- const onLeavePress = () => {
144
- hmsInstance
145
- .leave()
146
- .then((d) => {
147
- console.log('Leave Success: ', d);
148
- destroy();
149
- })
150
- .catch((e) => {
151
- console.log(`Leave Room Error: ${e}`);
152
- Toast.showWithGravity(`Leave Room Error: ${e}`, Toast.LONG, Toast.TOP);
153
- });
154
- };
155
-
156
- const onEndRoomPress = () => {
157
- hmsInstance
158
- .endRoom('Host ended the room')
159
- .then((d) => {
160
- console.log('EndRoom Success: ', d);
161
- destroy();
162
- })
163
- .catch((e) => console.log('EndRoom Error: ', e));
164
- };
93
+ const { leave, endRoom } = useLeaveMethods();
165
94
 
166
95
  const leaveIconDelegate =
167
96
  'leaveIconDelegate' in props && props.leaveIconDelegate ? (
@@ -197,7 +126,7 @@ const LeaveButton: React.FC<LeaveButtonProps> = (props) => {
197
126
  modalVisible={leaveModalType === ModalTypes.LEAVE_ROOM}
198
127
  setModalVisible={dismissModal}
199
128
  >
200
- <LeaveRoomModal onSuccess={onLeavePress} cancelModal={dismissModal} />
129
+ <LeaveRoomModal onSuccess={leave} cancelModal={dismissModal} />
201
130
  </DefaultModal>
202
131
 
203
132
  <DefaultModal
@@ -205,7 +134,7 @@ const LeaveButton: React.FC<LeaveButtonProps> = (props) => {
205
134
  modalVisible={leaveModalType === ModalTypes.END_ROOM}
206
135
  setModalVisible={dismissModal}
207
136
  >
208
- <EndRoomModal onSuccess={onEndRoomPress} cancelModal={dismissModal} />
137
+ <EndRoomModal onSuccess={endRoom} cancelModal={dismissModal} />
209
138
  </DefaultModal>
210
139
  </View>
211
140
  );
@@ -272,7 +201,7 @@ const LeavePopup: React.FC<LeavePopupProps> = ({
272
201
  onPress={onLeavePress}
273
202
  >
274
203
  <LeaveIcon style={leavePopupStyles.leaveButtonIcon} />
275
- <Text style={leavePopupStyles.leaveButtonText}>Leave</Text>
204
+ <Text style={leavePopupStyles.leaveButtonText}>Leave Studio</Text>
276
205
  </TouchableOpacity>
277
206
 
278
207
  {canEndRoom ? (
@@ -0,0 +1,29 @@
1
+ import * as React from 'react';
2
+ import { Text, StyleSheet } from 'react-native';
3
+ import { SafeAreaView } from 'react-native-safe-area-context';
4
+
5
+ import { COLORS } from '../utils/theme';
6
+
7
+ export const HMSMeetingEnded = () => {
8
+ return (
9
+ <SafeAreaView style={styles.container}>
10
+ <Text style={styles.title}>Meeting Ended</Text>
11
+ </SafeAreaView>
12
+ );
13
+ };
14
+
15
+ const styles = StyleSheet.create({
16
+ container: {
17
+ flex: 1,
18
+ backgroundColor: COLORS.BACKGROUND.DIM,
19
+ alignItems: 'center',
20
+ justifyContent: 'center',
21
+ },
22
+ title: {
23
+ color: COLORS.SURFACE.ON_SURFACE.HIGH,
24
+ fontSize: 24,
25
+ fontFamily: 'Inter',
26
+ fontWeight: '600',
27
+ lineHeight: 32,
28
+ },
29
+ });
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import { StyleSheet, TextInput } from 'react-native';
2
+ import { Platform, StyleSheet, TextInput } from 'react-native';
3
3
  import { useDispatch, useSelector } from 'react-redux';
4
4
 
5
5
  import { COLORS } from '../utils/theme';
@@ -11,13 +11,13 @@ export interface HMSPreviewEditNameProps {}
11
11
 
12
12
  export const HMSPreviewEditName: React.FC<HMSPreviewEditNameProps> = () => {
13
13
  const dispatch = useDispatch();
14
- const { clearConfig } = useHMSConfig();
14
+ const { updateConfig } = useHMSConfig();
15
15
  const userName = useSelector((state: RootState) => state.user.userName);
16
16
  const [inputFocused, setInputFocused] = React.useState(false);
17
17
 
18
18
  const handleNameChange = (name: string) => {
19
19
  dispatch(changeUsername(name));
20
- clearConfig();
20
+ updateConfig({ username: name });
21
21
  };
22
22
 
23
23
  const handleInputFocus = () => setInputFocused(true);
@@ -29,7 +29,7 @@ export const HMSPreviewEditName: React.FC<HMSPreviewEditNameProps> = () => {
29
29
  style={[styles.input, inputFocused ? styles.focusedInput : null]}
30
30
  value={userName}
31
31
  onChangeText={handleNameChange}
32
- placeholder="Name"
32
+ placeholder="Enter Name..."
33
33
  autoCapitalize="words"
34
34
  autoCompleteType="name"
35
35
  placeholderTextColor={COLORS.SURFACE.ON_SURFACE.LOW}
@@ -43,13 +43,14 @@ export const HMSPreviewEditName: React.FC<HMSPreviewEditNameProps> = () => {
43
43
  const styles = StyleSheet.create({
44
44
  input: {
45
45
  flex: 1,
46
+ height: 50,
46
47
  textAlignVertical: 'center',
47
48
  backgroundColor: COLORS.SURFACE.DEFAULT,
48
49
  paddingHorizontal: 16,
49
- paddingVertical: 12,
50
50
  borderRadius: 8,
51
51
  color: COLORS.SURFACE.ON_SURFACE.HIGH,
52
52
  fontSize: 16,
53
+ lineHeight: Platform.OS === 'android' ? 24 : undefined,
53
54
  fontFamily: 'Inter',
54
55
  fontWeight: '400',
55
56
  letterSpacing: 0.5,
@@ -0,0 +1,58 @@
1
+ import * as React from 'react';
2
+ import { View, Text, StyleSheet } from 'react-native';
3
+ import { useSelector } from 'react-redux';
4
+
5
+ import { COLORS } from '../utils/theme';
6
+ import type { RootState } from '../redux';
7
+
8
+ export const HMSPreviewHLSLiveIndicator = () => {
9
+ const isHLSStreaming = useSelector(
10
+ (state: RootState) => state.hmsStates.room?.hlsStreamingState?.running
11
+ );
12
+
13
+ if (!isHLSStreaming) {
14
+ return null;
15
+ }
16
+
17
+ return (
18
+ <View style={styles.container}>
19
+ <View style={styles.circleContainer}>
20
+ <View style={styles.circle} />
21
+ </View>
22
+ <Text style={styles.text}>LIVE</Text>
23
+ </View>
24
+ );
25
+ };
26
+
27
+ const styles = StyleSheet.create({
28
+ container: {
29
+ flexDirection: 'row',
30
+ alignItems: 'center',
31
+ borderRadius: 20,
32
+ backgroundColor: COLORS.ALERT.ERROR.DEFAULT,
33
+ paddingLeft: 8,
34
+ paddingRight: 12,
35
+ marginRight: 8,
36
+ },
37
+ circleContainer: {
38
+ width: 20,
39
+ height: 20,
40
+ alignItems: 'center',
41
+ justifyContent: 'center',
42
+ },
43
+ circle: {
44
+ width: 12,
45
+ height: 12,
46
+ borderRadius: 6,
47
+ backgroundColor: COLORS.WHITE,
48
+ },
49
+ text: {
50
+ marginLeft: 4,
51
+ color: COLORS.SURFACE.ON_SURFACE.HIGH,
52
+ fontSize: 14,
53
+ fontFamily: 'Inter',
54
+ fontWeight: '600',
55
+ lineHeight: 20,
56
+ letterSpacing: 0.25,
57
+ },
58
+ });
@@ -5,8 +5,12 @@ import {
5
5
  Text,
6
6
  TouchableHighlight,
7
7
  } from 'react-native';
8
+ import { useSelector } from 'react-redux';
8
9
 
9
10
  import { COLORS } from '../utils/theme';
11
+ import type { RootState } from '../redux';
12
+ import { RadioIcon } from '../Icons';
13
+ import { useShouldGoLive } from '../hooks-util';
10
14
 
11
15
  export interface HMSPreviewJoinButtonProps {
12
16
  onJoin(): void;
@@ -17,12 +21,20 @@ export const HMSPreviewJoinButton: React.FC<HMSPreviewJoinButtonProps> = ({
17
21
  loading,
18
22
  onJoin,
19
23
  }) => {
24
+ const userNameInvalid = useSelector(
25
+ (state: RootState) => state.user.userName.length <= 0
26
+ );
27
+
28
+ const shouldGoLive = useShouldGoLive();
29
+
30
+ const disabledJoin = userNameInvalid || loading;
31
+
20
32
  return (
21
33
  <TouchableHighlight
22
34
  underlayColor={COLORS.PRIMARY.DARK}
23
- style={styles.button}
35
+ style={[styles.button, disabledJoin ? styles.disabledButton : null]}
24
36
  onPress={onJoin}
25
- disabled={loading}
37
+ disabled={disabledJoin}
26
38
  >
27
39
  <>
28
40
  {loading ? (
@@ -33,8 +45,23 @@ export const HMSPreviewJoinButton: React.FC<HMSPreviewJoinButtonProps> = ({
33
45
  />
34
46
  ) : null}
35
47
 
36
- <Text style={[styles.text, { opacity: loading ? 0 : undefined }]}>
37
- {'Join'}
48
+ {shouldGoLive ? (
49
+ <RadioIcon
50
+ style={[
51
+ loading ? styles.hiddenView : null,
52
+ disabledJoin ? styles.disabledIcon : null,
53
+ ]}
54
+ />
55
+ ) : null}
56
+
57
+ <Text
58
+ style={[
59
+ styles.text,
60
+ loading ? styles.hiddenView : null,
61
+ disabledJoin ? styles.disabledText : null,
62
+ ]}
63
+ >
64
+ {shouldGoLive ? 'Go Live' : 'Join Now'}
38
65
  </Text>
39
66
  </>
40
67
  </TouchableHighlight>
@@ -43,6 +70,7 @@ export const HMSPreviewJoinButton: React.FC<HMSPreviewJoinButtonProps> = ({
43
70
 
44
71
  const styles = StyleSheet.create({
45
72
  button: {
73
+ flexDirection: 'row',
46
74
  paddingHorizontal: 16,
47
75
  paddingVertical: 8,
48
76
  borderRadius: 8,
@@ -61,4 +89,16 @@ const styles = StyleSheet.create({
61
89
  marginHorizontal: 8,
62
90
  },
63
91
  loader: { position: 'absolute' },
92
+ disabledButton: {
93
+ backgroundColor: COLORS.PRIMARY.DISABLED,
94
+ },
95
+ disabledIcon: {
96
+ tintColor: COLORS.PRIMARY.ON_PRIMARY.LOW,
97
+ },
98
+ disabledText: {
99
+ color: COLORS.PRIMARY.ON_PRIMARY.LOW,
100
+ },
101
+ hiddenView: {
102
+ opacity: 0,
103
+ },
64
104
  });
@@ -0,0 +1,40 @@
1
+ import * as React from 'react';
2
+ import { View, StyleSheet } from 'react-native';
3
+ import { useSelector } from 'react-redux';
4
+
5
+ import { NetworkQualityIcon } from '../Icons';
6
+ import { COLORS } from '..//utils/theme';
7
+ import type { RootState } from '../redux';
8
+ import { useHMSInstance } from '../hooks-util';
9
+
10
+ export const HMSPreviewNetworkQuality = () => {
11
+ const hmsInstance = useHMSInstance();
12
+ const localPeerNetworkQuality = useSelector(
13
+ (state: RootState) =>
14
+ state.hmsStates.localPeer?.networkQuality?.downlinkQuality
15
+ );
16
+
17
+ React.useEffect(() => {
18
+ hmsInstance.enableNetworkQualityUpdates();
19
+
20
+ return () => hmsInstance.disableNetworkQualityUpdates();
21
+ }, []);
22
+
23
+ return (
24
+ <View style={styles.container}>
25
+ <NetworkQualityIcon quality={localPeerNetworkQuality} />
26
+ </View>
27
+ );
28
+ };
29
+
30
+ const styles = StyleSheet.create({
31
+ container: {
32
+ marginLeft: 8,
33
+ marginBottom: 8,
34
+ borderRadius: 8,
35
+ paddingVertical: 4,
36
+ paddingHorizontal: 8,
37
+ backgroundColor: COLORS.BACKGROUND.DIM_80,
38
+ alignSelf: 'flex-start',
39
+ },
40
+ });