@100mslive/react-native-room-kit 1.0.1 → 1.0.2-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (262) hide show
  1. package/lib/commonjs/HMSPrebuilt.js +16 -14
  2. package/lib/commonjs/HMSPrebuilt.js.map +1 -1
  3. package/lib/commonjs/HMSRoomSetup.js +85 -44
  4. package/lib/commonjs/HMSRoomSetup.js.map +1 -1
  5. package/lib/commonjs/Icons/Hand/assets/hand-off.png +0 -0
  6. package/lib/commonjs/Icons/Hand/assets/hand-off@2x.png +0 -0
  7. package/lib/commonjs/Icons/Hand/assets/hand-off@3x.png +0 -0
  8. package/lib/commonjs/Icons/Hand/index.js +2 -1
  9. package/lib/commonjs/Icons/Hand/index.js.map +1 -1
  10. package/lib/commonjs/Icons/Recording/assets/recording-off.png +0 -0
  11. package/lib/commonjs/Icons/Recording/assets/recording-off@2x.png +0 -0
  12. package/lib/commonjs/Icons/Recording/assets/recording-off@3x.png +0 -0
  13. package/lib/commonjs/Icons/Recording/index.js +2 -1
  14. package/lib/commonjs/Icons/Recording/index.js.map +1 -1
  15. package/lib/commonjs/components/DisplayView.js +3 -1
  16. package/lib/commonjs/components/DisplayView.js.map +1 -1
  17. package/lib/commonjs/components/EndRoomModal.js +29 -0
  18. package/lib/commonjs/components/EndRoomModal.js.map +1 -0
  19. package/lib/commonjs/components/EndRoomModalContent.js +9 -2
  20. package/lib/commonjs/components/EndRoomModalContent.js.map +1 -1
  21. package/lib/commonjs/components/Footer.js +9 -1
  22. package/lib/commonjs/components/Footer.js.map +1 -1
  23. package/lib/commonjs/components/HMSKeyboardAvoidingView.js +3 -18
  24. package/lib/commonjs/components/HMSKeyboardAvoidingView.js.map +1 -1
  25. package/lib/commonjs/components/HMSLocalScreenshareNotification.js +2 -2
  26. package/lib/commonjs/components/HMSLocalScreenshareNotification.js.map +1 -1
  27. package/lib/commonjs/components/HMSManageLeave.js +3 -178
  28. package/lib/commonjs/components/HMSManageLeave.js.map +1 -1
  29. package/lib/commonjs/components/HMSNotification.js +4 -3
  30. package/lib/commonjs/components/HMSNotification.js.map +1 -1
  31. package/lib/commonjs/components/HMSNotifications.js +32 -6
  32. package/lib/commonjs/components/HMSNotifications.js.map +1 -1
  33. package/lib/commonjs/components/HMSOverlayChatView.js +7 -1
  34. package/lib/commonjs/components/HMSOverlayChatView.js.map +1 -1
  35. package/lib/commonjs/components/HMSReconnectingNotification.js +33 -0
  36. package/lib/commonjs/components/HMSReconnectingNotification.js.map +1 -0
  37. package/lib/commonjs/components/HMSRecordingIndicator.js +1 -1
  38. package/lib/commonjs/components/HMSRecordingIndicator.js.map +1 -1
  39. package/lib/commonjs/components/HMSTerminalErrorNotification.js +66 -0
  40. package/lib/commonjs/components/HMSTerminalErrorNotification.js.map +1 -0
  41. package/lib/commonjs/components/LeaveRoomBottomSheet.js +175 -0
  42. package/lib/commonjs/components/LeaveRoomBottomSheet.js.map +1 -0
  43. package/lib/commonjs/components/Meeting.js +4 -0
  44. package/lib/commonjs/components/Meeting.js.map +1 -1
  45. package/lib/commonjs/components/MeetingScreenContent.js +3 -2
  46. package/lib/commonjs/components/MeetingScreenContent.js.map +1 -1
  47. package/lib/commonjs/components/PIPView.js +80 -15
  48. package/lib/commonjs/components/PIPView.js.map +1 -1
  49. package/lib/commonjs/components/Participants/ParticipantsItemOptions.js +23 -1
  50. package/lib/commonjs/components/Participants/ParticipantsItemOptions.js.map +1 -1
  51. package/lib/commonjs/components/PeerVideoTile/AvatarView.js +4 -4
  52. package/lib/commonjs/components/PeerVideoTile/PeerAudioIndicator.js +3 -1
  53. package/lib/commonjs/components/PeerVideoTile/PeerAudioIndicator.js.map +1 -1
  54. package/lib/commonjs/components/PeerVideoTile/PeerVideoTileView.js +1 -1
  55. package/lib/commonjs/components/PeerVideoTile/PeerVideoTileView.js.map +1 -1
  56. package/lib/commonjs/components/PreviewForRoleChangeModal.js +2 -2
  57. package/lib/commonjs/components/PreviewForRoleChangeModal.js.map +1 -1
  58. package/lib/commonjs/components/RoomSettingsModalContent.js +4 -7
  59. package/lib/commonjs/components/RoomSettingsModalContent.js.map +1 -1
  60. package/lib/commonjs/components/StopRecordingModalContent.js +4 -1
  61. package/lib/commonjs/components/StopRecordingModalContent.js.map +1 -1
  62. package/lib/commonjs/hooks-util.js +193 -28
  63. package/lib/commonjs/hooks-util.js.map +1 -1
  64. package/lib/commonjs/index.js +11 -0
  65. package/lib/commonjs/index.js.map +1 -1
  66. package/lib/commonjs/redux/actionTypes.js +6 -1
  67. package/lib/commonjs/redux/actionTypes.js.map +1 -1
  68. package/lib/commonjs/redux/actions/index.js +22 -1
  69. package/lib/commonjs/redux/actions/index.js.map +1 -1
  70. package/lib/commonjs/redux/reducers/appState.js +17 -1
  71. package/lib/commonjs/redux/reducers/appState.js.map +1 -1
  72. package/lib/commonjs/redux/reducers/hmsStates.js +15 -4
  73. package/lib/commonjs/redux/reducers/hmsStates.js.map +1 -1
  74. package/lib/commonjs/redux/reducers/userState.js +5 -1
  75. package/lib/commonjs/redux/reducers/userState.js.map +1 -1
  76. package/lib/commonjs/types.js +10 -1
  77. package/lib/commonjs/types.js.map +1 -1
  78. package/lib/commonjs/utils/types.js +11 -1
  79. package/lib/commonjs/utils/types.js.map +1 -1
  80. package/lib/commonjs/utils.js +1 -7
  81. package/lib/commonjs/utils.js.map +1 -1
  82. package/lib/module/HMSPrebuilt.js +16 -14
  83. package/lib/module/HMSPrebuilt.js.map +1 -1
  84. package/lib/module/HMSRoomSetup.js +81 -40
  85. package/lib/module/HMSRoomSetup.js.map +1 -1
  86. package/lib/module/Icons/Hand/assets/hand-off.png +0 -0
  87. package/lib/module/Icons/Hand/assets/hand-off@2x.png +0 -0
  88. package/lib/module/Icons/Hand/assets/hand-off@3x.png +0 -0
  89. package/lib/module/Icons/Hand/index.js +2 -1
  90. package/lib/module/Icons/Hand/index.js.map +1 -1
  91. package/lib/module/Icons/Recording/assets/recording-off.png +0 -0
  92. package/lib/module/Icons/Recording/assets/recording-off@2x.png +0 -0
  93. package/lib/module/Icons/Recording/assets/recording-off@3x.png +0 -0
  94. package/lib/module/Icons/Recording/index.js +2 -1
  95. package/lib/module/Icons/Recording/index.js.map +1 -1
  96. package/lib/module/components/DisplayView.js +3 -1
  97. package/lib/module/components/DisplayView.js.map +1 -1
  98. package/lib/module/components/EndRoomModal.js +20 -0
  99. package/lib/module/components/EndRoomModal.js.map +1 -0
  100. package/lib/module/components/EndRoomModalContent.js +9 -2
  101. package/lib/module/components/EndRoomModalContent.js.map +1 -1
  102. package/lib/module/components/Footer.js +9 -1
  103. package/lib/module/components/Footer.js.map +1 -1
  104. package/lib/module/components/HMSKeyboardAvoidingView.js +4 -19
  105. package/lib/module/components/HMSKeyboardAvoidingView.js.map +1 -1
  106. package/lib/module/components/HMSLocalScreenshareNotification.js +1 -1
  107. package/lib/module/components/HMSManageLeave.js +5 -181
  108. package/lib/module/components/HMSManageLeave.js.map +1 -1
  109. package/lib/module/components/HMSNotification.js +4 -3
  110. package/lib/module/components/HMSNotification.js.map +1 -1
  111. package/lib/module/components/HMSNotifications.js +28 -2
  112. package/lib/module/components/HMSNotifications.js.map +1 -1
  113. package/lib/module/components/HMSOverlayChatView.js +7 -1
  114. package/lib/module/components/HMSOverlayChatView.js.map +1 -1
  115. package/lib/module/components/HMSReconnectingNotification.js +24 -0
  116. package/lib/module/components/HMSReconnectingNotification.js.map +1 -0
  117. package/lib/module/components/HMSRecordingIndicator.js +1 -1
  118. package/lib/module/components/HMSRecordingIndicator.js.map +1 -1
  119. package/lib/module/components/HMSTerminalErrorNotification.js +57 -0
  120. package/lib/module/components/HMSTerminalErrorNotification.js.map +1 -0
  121. package/lib/module/components/LeaveRoomBottomSheet.js +167 -0
  122. package/lib/module/components/LeaveRoomBottomSheet.js.map +1 -0
  123. package/lib/module/components/Meeting.js +5 -1
  124. package/lib/module/components/Meeting.js.map +1 -1
  125. package/lib/module/components/MeetingScreenContent.js +3 -2
  126. package/lib/module/components/MeetingScreenContent.js.map +1 -1
  127. package/lib/module/components/PIPView.js +81 -16
  128. package/lib/module/components/PIPView.js.map +1 -1
  129. package/lib/module/components/Participants/ParticipantsItemOptions.js +24 -2
  130. package/lib/module/components/Participants/ParticipantsItemOptions.js.map +1 -1
  131. package/lib/module/components/PeerVideoTile/AvatarView.js +4 -4
  132. package/lib/module/components/PeerVideoTile/PeerAudioIndicator.js +3 -1
  133. package/lib/module/components/PeerVideoTile/PeerAudioIndicator.js.map +1 -1
  134. package/lib/module/components/PeerVideoTile/PeerVideoTileView.js +1 -1
  135. package/lib/module/components/PeerVideoTile/PeerVideoTileView.js.map +1 -1
  136. package/lib/module/components/PreviewForRoleChangeModal.js +1 -1
  137. package/lib/module/components/RoomSettingsModalContent.js +6 -9
  138. package/lib/module/components/RoomSettingsModalContent.js.map +1 -1
  139. package/lib/module/components/StopRecordingModalContent.js +4 -1
  140. package/lib/module/components/StopRecordingModalContent.js.map +1 -1
  141. package/lib/module/hooks-util.js +184 -25
  142. package/lib/module/hooks-util.js.map +1 -1
  143. package/lib/module/index.js +1 -0
  144. package/lib/module/index.js.map +1 -1
  145. package/lib/module/redux/actionTypes.js +6 -1
  146. package/lib/module/redux/actionTypes.js.map +1 -1
  147. package/lib/module/redux/actions/index.js +18 -0
  148. package/lib/module/redux/actions/index.js.map +1 -1
  149. package/lib/module/redux/reducers/appState.js +17 -1
  150. package/lib/module/redux/reducers/appState.js.map +1 -1
  151. package/lib/module/redux/reducers/hmsStates.js +15 -4
  152. package/lib/module/redux/reducers/hmsStates.js.map +1 -1
  153. package/lib/module/redux/reducers/userState.js +5 -1
  154. package/lib/module/redux/reducers/userState.js.map +1 -1
  155. package/lib/module/types.js +9 -0
  156. package/lib/module/types.js.map +1 -1
  157. package/lib/module/utils/types.js +11 -0
  158. package/lib/module/utils/types.js.map +1 -1
  159. package/lib/module/utils.js +0 -6
  160. package/lib/module/utils.js.map +1 -1
  161. package/lib/typescript/HMSPrebuilt.d.ts +2 -16
  162. package/lib/typescript/HMSPrebuilt.d.ts.map +1 -1
  163. package/lib/typescript/HMSRoomSetup.d.ts.map +1 -1
  164. package/lib/typescript/Icons/Hand/index.d.ts +1 -0
  165. package/lib/typescript/Icons/Hand/index.d.ts.map +1 -1
  166. package/lib/typescript/Icons/Recording/index.d.ts +1 -0
  167. package/lib/typescript/Icons/Recording/index.d.ts.map +1 -1
  168. package/lib/typescript/components/DisplayView.d.ts.map +1 -1
  169. package/lib/typescript/components/EndRoomModal.d.ts +6 -0
  170. package/lib/typescript/components/EndRoomModal.d.ts.map +1 -0
  171. package/lib/typescript/components/EndRoomModalContent.d.ts.map +1 -1
  172. package/lib/typescript/components/Footer.d.ts +1 -0
  173. package/lib/typescript/components/Footer.d.ts.map +1 -1
  174. package/lib/typescript/components/HMSKeyboardAvoidingView.d.ts +1 -0
  175. package/lib/typescript/components/HMSKeyboardAvoidingView.d.ts.map +1 -1
  176. package/lib/typescript/components/HMSManageLeave.d.ts.map +1 -1
  177. package/lib/typescript/components/HMSNotification.d.ts +1 -0
  178. package/lib/typescript/components/HMSNotification.d.ts.map +1 -1
  179. package/lib/typescript/components/HMSNotifications.d.ts +1 -0
  180. package/lib/typescript/components/HMSNotifications.d.ts.map +1 -1
  181. package/lib/typescript/components/HMSOverlayChatView.d.ts.map +1 -1
  182. package/lib/typescript/components/HMSReconnectingNotification.d.ts +5 -0
  183. package/lib/typescript/components/HMSReconnectingNotification.d.ts.map +1 -0
  184. package/lib/typescript/components/HMSTerminalErrorNotification.d.ts +10 -0
  185. package/lib/typescript/components/HMSTerminalErrorNotification.d.ts.map +1 -0
  186. package/lib/typescript/components/LeaveRoomBottomSheet.d.ts +6 -0
  187. package/lib/typescript/components/LeaveRoomBottomSheet.d.ts.map +1 -0
  188. package/lib/typescript/components/Meeting.d.ts.map +1 -1
  189. package/lib/typescript/components/PIPView.d.ts.map +1 -1
  190. package/lib/typescript/components/Participants/ParticipantsItemOptions.d.ts.map +1 -1
  191. package/lib/typescript/components/PeerVideoTile/PeerAudioIndicator.d.ts.map +1 -1
  192. package/lib/typescript/components/PeerVideoTile/PeerVideoTileView.d.ts.map +1 -1
  193. package/lib/typescript/components/RoomSettingsModalContent.d.ts.map +1 -1
  194. package/lib/typescript/components/StopRecordingModalContent.d.ts.map +1 -1
  195. package/lib/typescript/hooks-util.d.ts +20 -7
  196. package/lib/typescript/hooks-util.d.ts.map +1 -1
  197. package/lib/typescript/index.d.ts +2 -0
  198. package/lib/typescript/index.d.ts.map +1 -1
  199. package/lib/typescript/redux/actionTypes.d.ts +3 -0
  200. package/lib/typescript/redux/actionTypes.d.ts.map +1 -1
  201. package/lib/typescript/redux/actions/index.d.ts +23 -14
  202. package/lib/typescript/redux/actions/index.d.ts.map +1 -1
  203. package/lib/typescript/redux/index.d.ts +5 -7
  204. package/lib/typescript/redux/index.d.ts.map +1 -1
  205. package/lib/typescript/redux/reducers/appState.d.ts +4 -5
  206. package/lib/typescript/redux/reducers/appState.d.ts.map +1 -1
  207. package/lib/typescript/redux/reducers/hmsStates.d.ts.map +1 -1
  208. package/lib/typescript/redux/reducers/index.d.ts +5 -7
  209. package/lib/typescript/redux/reducers/index.d.ts.map +1 -1
  210. package/lib/typescript/redux/reducers/userState.d.ts +2 -2
  211. package/lib/typescript/redux/reducers/userState.d.ts.map +1 -1
  212. package/lib/typescript/types.d.ts +79 -0
  213. package/lib/typescript/types.d.ts.map +1 -1
  214. package/lib/typescript/utils/types.d.ts +24 -0
  215. package/lib/typescript/utils/types.d.ts.map +1 -1
  216. package/lib/typescript/utils.d.ts +0 -5
  217. package/lib/typescript/utils.d.ts.map +1 -1
  218. package/package.json +2 -2
  219. package/src/HMSPrebuilt.tsx +32 -23
  220. package/src/HMSRoomSetup.tsx +105 -53
  221. package/src/Icons/Hand/assets/hand-off.png +0 -0
  222. package/src/Icons/Hand/assets/hand-off@2x.png +0 -0
  223. package/src/Icons/Hand/assets/hand-off@3x.png +0 -0
  224. package/src/Icons/Hand/index.tsx +13 -3
  225. package/src/Icons/Recording/assets/recording-off.png +0 -0
  226. package/src/Icons/Recording/assets/recording-off@2x.png +0 -0
  227. package/src/Icons/Recording/assets/recording-off@3x.png +0 -0
  228. package/src/Icons/Recording/index.tsx +9 -2
  229. package/src/components/DisplayView.tsx +6 -0
  230. package/src/components/EndRoomModal.tsx +24 -0
  231. package/src/components/EndRoomModalContent.tsx +9 -2
  232. package/src/components/Footer.tsx +18 -2
  233. package/src/components/HMSKeyboardAvoidingView.tsx +5 -23
  234. package/src/components/HMSLocalScreenshareNotification.tsx +1 -1
  235. package/src/components/HMSManageLeave.tsx +4 -228
  236. package/src/components/HMSNotification.tsx +4 -2
  237. package/src/components/HMSNotifications.tsx +41 -7
  238. package/src/components/HMSOverlayChatView.tsx +6 -1
  239. package/src/components/HMSReconnectingNotification.tsx +27 -0
  240. package/src/components/HMSRecordingIndicator.tsx +1 -1
  241. package/src/components/HMSTerminalErrorNotification.tsx +70 -0
  242. package/src/components/LeaveRoomBottomSheet.tsx +199 -0
  243. package/src/components/Meeting.tsx +7 -0
  244. package/src/components/MeetingScreenContent.tsx +2 -2
  245. package/src/components/PIPView.tsx +113 -25
  246. package/src/components/Participants/ParticipantsItemOptions.tsx +26 -4
  247. package/src/components/PeerVideoTile/AvatarView.tsx +4 -4
  248. package/src/components/PeerVideoTile/PeerAudioIndicator.tsx +6 -1
  249. package/src/components/PeerVideoTile/PeerVideoTileView.tsx +4 -2
  250. package/src/components/PreviewForRoleChangeModal.tsx +1 -1
  251. package/src/components/RoomSettingsModalContent.tsx +5 -9
  252. package/src/components/StopRecordingModalContent.tsx +3 -1
  253. package/src/hooks-util.ts +243 -25
  254. package/src/index.ts +2 -0
  255. package/src/redux/actionTypes.ts +7 -0
  256. package/src/redux/actions/index.ts +19 -7
  257. package/src/redux/reducers/appState.ts +18 -1
  258. package/src/redux/reducers/hmsStates.ts +19 -7
  259. package/src/redux/reducers/userState.ts +7 -3
  260. package/src/types.ts +71 -0
  261. package/src/utils/types.ts +27 -0
  262. package/src/utils.ts +0 -6
