@100mslive/react-native-room-kit 0.0.3 → 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 (287) 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/Check/assets/check.png +0 -0
  8. package/lib/commonjs/Icons/Check/assets/check@2x.png +0 -0
  9. package/lib/commonjs/Icons/Check/assets/check@3x.png +0 -0
  10. package/lib/commonjs/Icons/Check/index.js +30 -0
  11. package/lib/commonjs/Icons/Check/index.js.map +1 -0
  12. package/lib/commonjs/Icons/Radio/assets/radio.png +0 -0
  13. package/lib/commonjs/Icons/Radio/assets/radio@2x.png +0 -0
  14. package/lib/commonjs/Icons/Radio/assets/radio@3x.png +0 -0
  15. package/lib/commonjs/Icons/Radio/index.js +30 -0
  16. package/lib/commonjs/Icons/Radio/index.js.map +1 -0
  17. package/lib/commonjs/Icons/index.js +22 -0
  18. package/lib/commonjs/Icons/index.js.map +1 -1
  19. package/lib/commonjs/components/BackButton.js +2 -2
  20. package/lib/commonjs/components/BackButton.js.map +1 -1
  21. package/lib/commonjs/components/DisplayView.js +0 -6
  22. package/lib/commonjs/components/DisplayView.js.map +1 -1
  23. package/lib/commonjs/components/HMSHLSStreamLoading.js +56 -0
  24. package/lib/commonjs/components/HMSHLSStreamLoading.js.map +1 -0
  25. package/lib/commonjs/components/HMSLocalVideoView.js +41 -0
  26. package/lib/commonjs/components/HMSLocalVideoView.js.map +1 -0
  27. package/lib/commonjs/components/{HMSSpeakerSettings.js → HMSManageAudioOutput.js} +41 -13
  28. package/lib/commonjs/components/HMSManageAudioOutput.js.map +1 -0
  29. package/lib/commonjs/components/HMSManageLeave.js +7 -60
  30. package/lib/commonjs/components/HMSManageLeave.js.map +1 -1
  31. package/lib/commonjs/components/HMSMeetingEnded.js +36 -0
  32. package/lib/commonjs/components/HMSMeetingEnded.js.map +1 -0
  33. package/lib/commonjs/components/HMSPreviewEditName.js +6 -3
  34. package/lib/commonjs/components/HMSPreviewEditName.js.map +1 -1
  35. package/lib/commonjs/components/HMSPreviewHLSLiveIndicator.js +64 -0
  36. package/lib/commonjs/components/HMSPreviewHLSLiveIndicator.js.map +1 -0
  37. package/lib/commonjs/components/HMSPreviewJoinButton.js +21 -9
  38. package/lib/commonjs/components/HMSPreviewJoinButton.js.map +1 -1
  39. package/lib/commonjs/components/HMSPreviewNetworkQuality.js +43 -0
  40. package/lib/commonjs/components/HMSPreviewNetworkQuality.js.map +1 -0
  41. package/lib/commonjs/components/HMSPreviewPeersList.js +2 -25
  42. package/lib/commonjs/components/HMSPreviewPeersList.js.map +1 -1
  43. package/lib/commonjs/components/HMSPreviewSubtitle.js +25 -2
  44. package/lib/commonjs/components/HMSPreviewSubtitle.js.map +1 -1
  45. package/lib/commonjs/components/HMSPreviewTile.js +2 -18
  46. package/lib/commonjs/components/HMSPreviewTile.js.map +1 -1
  47. package/lib/commonjs/components/HMSRoomOptions.js +2 -3
  48. package/lib/commonjs/components/HMSRoomOptions.js.map +1 -1
  49. package/lib/commonjs/components/HMSShowNetworkQuality.js +0 -2
  50. package/lib/commonjs/components/HMSShowNetworkQuality.js.map +1 -1
  51. package/lib/commonjs/components/Meeting.js +7 -0
  52. package/lib/commonjs/components/Meeting.js.map +1 -1
  53. package/lib/commonjs/components/MenuModal/Menu.js +1 -2
  54. package/lib/commonjs/components/MenuModal/Menu.js.map +1 -1
  55. package/lib/commonjs/components/Modals.js +39 -299
  56. package/lib/commonjs/components/Modals.js.map +1 -1
  57. package/lib/commonjs/components/Participants/ParticipantsList.js +1 -20
  58. package/lib/commonjs/components/Participants/ParticipantsList.js.map +1 -1
  59. package/lib/commonjs/components/PeerSettingsModalContent.js +2 -13
  60. package/lib/commonjs/components/PeerSettingsModalContent.js.map +1 -1
  61. package/lib/commonjs/components/Preview.js +79 -71
  62. package/lib/commonjs/components/Preview.js.map +1 -1
  63. package/lib/commonjs/components/RoomSettingsModalContent.js +2 -101
  64. package/lib/commonjs/components/RoomSettingsModalContent.js.map +1 -1
  65. package/lib/commonjs/components/index.js +0 -11
  66. package/lib/commonjs/components/index.js.map +1 -1
  67. package/lib/commonjs/hooks/useHmsInstance.js +0 -1
  68. package/lib/commonjs/hooks/useHmsInstance.js.map +1 -1
  69. package/lib/commonjs/hooks-util-selectors.js +8 -1
  70. package/lib/commonjs/hooks-util-selectors.js.map +1 -1
  71. package/lib/commonjs/hooks-util.js +129 -28
  72. package/lib/commonjs/hooks-util.js.map +1 -1
  73. package/lib/commonjs/redux/actionTypes.js +5 -1
  74. package/lib/commonjs/redux/actionTypes.js.map +1 -1
  75. package/lib/commonjs/redux/actions/index.js +15 -1
  76. package/lib/commonjs/redux/actions/index.js.map +1 -1
  77. package/lib/commonjs/redux/reducers/appState.js +14 -1
  78. package/lib/commonjs/redux/reducers/appState.js.map +1 -1
  79. package/lib/commonjs/utils/theme.js +1 -0
  80. package/lib/commonjs/utils/theme.js.map +1 -1
  81. package/lib/commonjs/utils/types.js +0 -1
  82. package/lib/commonjs/utils/types.js.map +1 -1
  83. package/lib/commonjs/utils.js +2 -2
  84. package/lib/commonjs/utils.js.map +1 -1
  85. package/lib/module/HMSInstanceSetup.js +1 -14
  86. package/lib/module/HMSInstanceSetup.js.map +1 -1
  87. package/lib/module/HMSPrebuilt.js +13 -3
  88. package/lib/module/HMSPrebuilt.js.map +1 -1
  89. package/lib/module/HMSRoomSetup.js +43 -19
  90. package/lib/module/HMSRoomSetup.js.map +1 -1
  91. package/lib/module/Icons/Check/assets/check.png +0 -0
  92. package/lib/module/Icons/Check/assets/check@2x.png +0 -0
  93. package/lib/module/Icons/Check/assets/check@3x.png +0 -0
  94. package/lib/module/Icons/Check/index.js +22 -0
  95. package/lib/module/Icons/Check/index.js.map +1 -0
  96. package/lib/module/Icons/Radio/assets/radio.png +0 -0
  97. package/lib/module/Icons/Radio/assets/radio@2x.png +0 -0
  98. package/lib/module/Icons/Radio/assets/radio@3x.png +0 -0
  99. package/lib/module/Icons/Radio/index.js +22 -0
  100. package/lib/module/Icons/Radio/index.js.map +1 -0
  101. package/lib/module/Icons/index.js +2 -0
  102. package/lib/module/Icons/index.js.map +1 -1
  103. package/lib/module/components/BackButton.js +3 -3
  104. package/lib/module/components/BackButton.js.map +1 -1
  105. package/lib/module/components/DisplayView.js +1 -7
  106. package/lib/module/components/DisplayView.js.map +1 -1
  107. package/lib/module/components/HMSHLSStreamLoading.js +47 -0
  108. package/lib/module/components/HMSHLSStreamLoading.js.map +1 -0
  109. package/lib/module/components/HMSLocalVideoView.js +32 -0
  110. package/lib/module/components/HMSLocalVideoView.js.map +1 -0
  111. package/lib/module/components/{HMSSpeakerSettings.js → HMSManageAudioOutput.js} +40 -12
  112. package/lib/module/components/HMSManageAudioOutput.js.map +1 -0
  113. package/lib/module/components/HMSManageLeave.js +9 -62
  114. package/lib/module/components/HMSManageLeave.js.map +1 -1
  115. package/lib/module/components/HMSMeetingEnded.js +27 -0
  116. package/lib/module/components/HMSMeetingEnded.js.map +1 -0
  117. package/lib/module/components/HMSPreviewEditName.js +7 -4
  118. package/lib/module/components/HMSPreviewEditName.js.map +1 -1
  119. package/lib/module/components/HMSPreviewHLSLiveIndicator.js +55 -0
  120. package/lib/module/components/HMSPreviewHLSLiveIndicator.js.map +1 -0
  121. package/lib/module/components/HMSPreviewJoinButton.js +21 -9
  122. package/lib/module/components/HMSPreviewJoinButton.js.map +1 -1
  123. package/lib/module/components/HMSPreviewNetworkQuality.js +34 -0
  124. package/lib/module/components/HMSPreviewNetworkQuality.js.map +1 -0
  125. package/lib/module/components/HMSPreviewPeersList.js +2 -25
  126. package/lib/module/components/HMSPreviewPeersList.js.map +1 -1
  127. package/lib/module/components/HMSPreviewSubtitle.js +25 -2
  128. package/lib/module/components/HMSPreviewSubtitle.js.map +1 -1
  129. package/lib/module/components/HMSPreviewTile.js +2 -18
  130. package/lib/module/components/HMSPreviewTile.js.map +1 -1
  131. package/lib/module/components/HMSRoomOptions.js +2 -3
  132. package/lib/module/components/HMSRoomOptions.js.map +1 -1
  133. package/lib/module/components/HMSShowNetworkQuality.js +0 -2
  134. package/lib/module/components/HMSShowNetworkQuality.js.map +1 -1
  135. package/lib/module/components/Meeting.js +7 -0
  136. package/lib/module/components/Meeting.js.map +1 -1
  137. package/lib/module/components/MenuModal/Menu.js +1 -2
  138. package/lib/module/components/MenuModal/Menu.js.map +1 -1
  139. package/lib/module/components/Modals.js +40 -298
  140. package/lib/module/components/Modals.js.map +1 -1
  141. package/lib/module/components/Participants/ParticipantsList.js +1 -20
  142. package/lib/module/components/Participants/ParticipantsList.js.map +1 -1
  143. package/lib/module/components/PeerSettingsModalContent.js +2 -13
  144. package/lib/module/components/PeerSettingsModalContent.js.map +1 -1
  145. package/lib/module/components/Preview.js +79 -71
  146. package/lib/module/components/Preview.js.map +1 -1
  147. package/lib/module/components/RoomSettingsModalContent.js +3 -100
  148. package/lib/module/components/RoomSettingsModalContent.js.map +1 -1
  149. package/lib/module/components/index.js +0 -1
  150. package/lib/module/components/index.js.map +1 -1
  151. package/lib/module/hooks/useHmsInstance.js +0 -1
  152. package/lib/module/hooks/useHmsInstance.js.map +1 -1
  153. package/lib/module/hooks-util-selectors.js +6 -0
  154. package/lib/module/hooks-util-selectors.js.map +1 -1
  155. package/lib/module/hooks-util.js +131 -32
  156. package/lib/module/hooks-util.js.map +1 -1
  157. package/lib/module/redux/actionTypes.js +5 -1
  158. package/lib/module/redux/actionTypes.js.map +1 -1
  159. package/lib/module/redux/actions/index.js +12 -0
  160. package/lib/module/redux/actions/index.js.map +1 -1
  161. package/lib/module/redux/reducers/appState.js +14 -1
  162. package/lib/module/redux/reducers/appState.js.map +1 -1
  163. package/lib/module/utils/theme.js +1 -0
  164. package/lib/module/utils/theme.js.map +1 -1
  165. package/lib/module/utils/types.js +0 -1
  166. package/lib/module/utils/types.js.map +1 -1
  167. package/lib/module/utils.js +2 -2
  168. package/lib/module/utils.js.map +1 -1
  169. package/lib/typescript/HMSInstanceSetup.d.ts.map +1 -1
  170. package/lib/typescript/HMSPrebuilt.d.ts +2 -3
  171. package/lib/typescript/HMSPrebuilt.d.ts.map +1 -1
  172. package/lib/typescript/HMSRoomSetup.d.ts.map +1 -1
  173. package/lib/typescript/Icons/Check/index.d.ts +7 -0
  174. package/lib/typescript/Icons/Check/index.d.ts.map +1 -0
  175. package/lib/typescript/Icons/Radio/index.d.ts +7 -0
  176. package/lib/typescript/Icons/Radio/index.d.ts.map +1 -0
  177. package/lib/typescript/Icons/index.d.ts +2 -0
  178. package/lib/typescript/Icons/index.d.ts.map +1 -1
  179. package/lib/typescript/components/CustomInput.d.ts +1 -1
  180. package/lib/typescript/components/DisplayView.d.ts.map +1 -1
  181. package/lib/typescript/components/HMSHLSStreamLoading.d.ts +3 -0
  182. package/lib/typescript/components/HMSHLSStreamLoading.d.ts.map +1 -0
  183. package/lib/typescript/components/HMSLocalVideoView.d.ts +3 -0
  184. package/lib/typescript/components/HMSLocalVideoView.d.ts.map +1 -0
  185. package/lib/typescript/components/HMSManageAudioOutput.d.ts +3 -0
  186. package/lib/typescript/components/HMSManageAudioOutput.d.ts.map +1 -0
  187. package/lib/typescript/components/HMSManageLeave.d.ts.map +1 -1
  188. package/lib/typescript/components/HMSMeetingEnded.d.ts +3 -0
  189. package/lib/typescript/components/HMSMeetingEnded.d.ts.map +1 -0
  190. package/lib/typescript/components/HMSPreviewHLSLiveIndicator.d.ts +3 -0
  191. package/lib/typescript/components/HMSPreviewHLSLiveIndicator.d.ts.map +1 -0
  192. package/lib/typescript/components/HMSPreviewJoinButton.d.ts.map +1 -1
  193. package/lib/typescript/components/HMSPreviewNetworkQuality.d.ts +3 -0
  194. package/lib/typescript/components/HMSPreviewNetworkQuality.d.ts.map +1 -0
  195. package/lib/typescript/components/HMSPreviewPeersList.d.ts.map +1 -1
  196. package/lib/typescript/components/HMSPreviewSubtitle.d.ts.map +1 -1
  197. package/lib/typescript/components/HMSPreviewTile.d.ts.map +1 -1
  198. package/lib/typescript/components/HMSRoomOptions.d.ts.map +1 -1
  199. package/lib/typescript/components/HMSShowNetworkQuality.d.ts.map +1 -1
  200. package/lib/typescript/components/Meeting.d.ts.map +1 -1
  201. package/lib/typescript/components/MenuModal/Menu.d.ts.map +1 -1
  202. package/lib/typescript/components/Modals.d.ts +1 -9
  203. package/lib/typescript/components/Modals.d.ts.map +1 -1
  204. package/lib/typescript/components/Participants/ParticipantsList.d.ts.map +1 -1
  205. package/lib/typescript/components/PeerSettingsModalContent.d.ts.map +1 -1
  206. package/lib/typescript/components/Preview.d.ts.map +1 -1
  207. package/lib/typescript/components/RoomSettingsModalContent.d.ts.map +1 -1
  208. package/lib/typescript/components/index.d.ts +0 -1
  209. package/lib/typescript/components/index.d.ts.map +1 -1
  210. package/lib/typescript/hooks-util-selectors.d.ts +2 -0
  211. package/lib/typescript/hooks-util-selectors.d.ts.map +1 -1
  212. package/lib/typescript/hooks-util.d.ts +9 -2
  213. package/lib/typescript/hooks-util.d.ts.map +1 -1
  214. package/lib/typescript/redux/actionTypes.d.ts +2 -0
  215. package/lib/typescript/redux/actionTypes.d.ts.map +1 -1
  216. package/lib/typescript/redux/actions/index.d.ts +16 -3
  217. package/lib/typescript/redux/actions/index.d.ts.map +1 -1
  218. package/lib/typescript/redux/index.d.ts +3 -1
  219. package/lib/typescript/redux/index.d.ts.map +1 -1
  220. package/lib/typescript/redux/reducers/appState.d.ts +3 -0
  221. package/lib/typescript/redux/reducers/appState.d.ts.map +1 -1
  222. package/lib/typescript/redux/reducers/index.d.ts +3 -1
  223. package/lib/typescript/redux/reducers/index.d.ts.map +1 -1
  224. package/lib/typescript/redux/reducers/userState.d.ts +2 -2
  225. package/lib/typescript/redux/reducers/userState.d.ts.map +1 -1
  226. package/lib/typescript/utils/theme.d.ts +1 -0
  227. package/lib/typescript/utils/theme.d.ts.map +1 -1
  228. package/lib/typescript/utils/types.d.ts +3 -4
  229. package/lib/typescript/utils/types.d.ts.map +1 -1
  230. package/package.json +9 -16
  231. package/src/HMSInstanceSetup.tsx +4 -31
  232. package/src/HMSPrebuilt.tsx +24 -6
  233. package/src/HMSRoomSetup.tsx +55 -17
  234. package/src/Icons/Check/assets/check.png +0 -0
  235. package/src/Icons/Check/assets/check@2x.png +0 -0
  236. package/src/Icons/Check/assets/check@3x.png +0 -0
  237. package/src/Icons/Check/index.tsx +27 -0
  238. package/src/Icons/Radio/assets/radio.png +0 -0
  239. package/src/Icons/Radio/assets/radio@2x.png +0 -0
  240. package/src/Icons/Radio/assets/radio@3x.png +0 -0
  241. package/src/Icons/Radio/index.tsx +27 -0
  242. package/src/Icons/index.ts +2 -0
  243. package/src/components/BackButton.tsx +3 -3
  244. package/src/components/DisplayView.tsx +0 -10
  245. package/src/components/HMSHLSStreamLoading.tsx +57 -0
  246. package/src/components/HMSLocalVideoView.tsx +42 -0
  247. package/src/components/{HMSSpeakerSettings.tsx → HMSManageAudioOutput.tsx} +69 -17
  248. package/src/components/HMSManageLeave.tsx +6 -77
  249. package/src/components/HMSMeetingEnded.tsx +29 -0
  250. package/src/components/HMSPreviewEditName.tsx +5 -4
  251. package/src/components/HMSPreviewHLSLiveIndicator.tsx +58 -0
  252. package/src/components/HMSPreviewJoinButton.tsx +30 -7
  253. package/src/components/HMSPreviewNetworkQuality.tsx +40 -0
  254. package/src/components/HMSPreviewPeersList.tsx +7 -46
  255. package/src/components/HMSPreviewSubtitle.tsx +26 -2
  256. package/src/components/HMSPreviewTile.tsx +2 -24
  257. package/src/components/HMSRoomOptions.tsx +2 -8
  258. package/src/components/HMSShowNetworkQuality.tsx +0 -1
  259. package/src/components/Meeting.tsx +11 -0
  260. package/src/components/MenuModal/Menu.tsx +1 -1
  261. package/src/components/Modals.tsx +4 -299
  262. package/src/components/Participants/ParticipantsList.tsx +0 -24
  263. package/src/components/PeerSettingsModalContent.tsx +9 -23
  264. package/src/components/Preview.tsx +129 -101
  265. package/src/components/RoomSettingsModalContent.tsx +1 -138
  266. package/src/components/index.ts +0 -1
  267. package/src/hooks/useHmsInstance.ts +0 -1
  268. package/src/hooks-util-selectors.tsx +10 -0
  269. package/src/hooks-util.ts +155 -42
  270. package/src/redux/actionTypes.ts +6 -0
  271. package/src/redux/actions/index.ts +13 -2
  272. package/src/redux/reducers/appState.ts +9 -0
  273. package/src/redux/reducers/userState.ts +2 -2
  274. package/src/utils/theme.ts +1 -0
  275. package/src/utils/types.ts +3 -4
  276. package/src/utils.ts +2 -2
  277. package/lib/commonjs/components/HMSSpeakerSettings.js.map +0 -1
  278. package/lib/commonjs/components/ZoomableView.js +0 -84
  279. package/lib/commonjs/components/ZoomableView.js.map +0 -1
  280. package/lib/module/components/HMSSpeakerSettings.js.map +0 -1
  281. package/lib/module/components/ZoomableView.js +0 -76
  282. package/lib/module/components/ZoomableView.js.map +0 -1
  283. package/lib/typescript/components/HMSSpeakerSettings.d.ts +0 -3
  284. package/lib/typescript/components/HMSSpeakerSettings.d.ts.map +0 -1
  285. package/lib/typescript/components/ZoomableView.d.ts +0 -6
  286. package/lib/typescript/components/ZoomableView.d.ts.map +0 -1
  287. package/src/components/ZoomableView.tsx +0 -91
