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

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 (256) 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 +191 -27
  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/userState.js +5 -1
  73. package/lib/commonjs/redux/reducers/userState.js.map +1 -1
  74. package/lib/commonjs/types.js +10 -1
  75. package/lib/commonjs/types.js.map +1 -1
  76. package/lib/commonjs/utils/types.js +11 -1
  77. package/lib/commonjs/utils/types.js.map +1 -1
  78. package/lib/commonjs/utils.js +1 -7
  79. package/lib/commonjs/utils.js.map +1 -1
  80. package/lib/module/HMSPrebuilt.js +16 -14
  81. package/lib/module/HMSPrebuilt.js.map +1 -1
  82. package/lib/module/HMSRoomSetup.js +81 -40
  83. package/lib/module/HMSRoomSetup.js.map +1 -1
  84. package/lib/module/Icons/Hand/assets/hand-off.png +0 -0
  85. package/lib/module/Icons/Hand/assets/hand-off@2x.png +0 -0
  86. package/lib/module/Icons/Hand/assets/hand-off@3x.png +0 -0
  87. package/lib/module/Icons/Hand/index.js +2 -1
  88. package/lib/module/Icons/Hand/index.js.map +1 -1
  89. package/lib/module/Icons/Recording/assets/recording-off.png +0 -0
  90. package/lib/module/Icons/Recording/assets/recording-off@2x.png +0 -0
  91. package/lib/module/Icons/Recording/assets/recording-off@3x.png +0 -0
  92. package/lib/module/Icons/Recording/index.js +2 -1
  93. package/lib/module/Icons/Recording/index.js.map +1 -1
  94. package/lib/module/components/DisplayView.js +3 -1
  95. package/lib/module/components/DisplayView.js.map +1 -1
  96. package/lib/module/components/EndRoomModal.js +20 -0
  97. package/lib/module/components/EndRoomModal.js.map +1 -0
  98. package/lib/module/components/EndRoomModalContent.js +9 -2
  99. package/lib/module/components/EndRoomModalContent.js.map +1 -1
  100. package/lib/module/components/Footer.js +9 -1
  101. package/lib/module/components/Footer.js.map +1 -1
  102. package/lib/module/components/HMSKeyboardAvoidingView.js +4 -19
  103. package/lib/module/components/HMSKeyboardAvoidingView.js.map +1 -1
  104. package/lib/module/components/HMSLocalScreenshareNotification.js +1 -1
  105. package/lib/module/components/HMSManageLeave.js +5 -181
  106. package/lib/module/components/HMSManageLeave.js.map +1 -1
  107. package/lib/module/components/HMSNotification.js +4 -3
  108. package/lib/module/components/HMSNotification.js.map +1 -1
  109. package/lib/module/components/HMSNotifications.js +28 -2
  110. package/lib/module/components/HMSNotifications.js.map +1 -1
  111. package/lib/module/components/HMSOverlayChatView.js +7 -1
  112. package/lib/module/components/HMSOverlayChatView.js.map +1 -1
  113. package/lib/module/components/HMSReconnectingNotification.js +24 -0
  114. package/lib/module/components/HMSReconnectingNotification.js.map +1 -0
  115. package/lib/module/components/HMSRecordingIndicator.js +1 -1
  116. package/lib/module/components/HMSRecordingIndicator.js.map +1 -1
  117. package/lib/module/components/HMSTerminalErrorNotification.js +57 -0
  118. package/lib/module/components/HMSTerminalErrorNotification.js.map +1 -0
  119. package/lib/module/components/LeaveRoomBottomSheet.js +167 -0
  120. package/lib/module/components/LeaveRoomBottomSheet.js.map +1 -0
  121. package/lib/module/components/Meeting.js +5 -1
  122. package/lib/module/components/Meeting.js.map +1 -1
  123. package/lib/module/components/MeetingScreenContent.js +3 -2
  124. package/lib/module/components/MeetingScreenContent.js.map +1 -1
  125. package/lib/module/components/PIPView.js +81 -16
  126. package/lib/module/components/PIPView.js.map +1 -1
  127. package/lib/module/components/Participants/ParticipantsItemOptions.js +24 -2
  128. package/lib/module/components/Participants/ParticipantsItemOptions.js.map +1 -1
  129. package/lib/module/components/PeerVideoTile/AvatarView.js +4 -4
  130. package/lib/module/components/PeerVideoTile/PeerAudioIndicator.js +3 -1
  131. package/lib/module/components/PeerVideoTile/PeerAudioIndicator.js.map +1 -1
  132. package/lib/module/components/PeerVideoTile/PeerVideoTileView.js +1 -1
  133. package/lib/module/components/PeerVideoTile/PeerVideoTileView.js.map +1 -1
  134. package/lib/module/components/PreviewForRoleChangeModal.js +1 -1
  135. package/lib/module/components/RoomSettingsModalContent.js +6 -9
  136. package/lib/module/components/RoomSettingsModalContent.js.map +1 -1
  137. package/lib/module/components/StopRecordingModalContent.js +4 -1
  138. package/lib/module/components/StopRecordingModalContent.js.map +1 -1
  139. package/lib/module/hooks-util.js +182 -24
  140. package/lib/module/hooks-util.js.map +1 -1
  141. package/lib/module/index.js +1 -0
  142. package/lib/module/index.js.map +1 -1
  143. package/lib/module/redux/actionTypes.js +6 -1
  144. package/lib/module/redux/actionTypes.js.map +1 -1
  145. package/lib/module/redux/actions/index.js +18 -0
  146. package/lib/module/redux/actions/index.js.map +1 -1
  147. package/lib/module/redux/reducers/appState.js +17 -1
  148. package/lib/module/redux/reducers/appState.js.map +1 -1
  149. package/lib/module/redux/reducers/userState.js +5 -1
  150. package/lib/module/redux/reducers/userState.js.map +1 -1
  151. package/lib/module/types.js +9 -0
  152. package/lib/module/types.js.map +1 -1
  153. package/lib/module/utils/types.js +11 -0
  154. package/lib/module/utils/types.js.map +1 -1
  155. package/lib/module/utils.js +0 -6
  156. package/lib/module/utils.js.map +1 -1
  157. package/lib/typescript/HMSPrebuilt.d.ts +2 -16
  158. package/lib/typescript/HMSPrebuilt.d.ts.map +1 -1
  159. package/lib/typescript/HMSRoomSetup.d.ts.map +1 -1
  160. package/lib/typescript/Icons/Hand/index.d.ts +1 -0
  161. package/lib/typescript/Icons/Hand/index.d.ts.map +1 -1
  162. package/lib/typescript/Icons/Recording/index.d.ts +1 -0
  163. package/lib/typescript/Icons/Recording/index.d.ts.map +1 -1
  164. package/lib/typescript/components/DisplayView.d.ts.map +1 -1
  165. package/lib/typescript/components/EndRoomModal.d.ts +6 -0
  166. package/lib/typescript/components/EndRoomModal.d.ts.map +1 -0
  167. package/lib/typescript/components/EndRoomModalContent.d.ts.map +1 -1
  168. package/lib/typescript/components/Footer.d.ts +1 -0
  169. package/lib/typescript/components/Footer.d.ts.map +1 -1
  170. package/lib/typescript/components/HMSKeyboardAvoidingView.d.ts +1 -0
  171. package/lib/typescript/components/HMSKeyboardAvoidingView.d.ts.map +1 -1
  172. package/lib/typescript/components/HMSManageLeave.d.ts.map +1 -1
  173. package/lib/typescript/components/HMSNotification.d.ts +1 -0
  174. package/lib/typescript/components/HMSNotification.d.ts.map +1 -1
  175. package/lib/typescript/components/HMSNotifications.d.ts +1 -0
  176. package/lib/typescript/components/HMSNotifications.d.ts.map +1 -1
  177. package/lib/typescript/components/HMSOverlayChatView.d.ts.map +1 -1
  178. package/lib/typescript/components/HMSReconnectingNotification.d.ts +5 -0
  179. package/lib/typescript/components/HMSReconnectingNotification.d.ts.map +1 -0
  180. package/lib/typescript/components/HMSTerminalErrorNotification.d.ts +10 -0
  181. package/lib/typescript/components/HMSTerminalErrorNotification.d.ts.map +1 -0
  182. package/lib/typescript/components/LeaveRoomBottomSheet.d.ts +6 -0
  183. package/lib/typescript/components/LeaveRoomBottomSheet.d.ts.map +1 -0
  184. package/lib/typescript/components/Meeting.d.ts.map +1 -1
  185. package/lib/typescript/components/PIPView.d.ts.map +1 -1
  186. package/lib/typescript/components/Participants/ParticipantsItemOptions.d.ts.map +1 -1
  187. package/lib/typescript/components/PeerVideoTile/PeerAudioIndicator.d.ts.map +1 -1
  188. package/lib/typescript/components/PeerVideoTile/PeerVideoTileView.d.ts.map +1 -1
  189. package/lib/typescript/components/RoomSettingsModalContent.d.ts.map +1 -1
  190. package/lib/typescript/components/StopRecordingModalContent.d.ts.map +1 -1
  191. package/lib/typescript/hooks-util.d.ts +20 -7
  192. package/lib/typescript/hooks-util.d.ts.map +1 -1
  193. package/lib/typescript/index.d.ts +2 -0
  194. package/lib/typescript/index.d.ts.map +1 -1
  195. package/lib/typescript/redux/actionTypes.d.ts +3 -0
  196. package/lib/typescript/redux/actionTypes.d.ts.map +1 -1
  197. package/lib/typescript/redux/actions/index.d.ts +23 -14
  198. package/lib/typescript/redux/actions/index.d.ts.map +1 -1
  199. package/lib/typescript/redux/index.d.ts +5 -7
  200. package/lib/typescript/redux/index.d.ts.map +1 -1
  201. package/lib/typescript/redux/reducers/appState.d.ts +4 -5
  202. package/lib/typescript/redux/reducers/appState.d.ts.map +1 -1
  203. package/lib/typescript/redux/reducers/index.d.ts +5 -7
  204. package/lib/typescript/redux/reducers/index.d.ts.map +1 -1
  205. package/lib/typescript/redux/reducers/userState.d.ts +2 -2
  206. package/lib/typescript/redux/reducers/userState.d.ts.map +1 -1
  207. package/lib/typescript/types.d.ts +79 -0
  208. package/lib/typescript/types.d.ts.map +1 -1
  209. package/lib/typescript/utils/types.d.ts +24 -0
  210. package/lib/typescript/utils/types.d.ts.map +1 -1
  211. package/lib/typescript/utils.d.ts +0 -5
  212. package/lib/typescript/utils.d.ts.map +1 -1
  213. package/package.json +2 -2
  214. package/src/HMSPrebuilt.tsx +32 -23
  215. package/src/HMSRoomSetup.tsx +105 -53
  216. package/src/Icons/Hand/assets/hand-off.png +0 -0
  217. package/src/Icons/Hand/assets/hand-off@2x.png +0 -0
  218. package/src/Icons/Hand/assets/hand-off@3x.png +0 -0
  219. package/src/Icons/Hand/index.tsx +13 -3
  220. package/src/Icons/Recording/assets/recording-off.png +0 -0
  221. package/src/Icons/Recording/assets/recording-off@2x.png +0 -0
  222. package/src/Icons/Recording/assets/recording-off@3x.png +0 -0
  223. package/src/Icons/Recording/index.tsx +9 -2
  224. package/src/components/DisplayView.tsx +6 -0
  225. package/src/components/EndRoomModal.tsx +24 -0
  226. package/src/components/EndRoomModalContent.tsx +9 -2
  227. package/src/components/Footer.tsx +18 -2
  228. package/src/components/HMSKeyboardAvoidingView.tsx +5 -23
  229. package/src/components/HMSLocalScreenshareNotification.tsx +1 -1
  230. package/src/components/HMSManageLeave.tsx +4 -228
  231. package/src/components/HMSNotification.tsx +4 -2
  232. package/src/components/HMSNotifications.tsx +41 -7
  233. package/src/components/HMSOverlayChatView.tsx +6 -1
  234. package/src/components/HMSReconnectingNotification.tsx +27 -0
  235. package/src/components/HMSRecordingIndicator.tsx +1 -1
  236. package/src/components/HMSTerminalErrorNotification.tsx +70 -0
  237. package/src/components/LeaveRoomBottomSheet.tsx +199 -0
  238. package/src/components/Meeting.tsx +7 -0
  239. package/src/components/MeetingScreenContent.tsx +2 -2
  240. package/src/components/PIPView.tsx +113 -25
  241. package/src/components/Participants/ParticipantsItemOptions.tsx +26 -4
  242. package/src/components/PeerVideoTile/AvatarView.tsx +4 -4
  243. package/src/components/PeerVideoTile/PeerAudioIndicator.tsx +6 -1
  244. package/src/components/PeerVideoTile/PeerVideoTileView.tsx +4 -2
  245. package/src/components/PreviewForRoleChangeModal.tsx +1 -1
  246. package/src/components/RoomSettingsModalContent.tsx +5 -9
  247. package/src/components/StopRecordingModalContent.tsx +3 -1
  248. package/src/hooks-util.ts +240 -23
  249. package/src/index.ts +2 -0
  250. package/src/redux/actionTypes.ts +7 -0
  251. package/src/redux/actions/index.ts +19 -7
  252. package/src/redux/reducers/appState.ts +18 -1
  253. package/src/redux/reducers/userState.ts +7 -3
  254. package/src/types.ts +71 -0
  255. package/src/utils/types.ts +27 -0
  256. 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,OAAA;AACA,IAAAE,YAAA,GAAAF,OAAA;AAGA,IAAAG,UAAA,GAAAH,OAAA;AACA,IAAAI,MAAA,GAAAJ,OAAA;AACA,IAAAK,gBAAA,GAAAL,OAAA;AACA,IAAAM,QAAA,GAAAN,OAAA;AAAkE,SAAAO,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OA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DxC,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,OAAA;AACA,IAAAK,gBAAA,GAAAL,OAAA;AACA,IAAAM,QAAA,GAAAN,OAAA;AAAkE,SAAAO,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,C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;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)();