@@ -19,7 +19,10 @@ const StopRecordingModalContent = _ref => {
19
19
  } = _ref;
20
20
  const dispatch = (0, _reactRedux.useDispatch)();
21
21
  const hmsInstance = (0, _hooksUtil.useHMSInstance)();
22
- const startingOrStoppingRecording = (0, _reactRedux.useSelector)(state => state.app.startingOrStoppingRecording);
22
+ const startingOrStoppingRecording = (0, _reactRedux.useSelector)(state => {
23
+ var _state$hmsStates$room;
24
+ return state.app.startingOrStoppingRecording || (((_state$hmsStates$room = state.hmsStates.room) === null || _state$hmsStates$room === void 0 ? void 0 : _state$hmsStates$room.browserRecordingState.initialising) ?? false);
25
+ });
23
26
  const hmsRoomStyles = (0, _hooksUtil.useHMSRoomStyleSheet)((theme, typography) => ({
24
27
  headerText: {
25
28
  color: theme.palette.alert_error_default,
@@ -1 +1 @@
1
- {"version":3,"names":["React","_interopRequireWildcard","require","_reactRedux","_reactNative","_hooksUtil","_Icons","_HMSDangerButton","_actions","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","StopRecordingModalContent","_ref","dismissModal","dispatch","useDispatch","hmsInstance","useHMSInstance","startingOrStoppingRecording","useSelector","state","app","hmsRoomStyles","useHMSRoomStyleSheet","theme","typography","headerText","color","palette","alert_error_default","fontFamily","font_family","text","on_surface_medium","stopRecording","setStartingOrStoppingRecording","stopRtmpAndRecording","error","createElement","View","style","styles","container","header","headerControls","AlertTriangleIcon","Text","TouchableOpacity","onPress","hitSlop","closeIconHitSlop","CloseIcon","HMSDangerButton","loading","title","disabled","exports","StyleSheet","create","marginTop","marginHorizontal","flexDirection","alignItems","justifyContent","marginBottom","fontSize","lineHeight","letterSpacing","marginLeft","bottom","left","right","top"],"sourceRoot":"../../../src","sources":["components/StopRecordingModalContent.tsx"],"mappings":";;;;;;AAAA,IAAAA,KAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD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E;IACVuC,QAAQ,EAAE,EAAE;IACZC,UAAU,EAAE,EAAE;IACdC,aAAa,EAAE,IAAI;IACnBC,UAAU,EAAE;EACd,CAAC;EACDlB,gBAAgB,EAAE;IAChBmB,MAAM,EAAE,EAAE;IACVC,IAAI,EAAE,EAAE;IACRC,KAAK,EAAE,EAAE;IACTC,GAAG,EAAE;EACP,CAAC;EACDxC,IAAI,EAAE;IACJiC,QAAQ,EAAE,EAAE;IACZC,UAAU,EAAE,EAAE;IACdC,aAAa,EAAE,IAAI;IACnBH,YAAY,EAAE;EAChB;AACF,CAAC,CAAC"}
1
+ {"version":3,"names":["React","_interopRequireWildcard","require","_reactRedux","_reactNative","_hooksUtil","_Icons","_HMSDangerButton","_actions","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","StopRecordingModalContent","_ref","dismissModal","dispatch","useDispatch","hmsInstance","useHMSInstance","startingOrStoppingRecording","useSelector","state","_state$hmsStates$room","app","hmsStates","room","browserRecordingState","initialising","hmsRoomStyles","useHMSRoomStyleSheet","theme","typography","headerText","color","palette","alert_error_default","fontFamily","font_family","text","on_surface_medium","stopRecording","setStartingOrStoppingRecording","stopRtmpAndRecording","error","createElement","View","style","styles","container","header","headerControls","AlertTriangleIcon","Text","TouchableOpacity","onPress","hitSlop","closeIconHitSlop","CloseIcon","HMSDangerButton","loading","title","disabled","exports","StyleSheet","create","marginTop","marginHorizontal","flexDirection","alignItems","justifyContent","marginBottom","fontSize","lineHeight","letterSpacing","marginLeft","bottom","left","right","top"],"sourceRoot":"../../../src","sources":["components/StopRecordingModalContent.tsx"],"mappings":";;;;;;AAAA,IAAAA,KAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,YAAA,GAAAF,OAAA;AAGA,IAAAG,UAAA,GAAAH,OAAA;AACA,IAAAI,MAAA,GAAAJ,OA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c,EAAE;IACdiB,aAAa,EAAE,KAAK;IACpBC,UAAU,EAAE;EACd,CAAC;EACDpC,UAAU,EAAE;IACVuC,QAAQ,EAAE,EAAE;IACZC,UAAU,EAAE,EAAE;IACdC,aAAa,EAAE,IAAI;IACnBC,UAAU,EAAE;EACd,CAAC;EACDlB,gBAAgB,EAAE;IAChBmB,MAAM,EAAE,EAAE;IACVC,IAAI,EAAE,EAAE;IACRC,KAAK,EAAE,EAAE;IACTC,GAAG,EAAE;EACP,CAAC;EACDxC,IAAI,EAAE;IACJiC,QAAQ,EAAE,EAAE;IACZC,UAAU,EAAE,EAAE;IACdC,aAAa,EAAE,IAAI;IACnBH,YAAY,EAAE;EAChB;AACF,CAAC,CAAC"}
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.useShowLandscapeLayout = exports.useShowChatAndParticipants = exports.useShouldGoLive = exports.useSendMessage = exports.usePortraitChatViewVisible = exports.usePIPListener = exports.useOffStageParticipants = exports.useModalType = exports.useLeaveMethods = exports.useLandscapeChatViewVisible = exports.useIsHLSViewer = exports.useHMSSessionStoreListeners = exports.useHMSSessionStore = exports.useHMSRoomTypography = exports.useHMSRoomTheme = exports.useHMSRoomStyleSheet = exports.useHMSRoomStyle = exports.useHMSRoomColorPalette = exports.useHMSRoleChangeRequest = exports.useHMSRemovedFromRoomUpdate = exports.useHMSReconnection = exports.useHMSPIPRoomLeave = exports.useHMSNetworkQualityUpdate = exports.useHMSMessages = exports.useHMSListeners = exports.useHMSLayoutConfig = exports.useHMSInstance = exports.useHMSConfig = exports.useHMSConferencingScreenConfig = exports.useHMSChatLayoutConfig = exports.useHMSChangeTrackStateRequest = exports.useHMSActiveSpeakerUpdates = exports.useFilteredParticipants = exports.useFetchHMSRoles = exports.isPublishingAllowed = exports.clearPendingModalTasks = exports.clearConfig = void 0;
6
+ exports.useStartRecording = exports.useShowLandscapeLayout = exports.useShowChatAndParticipants = exports.useShouldGoLive = exports.useSendMessage = exports.useSavePropsToStore = exports.usePortraitChatViewVisible = exports.usePipAspectRatio = exports.usePIPListener = exports.useOffStageParticipants = exports.useModalType = exports.useLeaveMethods = exports.useLandscapeChatViewVisible = exports.useIsHLSViewer = exports.useHMSSessionStoreListeners = exports.useHMSSessionStore = exports.useHMSRoomTypography = exports.useHMSRoomTheme = exports.useHMSRoomStyleSheet = exports.useHMSRoomStyle = exports.useHMSRoomColorPalette = exports.useHMSRoleChangeRequest = exports.useHMSRemovedFromRoomUpdate = exports.useHMSReconnection = exports.useHMSPIPRoomLeave = exports.useHMSNetworkQualityUpdate = exports.useHMSMessages = exports.useHMSListeners = exports.useHMSLayoutConfig = exports.useHMSInstance = exports.useHMSConfig = exports.useHMSConferencingScreenConfig = exports.useHMSChatLayoutConfig = exports.useHMSChangeTrackStateRequest = exports.useHMSActiveSpeakerUpdates = exports.useFilteredParticipants = exports.useFetchHMSRoles = exports.useEnableAutoPip = exports.useDisableAutoPip = exports.useBackButtonPress = exports.useAutoPip = exports.isPublishingAllowed = exports.clearPendingModalTasks = exports.clearConfig = void 0;
7
7
  var _reactNativeHms = require("@100mslive/react-native-hms");
8
8
  var _reactNativeSimpleToast = _interopRequireDefault(require("react-native-simple-toast"));
9
9
  var _react = require("react");
@@ -19,7 +19,6 @@ var _dimension = require("./utils/dimension");
19
19
  var _hooksUtilSelectors = require("./hooks-util-selectors");
20
20
  var _HMSManager = require("./modules/HMSManager");
21
21
  var _theme = require("./utils/theme");
22
- var _utils = require("./utils");
23
22
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
24
23
  const useHMSListeners = setPeerTrackNodes => {
25
24
  const hmsInstance = useHMSInstance();
@@ -244,14 +243,14 @@ const useHMSPeersUpdate = (hmsInstance, updateLocalPeer, setPeerTrackNodes) => {
244
243
  const canChangeRole = (_reduxState$hmsStates = reduxState.hmsStates.localPeer) === null || _reduxState$hmsStates === void 0 || (_reduxState$hmsStates = _reduxState$hmsStates.role) === null || _reduxState$hmsStates === void 0 || (_reduxState$hmsStates = _reduxState$hmsStates.permissions) === null || _reduxState$hmsStates === void 0 ? void 0 : _reduxState$hmsStates.changeRole;
245
244
  if (shouldBringOnStage && canChangeRole) {
246
245
  dispatch((0, _actions.addNotification)({
247
- id: `${peer.peerID}-${_utils.NotificationTypes.HAND_RAISE}`,
248
- type: _utils.NotificationTypes.HAND_RAISE,
246
+ id: `${peer.peerID}-${_types2.NotificationTypes.HAND_RAISE}`,
247
+ type: _types2.NotificationTypes.HAND_RAISE,
249
248
  peer
250
249
  }));
251
250
  }
252
251
  } else {
253
252
  const notifications = reduxState.app.notifications;
254
- const notificationToRemove = notifications.find(notification => notification.id === `${peer.peerID}-${_utils.NotificationTypes.HAND_RAISE}`);
253
+ const notificationToRemove = notifications.find(notification => notification.id === `${peer.peerID}-${_types2.NotificationTypes.HAND_RAISE}`);
255
254
  if (notificationToRemove) {
256
255
  dispatch((0, _actions.removeNotification)(notificationToRemove.id));
257
256
  }
@@ -808,12 +807,12 @@ const useHMSMessages = () => {
808
807
  });
809
808
  (0, _react.useEffect)(() => {
810
809
  const onMessageListener = message => {
811
- if (message.type === _utils.NotificationTypes.ROLE_CHANGE_DECLINED) {
810
+ if (message.type === _types2.NotificationTypes.ROLE_CHANGE_DECLINED) {
812
811
  if (canChangeRole) {
813
812
  var _message$sender;
814
813
  dispatch((0, _actions.addNotification)({
815
- id: `${(_message$sender = message.sender) === null || _message$sender === void 0 ? void 0 : _message$sender.peerID}-${_utils.NotificationTypes.ROLE_CHANGE_DECLINED}`,
816
- type: _utils.NotificationTypes.ROLE_CHANGE_DECLINED,
814
+ id: `${(_message$sender = message.sender) === null || _message$sender === void 0 ? void 0 : _message$sender.peerID}-${_types2.NotificationTypes.ROLE_CHANGE_DECLINED}`,
815
+ type: _types2.NotificationTypes.ROLE_CHANGE_DECLINED,
817
816
  peer: message.sender
818
817
  }));
819
818
  }
@@ -838,12 +837,21 @@ const useHMSReconnection = () => {
838
837
  let mounted = true;
839
838
  hmsInstance.addEventListener(_reactNativeHms.HMSUpdateListenerActions.RECONNECTING, () => {
840
839
  if (mounted) {
841
- dispatch((0, _actions.setReconnecting)(true));
840
+ (0, _reactRedux.batch)(() => {
841
+ dispatch((0, _actions.setReconnecting)(true));
842
+ dispatch((0, _actions.addNotification)({
843
+ id: _types2.NotificationTypes.RECONNECTING,
844
+ type: _types2.NotificationTypes.RECONNECTING
845
+ }));
846
+ });
842
847
  }
843
848
  });
844
849
  hmsInstance.addEventListener(_reactNativeHms.HMSUpdateListenerActions.RECONNECTED, () => {
845
850
  if (mounted) {
846
- dispatch((0, _actions.setReconnecting)(false));
851
+ (0, _reactRedux.batch)(() => {
852
+ dispatch((0, _actions.setReconnecting)(false));
853
+ dispatch((0, _actions.removeNotification)(_types2.NotificationTypes.RECONNECTING));
854
+ });
847
855
  }
848
856
  });
849
857
  return () => {
@@ -858,10 +866,10 @@ const useHMSPIPRoomLeave = () => {
858
866
  const hmsInstance = useHMSInstance();
859
867
  const {
860
868
  destroy
861
- } = useLeaveMethods(true);
869
+ } = useLeaveMethods();
862
870
  (0, _react.useEffect)(() => {
863
871
  const pipRoomLeaveHandler = () => {
864
- destroy();
872
+ destroy(_types.OnLeaveReason.PIP);
865
873
  };
866
874
  hmsInstance.addEventListener(_reactNativeHms.HMSPIPListenerActions.ON_PIP_ROOM_LEAVE, pipRoomLeaveHandler);
867
875
  return () => {
@@ -874,10 +882,10 @@ const useHMSRemovedFromRoomUpdate = () => {
874
882
  const hmsInstance = useHMSInstance();
875
883
  const {
876
884
  destroy
877
- } = useLeaveMethods(true);
885
+ } = useLeaveMethods();
878
886
  (0, _react.useEffect)(() => {
879
- const removedFromRoomHandler = () => {
880
- destroy();
887
+ const removedFromRoomHandler = data => {
888
+ destroy(data.roomEnded ? _types.OnLeaveReason.ROOM_END : _types.OnLeaveReason.PEER_KICKED);
881
889
  };
882
890
  hmsInstance.addEventListener(_reactNativeHms.HMSUpdateListenerActions.ON_REMOVED_FROM_ROOM, removedFromRoomHandler);
883
891
  return () => {
@@ -927,6 +935,75 @@ const useHMSNetworkQualityUpdate = () => {
927
935
  }, [hmsInstance]);
928
936
  };
929
937
  exports.useHMSNetworkQualityUpdate = useHMSNetworkQualityUpdate;
938
+ const useEnableAutoPip = () => {
939
+ const hmsInstance = useHMSInstance();
940
+ const enableAutoPip = (0, _react.useCallback)(data => {
941
+ hmsInstance.setPipParams({
942
+ ...data,
943
+ autoEnterPipMode: true
944
+ });
945
+ }, [hmsInstance]);
946
+ return enableAutoPip;
947
+ };
948
+ exports.useEnableAutoPip = useEnableAutoPip;
949
+ const useDisableAutoPip = () => {
950
+ const hmsInstance = useHMSInstance();
951
+ const disableAutoPip = (0, _react.useCallback)(data => {
952
+ hmsInstance.setPipParams({
953
+ ...data,
954
+ autoEnterPipMode: false
955
+ });
956
+ }, [hmsInstance]);
957
+ return disableAutoPip;
958
+ };
959
+ exports.useDisableAutoPip = useDisableAutoPip;
960
+ const useAutoPip = oneToOneCall => {
961
+ const enableAutoPip = useEnableAutoPip();
962
+ const disableAutoPip = useDisableAutoPip();
963
+ const autoEnterPipMode = (0, _reactRedux.useSelector)(state => state.app.autoEnterPipMode);
964
+ const [numerator, denominator] = usePipAspectRatio(oneToOneCall);
965
+ (0, _react.useEffect)(() => {
966
+ if (autoEnterPipMode) {
967
+ enableAutoPip({
968
+ aspectRatio: [numerator, denominator]
969
+ });
970
+ return disableAutoPip;
971
+ }
972
+ }, [numerator, denominator, autoEnterPipMode, enableAutoPip, disableAutoPip]);
973
+ };
974
+ exports.useAutoPip = useAutoPip;
975
+ const usePipAspectRatio = oneToOneCall => {
976
+ const isHLSViewer = useIsHLSViewer();
977
+ const hlsPlayerResolution = (0, _reactNativeHms.useHMSHLSPlayerResolution)();
978
+ const firstSSNodeId = (0, _reactRedux.useSelector)(state => {
979
+ var _ssPeerTrackNode$trac;
980
+ const ssPeerTrackNode = state.app.screensharePeerTrackNodes[0];
981
+ return ssPeerTrackNode === null || ssPeerTrackNode === void 0 || (_ssPeerTrackNode$trac = ssPeerTrackNode.track) === null || _ssPeerTrackNode$trac === void 0 ? void 0 : _ssPeerTrackNode$trac.trackId;
982
+ });
983
+ const ssResolution = (0, _reactNativeHms.useHmsViewsResolutionsState)(firstSSNodeId);
984
+ const aspectRatio = (0, _react.useMemo)(() => {
985
+ // When user is hlsviewer and we have stream resolution
986
+ if (isHLSViewer && hlsPlayerResolution) {
987
+ return [hlsPlayerResolution.width, hlsPlayerResolution.height];
988
+ }
989
+ // When user is hlsviewer and we don't have stream resolution
990
+ if (isHLSViewer) {
991
+ return [9, 16];
992
+ }
993
+ // When we have screenshare resolution, use it
994
+ if (ssResolution) {
995
+ return [ssResolution.width, ssResolution.height];
996
+ }
997
+ // When there is no screenshare and one-to-one call is happening
998
+ if (!firstSSNodeId && oneToOneCall) {
999
+ return [9, 16];
1000
+ }
1001
+ // default aspect ratio
1002
+ return [16, 9];
1003
+ }, [isHLSViewer, firstSSNodeId, oneToOneCall, ssResolution, hlsPlayerResolution]);
1004
+ return aspectRatio;
1005
+ };
1006
+ exports.usePipAspectRatio = usePipAspectRatio;
930
1007
  const useHMSActiveSpeakerUpdates = (setPeerTrackNodes, active) => {
931
1008
  const hmsInstance = useHMSInstance();
932
1009
  const dispatch = (0, _reactRedux.useDispatch)();
@@ -1285,7 +1362,8 @@ const useFilteredParticipants = filterText => {
1285
1362
  const firstTen = filteredList.slice(0, 10);
1286
1363
  t.push({
1287
1364
  id: role.name,
1288
- label: `${role.name} (${typeof offStageRoleTotalCount === 'number' ? offStageRoleTotalCount : filteredList.length})`,
1365
+ label: `${role.name} (${typeof offStageRoleTotalCount === 'number' && offStageRoleTotalCount > filteredList.length ? offStageRoleTotalCount // only use `offStageRoleTotalCount` when it is number and more than list length
1366
+ : filteredList.length})`,
1289
1367
  showViewAll: typeof offStageRoleTotalCount === 'number' && formattedSearchText.length <= 0 ? offStageRoleTotalCount > 10 : filteredList.length > 10,
1290
1368
  data: firstTen
1291
1369
  });
@@ -1317,12 +1395,12 @@ const useShouldGoLive = () => {
1317
1395
  return shouldGoLive;
1318
1396
  };
1319
1397
  exports.useShouldGoLive = useShouldGoLive;
1320
- const useLeaveMethods = isUnmounted => {
1398
+ const useLeaveMethods = () => {
1321
1399
  const navigation = (0, _react.useContext)(_native.NavigationContext);
1322
1400
  const hmsInstance = useHMSInstance();
1323
1401
  const dispatch = (0, _reactRedux.useDispatch)();
1324
1402
  const reduxStore = (0, _reactRedux.useStore)();
1325
- const destroy = (0, _react.useCallback)(() => {
1403
+ const destroy = (0, _react.useCallback)(reason => {
1326
1404
  try {
1327
1405
  const s = hmsInstance.destroy();
1328
1406
  console.log('Destroy Success: ', s);
@@ -1348,9 +1426,9 @@ const useLeaveMethods = isUnmounted => {
1348
1426
 
1349
1427
  const onLeave = reduxStore.getState().user.onLeave;
1350
1428
  if (typeof onLeave === 'function') {
1351
- onLeave();
1429
+ onLeave(reason);
1352
1430
  dispatch((0, _actions.clearStore)());
1353
- } else if (navigation && navigation.canGoBack() && !isUnmounted) {
1431
+ } else if (navigation && typeof navigation.canGoBack === 'function' && navigation.canGoBack()) {
1354
1432
  navigation.goBack();
1355
1433
  dispatch((0, _actions.clearStore)());
1356
1434
  } else {
@@ -1364,8 +1442,8 @@ const useLeaveMethods = isUnmounted => {
1364
1442
  return Promise.reject(e);
1365
1443
  }
1366
1444
  }, [hmsInstance]);
1367
- const leave = (0, _react.useCallback)(async function () {
1368
- let shouldEndStream = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
1445
+ const leave = (0, _react.useCallback)(async function (reason) {
1446
+ let shouldEndStream = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
1369
1447
  if (shouldEndStream) {
1370
1448
  hmsInstance.stopHLSStreaming().catch(error => {
1371
1449
  console.log('Stop HLS Streaming Error: ', error);
@@ -1374,26 +1452,26 @@ const useLeaveMethods = isUnmounted => {
1374
1452
  try {
1375
1453
  const d = await hmsInstance.leave();
1376
1454
  console.log('Leave Success: ', d);
1377
- await destroy();
1455
+ await destroy(reason);
1378
1456
  } catch (e) {
1379
1457
  console.log(`Leave Room Error: ${e}`);
1380
1458
  _reactNativeSimpleToast.default.showWithGravity(`Leave Room Error: ${e}`, _reactNativeSimpleToast.default.LONG, _reactNativeSimpleToast.default.TOP);
1381
1459
  }
1382
1460
  }, [destroy, hmsInstance]);
1383
- const goToPreview = (0, _react.useCallback)(async () => {
1461
+ const prebuiltCleanUp = (0, _react.useCallback)(async () => {
1384
1462
  try {
1385
1463
  await hmsInstance.leave();
1386
1464
  await hmsInstance.destroy();
1387
1465
  dispatch((0, _actions.clearStore)());
1388
1466
  } catch (error) {
1389
- _reactNativeSimpleToast.default.showWithGravity(`Unable to go to Preview: ${error}`, _reactNativeSimpleToast.default.LONG, _reactNativeSimpleToast.default.TOP);
1467
+ _reactNativeSimpleToast.default.showWithGravity(`Unable to leave or destroy: ${error}`, _reactNativeSimpleToast.default.LONG, _reactNativeSimpleToast.default.TOP);
1390
1468
  }
1391
1469
  }, [hmsInstance]);
1392
- const endRoom = (0, _react.useCallback)(async () => {
1470
+ const endRoom = (0, _react.useCallback)(async reason => {
1393
1471
  try {
1394
1472
  const d = await hmsInstance.endRoom('Host ended the room');
1395
1473
  console.log('EndRoom Success: ', d);
1396
- await destroy();
1474
+ await destroy(reason);
1397
1475
  } catch (e) {
1398
1476
  console.log('EndRoom Error: ', e);
1399
1477
  }
@@ -1402,7 +1480,7 @@ const useLeaveMethods = isUnmounted => {
1402
1480
  destroy,
1403
1481
  leave,
1404
1482
  endRoom,
1405
- goToPreview
1483
+ prebuiltCleanUp
1406
1484
  };
1407
1485
  };
1408
1486
 
@@ -1550,4 +1628,91 @@ const useHMSConferencingScreenConfig = (selector, equalityFn) => {
1550
1628
  }, equalityFn);
1551
1629
  };
1552
1630
  exports.useHMSConferencingScreenConfig = useHMSConferencingScreenConfig;
1631
+ const useBackButtonPress = () => {
1632
+ const {
1633
+ handleModalVisibleType
1634
+ } = useModalType();
1635
+ const handleBackPress = (0, _reactRedux.useSelector)(state => state.app.handleBackButton);
1636
+ (0, _react.useEffect)(() => {
1637
+ if (handleBackPress) {
1638
+ const backPressHandler = () => {
1639
+ handleModalVisibleType(_types.ModalTypes.LEAVE_ROOM);
1640
+
1641
+ /**
1642
+ * When true is returned the event will not be bubbled up
1643
+ * & no other back action will execute
1644
+ */
1645
+ return true;
1646
+
1647
+ /**
1648
+ * Returning false will let the event to bubble up & let other event listeners
1649
+ * or the system's default back action to be executed.
1650
+ */
1651
+ // return false;
1652
+ };
1653
+
1654
+ const subscription = _reactNative.BackHandler.addEventListener('hardwareBackPress', backPressHandler);
1655
+ return () => {
1656
+ if (typeof subscription.remove === 'function') {
1657
+ subscription.remove();
1658
+ } else {
1659
+ _reactNative.BackHandler.removeEventListener('hardwareBackPress', backPressHandler);
1660
+ }
1661
+ };
1662
+ }
1663
+ }, [handleBackPress, handleModalVisibleType]);
1664
+ };
1665
+ exports.useBackButtonPress = useBackButtonPress;
1666
+ const useSavePropsToStore = (props, dispatch) => {
1667
+ const {
1668
+ roomCode,
1669
+ options,
1670
+ onLeave,
1671
+ handleBackButton,
1672
+ autoEnterPipMode
1673
+ } = props;
1674
+ (0, _react.useEffect)(() => {
1675
+ dispatch((0, _actions.setPrebuiltData)({
1676
+ roomCode,
1677
+ options
1678
+ }));
1679
+ }, [roomCode, options]);
1680
+ (0, _react.useEffect)(() => {
1681
+ dispatch((0, _actions.setOnLeaveHandler)(onLeave));
1682
+ }, [onLeave]);
1683
+ (0, _react.useEffect)(() => {
1684
+ if (_reactNative.Platform.OS === 'android') {
1685
+ dispatch((0, _actions.setHandleBackButton)(handleBackButton));
1686
+ }
1687
+ }, [handleBackButton]);
1688
+ (0, _react.useEffect)(() => {
1689
+ if (_reactNative.Platform.OS === 'android') {
1690
+ dispatch((0, _actions.setAutoEnterPipMode)(autoEnterPipMode));
1691
+ }
1692
+ }, [autoEnterPipMode]);
1693
+ };
1694
+ exports.useSavePropsToStore = useSavePropsToStore;
1695
+ const useStartRecording = () => {
1696
+ const dispatch = (0, _reactRedux.useDispatch)();
1697
+ const hmsInstance = useHMSInstance();
1698
+ const startRecording = (0, _react.useCallback)(() => {
1699
+ dispatch((0, _actions.setStartingOrStoppingRecording)(true));
1700
+ hmsInstance.startRTMPOrRecording({
1701
+ record: true
1702
+ }).catch(error => {
1703
+ (0, _reactRedux.batch)(() => {
1704
+ dispatch((0, _actions.setStartingOrStoppingRecording)(false));
1705
+ dispatch((0, _actions.addNotification)({
1706
+ id: Math.random().toString(16).slice(2),
1707
+ type: _types2.NotificationTypes.ERROR,
1708
+ message: error.message
1709
+ }));
1710
+ });
1711
+ });
1712
+ }, [hmsInstance]);
1713
+ return {
1714
+ startRecording
1715
+ };
1716
+ };
1717
+ exports.useStartRecording = useStartRecording;
1553
1718
  //# sourceMappingURL=hooks-util.js.map