@@ -1,7 +1,14 @@
1
- import React, { useEffect } from 'react';
2
- import { StyleSheet, View } from 'react-native';
3
- import { AvoidSoftInput } from 'react-native-avoid-softinput';
4
- import { useSelector } from 'react-redux';
1
+ import React from 'react';
2
+ import {
3
+ Keyboard,
4
+ StyleSheet,
5
+ TouchableWithoutFeedback,
6
+ View,
7
+ } from 'react-native';
8
+ import Animated, {
9
+ useAnimatedStyle,
10
+ useAnimatedKeyboard,
11
+ } from 'react-native-reanimated';
5
12
  import { SafeAreaView } from 'react-native-safe-area-context';
6
13
  import LinearGradient from 'react-native-linear-gradient';
7
14
 
@@ -17,9 +24,23 @@ import { HMSPreviewPeersList } from './HMSPreviewPeersList';
17
24
  import { HMSPreviewSubtitle } from './HMSPreviewSubtitle';
18
25
  import { HMSPreviewTile } from './HMSPreviewTile';
19
26
  import { HMSPreviewTitle } from './HMSPreviewTitle';
20
- import { HMSSpeakerSettings } from './HMSSpeakerSettings';
21
- import { GenericLogoIcon, NetworkQualityIcon } from '../Icons';
22
- import type { RootState } from '../redux';
27
+ import { HMSManageAudioOutput } from './HMSManageAudioOutput';
28
+ import { HMSPreviewNetworkQuality } from './HMSPreviewNetworkQuality';
29
+ import { useCanPublishVideo } from '../hooks-sdk';
30
+ import { HMSPreviewHLSLiveIndicator } from './HMSPreviewHLSLiveIndicator';
31
+
32
+ const backButtonEdges = ['top'] as const;
33
+ const headerEdges = ['top', 'left', 'right'] as const;
34
+
35
+ const gradientColorShades = [
36
+ '#000000',
37
+ 'rgba(0, 0, 0, 0.9)',
38
+ 'rgba(0, 0, 0, 0.7)',
39
+ 'rgba(0, 0, 0, 0.1)',
40
+ 'rgba(0, 0, 0, 0.05)',
41
+ 'rgba(0, 0, 0, 0)',
42
+ ];
43
+ const gradientColorShadeLocations = [0.45, 0.55, 0.7, 0.9, 0.95, 1];
23
44
 