@@ -1317,12 +1394,12 @@ const useShouldGoLive = () => {
1317
1394
  return shouldGoLive;
1318
1395
  };
1319
1396
  exports.useShouldGoLive = useShouldGoLive;
1320
- const useLeaveMethods = isUnmounted => {
1397
+ const useLeaveMethods = () => {
1321
1398
  const navigation = (0, _react.useContext)(_native.NavigationContext);
1322
1399
  const hmsInstance = useHMSInstance();
1323
1400
  const dispatch = (0, _reactRedux.useDispatch)();
1324
1401
  const reduxStore = (0, _reactRedux.useStore)();
1325
- const destroy = (0, _react.useCallback)(() => {
1402
+ const destroy = (0, _react.useCallback)(reason => {
1326
1403
  try {
1327
1404
  const s = hmsInstance.destroy();
1328
1405
  console.log('Destroy Success: ', s);
@@ -1348,9 +1425,9 @@ const useLeaveMethods = isUnmounted => {
1348
1425
 
1349
1426
  const onLeave = reduxStore.getState().user.onLeave;
1350
1427
  if (typeof onLeave === 'function') {
1351
- onLeave();
1428
+ onLeave(reason);
1352
1429
  dispatch((0, _actions.clearStore)());
1353
- } else if (navigation && navigation.canGoBack() && !isUnmounted) {
1430
+ } else if (navigation && typeof navigation.canGoBack === 'function' && navigation.canGoBack()) {
1354
1431
  navigation.goBack();
1355
1432
  dispatch((0, _actions.clearStore)());
1356
1433
  } else {
@@ -1364,8 +1441,8 @@ const useLeaveMethods = isUnmounted => {
1364
1441
  return Promise.reject(e);
1365
1442
  }
1366
1443
  }, [hmsInstance]);
1367
- const leave = (0, _react.useCallback)(async function () {
1368
- let shouldEndStream = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
1444
+ const leave = (0, _react.useCallback)(async function (reason) {
1445
+ let shouldEndStream = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
1369
1446
  if (shouldEndStream) {
1370
1447
  hmsInstance.stopHLSStreaming().catch(error => {
1371
1448
  console.log('Stop HLS Streaming Error: ', error);
@@ -1374,26 +1451,26 @@ const useLeaveMethods = isUnmounted => {
1374
1451
  try {
1375
1452
  const d = await hmsInstance.leave();
1376
1453
  console.log('Leave Success: ', d);
1377
- await destroy();
1454
+ await destroy(reason);
1378
1455
  } catch (e) {
1379
1456
  console.log(`Leave Room Error: ${e}`);
1380
1457
  _reactNativeSimpleToast.default.showWithGravity(`Leave Room Error: ${e}`, _reactNativeSimpleToast.default.LONG, _reactNativeSimpleToast.default.TOP);
1381
1458
  }
1382
1459
  }, [destroy, hmsInstance]);
1383
- const goToPreview = (0, _react.useCallback)(async () => {
1460
+ const prebuiltCleanUp = (0, _react.useCallback)(async () => {
1384
1461
  try {
1385
1462
  await hmsInstance.leave();
1386
1463
  await hmsInstance.destroy();
1387
1464
  dispatch((0, _actions.clearStore)());
1388
1465
  } catch (error) {
1389
- _reactNativeSimpleToast.default.showWithGravity(`Unable to go to Preview: ${error}`, _reactNativeSimpleToast.default.LONG, _reactNativeSimpleToast.default.TOP);
1466
+ _reactNativeSimpleToast.default.showWithGravity(`Unable to leave or destroy: ${error}`, _reactNativeSimpleToast.default.LONG, _reactNativeSimpleToast.default.TOP);
1390
1467
  }
1391
1468
  }, [hmsInstance]);
1392
- const endRoom = (0, _react.useCallback)(async () => {
1469
+ const endRoom = (0, _react.useCallback)(async reason => {
1393
1470
  try {
1394
1471
  const d = await hmsInstance.endRoom('Host ended the room');
1395
1472
  console.log('EndRoom Success: ', d);
1396
- await destroy();
1473
+ await destroy(reason);
1397
1474
  } catch (e) {
1398
1475
  console.log('EndRoom Error: ', e);
1399
1476
  }
@@ -1402,7 +1479,7 @@ const useLeaveMethods = isUnmounted => {
1402
1479
  destroy,
1403
1480
  leave,
1404
1481
  endRoom,
1405
- goToPreview
1482
+ prebuiltCleanUp
1406
1483
  };
1407
1484
  };
1408
1485
 
@@ -1550,4 +1627,91 @@ const useHMSConferencingScreenConfig = (selector, equalityFn) => {
1550
1627
  }, equalityFn);
1551
1628
  };
1552
1629
  exports.useHMSConferencingScreenConfig = useHMSConferencingScreenConfig;
1630
+ const useBackButtonPress = () => {
1631
+ const {
1632
+ handleModalVisibleType
1633
+ } = useModalType();
1634
+ const handleBackPress = (0, _reactRedux.useSelector)(state => state.app.handleBackButton);
1635
+ (0, _react.useEffect)(() => {
1636
+ if (handleBackPress) {
1637
+ const backPressHandler = () => {
1638
+ handleModalVisibleType(_types.ModalTypes.LEAVE_ROOM);
1639
+
1640
+ /**
1641
+ * When true is returned the event will not be bubbled up
1642
+ * & no other back action will execute
1643
+ */
1644
+ return true;
1645
+
1646
+ /**
1647
+ * Returning false will let the event to bubble up & let other event listeners
1648
+ * or the system's default back action to be executed.
1649
+ */
1650
+ // return false;
1651
+ };
1652
+
1653
+ const subscription = _reactNative.BackHandler.addEventListener('hardwareBackPress', backPressHandler);
1654
+ return () => {
1655
+ if (typeof subscription.remove === 'function') {
1656
+ subscription.remove();
1657
+ } else {
1658
+ _reactNative.BackHandler.removeEventListener('hardwareBackPress', backPressHandler);
1659
+ }
1660
+ };
1661
+ }
1662
+ }, [handleBackPress, handleModalVisibleType]);
1663
+ };
1664
+ exports.useBackButtonPress = useBackButtonPress;
1665
+ const useSavePropsToStore = (props, dispatch) => {
1666
+ const {
1667
+ roomCode,
1668
+ options,
1669
+ onLeave,
1670
+ handleBackButton,
1671
+ autoEnterPipMode
1672
+ } = props;
1673
+ (0, _react.useEffect)(() => {
1674
+ dispatch((0, _actions.setPrebuiltData)({
1675
+ roomCode,
1676
+ options
1677
+ }));
1678
+ }, [roomCode, options]);
1679
+ (0, _react.useEffect)(() => {
1680
+ dispatch((0, _actions.setOnLeaveHandler)(onLeave));
1681
+ }, [onLeave]);
1682
+ (0, _react.useEffect)(() => {
1683
+ if (_reactNative.Platform.OS === 'android') {
1684
+ dispatch((0, _actions.setHandleBackButton)(handleBackButton));
1685
+ }
1686
+ }, [handleBackButton]);
1687
+ (0, _react.useEffect)(() => {
1688
+ if (_reactNative.Platform.OS === 'android') {
1689
+ dispatch((0, _actions.setAutoEnterPipMode)(autoEnterPipMode));
1690
+ }
1691
+ }, [autoEnterPipMode]);
1692
+ };
1693
+ exports.useSavePropsToStore = useSavePropsToStore;
1694
+ const useStartRecording = () => {
1695
+ const dispatch = (0, _reactRedux.useDispatch)();
1696
+ const hmsInstance = useHMSInstance();
1697
+ const startRecording = (0, _react.useCallback)(() => {
1698
+ dispatch((0, _actions.setStartingOrStoppingRecording)(true));
1699
+ hmsInstance.startRTMPOrRecording({
1700
+ record: true
1701
+ }).catch(error => {
1702
+ (0, _reactRedux.batch)(() => {
1703
+ dispatch((0, _actions.setStartingOrStoppingRecording)(false));
1704
+ dispatch((0, _actions.addNotification)({
1705
+ id: Math.random().toString(16).slice(2),
1706
+ type: _types2.NotificationTypes.ERROR,
1707
+ message: error.message
1708
+ }));
1709
+ });
1710
+ });
1711
+ }, [hmsInstance]);
1712
+ return {
1713
+ startRecording
1714
+ };
1715
+ };
1716
+ exports.useStartRecording = useStartRecording;
1553
1717
  //# sourceMappingURL=hooks-util.js.map