24
45
  export const Preview = ({
25
46
  join,
@@ -28,114 +49,82 @@ export const Preview = ({
28
49
  join(): void;
29
50
  loadingButtonState: boolean;
30
51
  }) => {
31
- const localPeerNetworkQuality = useSelector(
32
- (state: RootState) =>
33
- state.hmsStates.localPeer?.networkQuality?.downlinkQuality
34
- );
35
-
36
- useEffect(() => {
37
- AvoidSoftInput.setAdjustNothing();
38
- AvoidSoftInput.setEnabled(true);
52
+ const canPublishVideo = useCanPublishVideo();
53
+ const animatedKeyboard = useAnimatedKeyboard();
39
54
 
40
- return () => AvoidSoftInput.setEnabled(false);
41
- }, []);
55
+ const keyboardAvoidStyle = useAnimatedStyle(() => {
56
+ return {
57
+ transform: [{ translateY: -animatedKeyboard.height.value }],
58
+ };
59
+ });
42
60
 
43
61
  return (
44
- <View style={styles.container}>
45
- <HMSPreviewTile />
46
-
47
- <LinearGradient
48
- colors={[
49
- '#000000',
50
- 'rgba(0, 0, 0, 0.9)',
51
- 'rgba(0, 0, 0, 0.7)',
52
- 'rgba(0, 0, 0, 0.1)',
53
- 'rgba(0, 0, 0, 0.05)',
54
- 'rgba(0, 0, 0, 0)',
55
- ]}
56
- locations={[0.45, 0.55, 0.7, 0.9, 0.95, 1]}
57
- style={{
58
- position: 'absolute',
59
- top: 0,
60
- width: '100%',
61
- height: 260,
62
- }}
63
- />
64
-
65
- <SafeAreaView
66
- style={{ position: 'absolute', top: 0, width: '100%', marginTop: 24 }}
67
- edges={['top', 'left', 'right']}
68
- mode="margin"
69
- >
70
- <GenericLogoIcon style={{ alignSelf: 'center', marginBottom: 16 }} />
71
-
72
- <HMSPreviewTitle />
73
-
74
- <HMSPreviewSubtitle />
75
-
76
- <HMSPreviewPeersList />
77
- </SafeAreaView>
78
-
79
- <SafeAreaView
80
- style={{ position: 'absolute', top: 0 }}
81
- edges={['top']}
82
- mode="margin"
83
- >
84
- <BackButton />
85
- </SafeAreaView>
86
-
87
- <View
88
- style={{
89
- position: 'absolute',
90
- bottom: 0,
91
- width: '100%',
92
- }}
93
- >
94
- <View
95
- style={{
96
- marginLeft: 8,
97
- marginBottom: 8,
98
- borderRadius: 8,
99
- paddingVertical: 4,
100
- paddingHorizontal: 8,
101
- backgroundColor: COLORS.BACKGROUND.DIM_80,
102
- alignSelf: 'flex-start',
103
- }}
62
+ <TouchableWithoutFeedback onPress={Keyboard.dismiss}>
63
+ <View style={styles.container}>
64
+ {canPublishVideo ? <HMSPreviewTile /> : null}
65
+
66
+ {canPublishVideo ? (
67
+ <LinearGradient
68
+ colors={gradientColorShades}
69
+ locations={gradientColorShadeLocations}
70
+ style={styles.headerGradient}
71
+ />
72
+ ) : null}
73
+
74
+ <SafeAreaView
75
+ style={canPublishVideo ? styles.header : null}
76
+ edges={headerEdges}
77
+ mode="margin"
104
78
  >
105
- <NetworkQualityIcon quality={localPeerNetworkQuality} />
106
- </View>
79
+ <HMSPreviewTitle />
80
+
81
+ <HMSPreviewSubtitle />
82
+
83
+ <View style={styles.peerListWrapper}>
84
+ <HMSPreviewHLSLiveIndicator />
85
+
86
+ <HMSPreviewPeersList />
87
+ </View>
88
+ </SafeAreaView>
107
89
 
108
- <View
109
- style={{
110
- flex: 1,
111
- backgroundColor: COLORS.BACKGROUND.DEFAULT,
112
- borderTopLeftRadius: 16,
113
- borderTopRightRadius: 16,
114
- padding: 16,
115
- }}
90
+ <SafeAreaView
91
+ style={styles.backButtonContainer}
92
+ edges={backButtonEdges}
93
+ mode="margin"
116
94
  >
117
- <View style={styles.controlsContainer}>
118
- <View style={styles.micAndCameraControls}>
119
- <HMSManageLocalAudio />
95
+ <BackButton />
96
+ </SafeAreaView>
97
+
98
+ <View style={styles.footerWrapper}>
99
+ <HMSPreviewNetworkQuality />
100
+
101
+ <Animated.View style={[styles.footer, keyboardAvoidStyle]}>
102
+ <View style={styles.controlsContainer}>
103
+ <View style={styles.micAndCameraControls}>
104
+ <HMSManageLocalAudio />
120
105
 
121
- <View style={styles.manageLocalVideoWrapper}>
122
- <HMSManageLocalVideo />
106
+ <View style={styles.manageLocalVideoWrapper}>
107
+ <HMSManageLocalVideo />
108
+ </View>
109
+
110
+ <HMSManageCameraRotation />
123
111
  </View>
124
112
 
125
- <HMSManageCameraRotation />
113
+ <HMSManageAudioOutput />
126
114
  </View>
127
115
 
128
- <HMSSpeakerSettings />
129
- </View>
130
-
131
- <View style={styles.joinButtonRow}>
132
- <HMSPreviewEditName />
116
+ <View style={styles.joinButtonRow}>
117
+ <HMSPreviewEditName />
133
118
 
134
- <HMSPreviewJoinButton onJoin={join} loading={loadingButtonState} />
135
- </View>
119
+ <HMSPreviewJoinButton
120
+ onJoin={join}
121
+ loading={loadingButtonState}
122
+ />
123
+ </View>
124
+ </Animated.View>
136
125
  </View>
137
126
  </View>
138
- </View>
127
+ </TouchableWithoutFeedback>
139
128
  );
140
129
  };
141
130
 
@@ -144,12 +133,33 @@ const styles = StyleSheet.create({
144
133
  flex: 1,
145
134
  position: 'relative',
146
135
  backgroundColor: COLORS.BACKGROUND.DIM,
136
+ justifyContent: 'center',
137
+ },
138
+ header: {
139
+ position: 'absolute',
140
+ top: 0,
141
+ width: '100%',
142
+ marginTop: 24,
143
+ zIndex: 20,
144
+ alignItems: 'center',
145
+ },
146
+ headerGradient: {
147
+ position: 'absolute',
148
+ top: 0,
149
+ width: '100%',
150
+ height: 260,
151
+ zIndex: 10,
147
152
  },
148
153
  controlsContainer: {
149
154
  flexDirection: 'row',
150
155
  alignItems: 'center',
151
156
  justifyContent: 'space-between',
152
157
  },
158
+ peerListWrapper: {
159
+ flexDirection: 'row',
160
+ marginTop: 16,
161
+ alignSelf: 'center',
162
+ },
153
163
  micAndCameraControls: {
154
164
  flexDirection: 'row',
155
165
  },
@@ -160,4 +170,22 @@ const styles = StyleSheet.create({
160
170
  marginVertical: 16,
161
171
  flexDirection: 'row',
162
172
  },
173
+ backButtonContainer: {
174
+ position: 'absolute',
175
+ top: 0,
176
+ zIndex: 40,
177
+ },
178
+ footerWrapper: {
179
+ position: 'absolute',
180
+ bottom: 0,
181
+ width: '100%',
182
+ zIndex: 30,
183
+ },
184
+ footer: {
185
+ flex: 1,
186
+ backgroundColor: COLORS.BACKGROUND.DEFAULT,
187
+ borderTopLeftRadius: 16,
188
+ borderTopRightRadius: 16,
189
+ padding: 16,
190
+ },
163
191
  });
@@ -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
+ };