@100mslive/react-native-room-kit 0.1.0 → 1.0.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.
- package/README.md +1 -10
- package/lib/commonjs/HMSPrebuilt.js +6 -6
- package/lib/commonjs/HMSPrebuilt.js.map +1 -1
- package/lib/commonjs/HMSRoomSetup.js +27 -30
- package/lib/commonjs/HMSRoomSetup.js.map +1 -1
- package/lib/commonjs/Icons/AlertTriangle/assets/alert-triangle-filled.png +0 -0
- package/lib/commonjs/Icons/AlertTriangle/assets/alert-triangle-filled@2x.png +0 -0
- package/lib/commonjs/Icons/AlertTriangle/assets/alert-triangle-filled@3x.png +0 -0
- package/lib/commonjs/Icons/AlertTriangle/index.js +2 -1
- package/lib/commonjs/Icons/AlertTriangle/index.js.map +1 -1
- package/lib/commonjs/Icons/Eye/assets/eye-on-small.png +0 -0
- package/lib/commonjs/Icons/Eye/assets/eye-on-small@2x.png +0 -0
- package/lib/commonjs/Icons/Eye/assets/eye-on-small@3x.png +0 -0
- package/lib/commonjs/Icons/Eye/index.js +35 -0
- package/lib/commonjs/Icons/Eye/index.js.map +1 -0
- package/lib/commonjs/Icons/Hamburger/assets/hamburger.png +0 -0
- package/lib/commonjs/Icons/Hamburger/assets/hamburger@2x.png +0 -0
- package/lib/commonjs/Icons/Hamburger/assets/hamburger@3x.png +0 -0
- package/lib/commonjs/Icons/Person/assets/person-left.png +0 -0
- package/lib/commonjs/Icons/Person/assets/person-left@2x.png +0 -0
- package/lib/commonjs/Icons/Person/assets/person-left@3x.png +0 -0
- package/lib/commonjs/Icons/Person/assets/person-off.png +0 -0
- package/lib/commonjs/Icons/Person/assets/person-off@2x.png +0 -0
- package/lib/commonjs/Icons/Person/assets/person-off@3x.png +0 -0
- package/lib/commonjs/Icons/Person/assets/person-rectangle.png +0 -0
- package/lib/commonjs/Icons/Person/assets/person-rectangle@2x.png +0 -0
- package/lib/commonjs/Icons/Person/assets/person-rectangle@3x.png +0 -0
- package/lib/commonjs/Icons/Person/index.js +2 -1
- package/lib/commonjs/Icons/Person/index.js.map +1 -1
- package/lib/commonjs/Icons/Radio/assets/radio-xlarge.png +0 -0
- package/lib/commonjs/Icons/Radio/assets/radio-xlarge@2x.png +0 -0
- package/lib/commonjs/Icons/Radio/assets/radio-xlarge@3x.png +0 -0
- package/lib/commonjs/Icons/Radio/index.js +29 -1
- package/lib/commonjs/Icons/Radio/index.js.map +1 -1
- package/lib/commonjs/Icons/Search/assets/search.png +0 -0
- package/lib/commonjs/Icons/Search/assets/search@2x.png +0 -0
- package/lib/commonjs/Icons/Search/assets/search@3x.png +0 -0
- package/lib/commonjs/Icons/Search/index.js +34 -0
- package/lib/commonjs/Icons/Search/index.js.map +1 -0
- package/lib/commonjs/Icons/Stop/assets/stop.png +0 -0
- package/lib/commonjs/Icons/Stop/assets/stop@2x.png +0 -0
- package/lib/commonjs/Icons/Stop/assets/stop@3x.png +0 -0
- package/lib/commonjs/Icons/Stop/index.js.map +1 -1
- package/lib/commonjs/Icons/index.js +22 -0
- package/lib/commonjs/Icons/index.js.map +1 -1
- package/lib/commonjs/assets/audio-level-white.json +1271 -0
- package/lib/commonjs/assets/empty-chat-illustration/empty-chat.png +0 -0
- package/lib/commonjs/assets/empty-chat-illustration/empty-chat@2x.png +0 -0
- package/lib/commonjs/assets/empty-chat-illustration/empty-chat@3x.png +0 -0
- package/lib/commonjs/assets/welcome.png +0 -0
- package/lib/commonjs/components/AnimatedFooter.js +35 -0
- package/lib/commonjs/components/AnimatedFooter.js.map +1 -0
- package/lib/commonjs/components/AnimatedHLSFooter.js +36 -0
- package/lib/commonjs/components/AnimatedHLSFooter.js.map +1 -0
- package/lib/commonjs/components/AnimatedHeader.js +44 -0
- package/lib/commonjs/components/AnimatedHeader.js.map +1 -0
- package/lib/commonjs/components/BottomSheet.js +6 -3
- package/lib/commonjs/components/BottomSheet.js.map +1 -1
- package/lib/commonjs/components/ChangeNameModalContent.js +0 -12
- package/lib/commonjs/components/ChangeNameModalContent.js.map +1 -1
- package/lib/commonjs/components/Chat/ChatBanner.js +35 -55
- package/lib/commonjs/components/Chat/ChatBanner.js.map +1 -1
- package/lib/commonjs/components/Chat/ChatFilterBottomSheetOpener.js +83 -0
- package/lib/commonjs/components/Chat/ChatFilterBottomSheetOpener.js.map +1 -0
- package/lib/commonjs/components/Chat/ChatFilterBottomSheetView.js +69 -0
- package/lib/commonjs/components/Chat/ChatFilterBottomSheetView.js.map +1 -0
- package/lib/commonjs/components/Chat/ChatFilterItem.js +71 -0
- package/lib/commonjs/components/Chat/ChatFilterItem.js.map +1 -0
- package/lib/commonjs/components/Chat/ChatFilterView.js +198 -0
- package/lib/commonjs/components/Chat/ChatFilterView.js.map +1 -0
- package/lib/commonjs/components/Chat/ChatList.js +6 -6
- package/lib/commonjs/components/Chat/ChatList.js.map +1 -1
- package/lib/commonjs/components/Chat/ChatMessage.js +35 -135
- package/lib/commonjs/components/Chat/ChatMessage.js.map +1 -1
- package/lib/commonjs/components/Chat/PinnedMessage.js +39 -43
- package/lib/commonjs/components/Chat/PinnedMessage.js.map +1 -1
- package/lib/commonjs/components/ChatAndParticipants/ChatAndParticipantsBottomSheet.js +42 -0
- package/lib/commonjs/components/ChatAndParticipants/ChatAndParticipantsBottomSheet.js.map +1 -0
- package/lib/commonjs/components/ChatAndParticipants/ChatAndParticipantsHeader.js +105 -0
- package/lib/commonjs/components/ChatAndParticipants/ChatAndParticipantsHeader.js.map +1 -0
- package/lib/commonjs/components/ChatAndParticipants/ChatAndParticipantsView.js +66 -0
- package/lib/commonjs/components/ChatAndParticipants/ChatAndParticipantsView.js.map +1 -0
- package/lib/commonjs/components/ChatAndParticipants/ChatView.js +37 -0
- package/lib/commonjs/components/ChatAndParticipants/ChatView.js.map +1 -0
- package/lib/commonjs/components/{Participants/SearchableParticipantsView.js → ChatAndParticipants/ParticipantsView.js} +24 -12
- package/lib/commonjs/components/ChatAndParticipants/ParticipantsView.js.map +1 -0
- package/lib/commonjs/components/ChatAndParticipants/index.js +17 -0
- package/lib/commonjs/components/ChatAndParticipants/index.js.map +1 -0
- package/lib/commonjs/components/CompanyLogo.js +5 -4
- package/lib/commonjs/components/CompanyLogo.js.map +1 -1
- package/lib/commonjs/components/DefaultModal.js +2 -6
- package/lib/commonjs/components/DefaultModal.js.map +1 -1
- package/lib/commonjs/components/DisplayView.js +9 -21
- package/lib/commonjs/components/DisplayView.js.map +1 -1
- package/lib/commonjs/components/EndRoomModalContent.js +20 -6
- package/lib/commonjs/components/EndRoomModalContent.js.map +1 -1
- package/lib/commonjs/components/Footer.js +41 -27
- package/lib/commonjs/components/Footer.js.map +1 -1
- package/lib/commonjs/components/FullScreenVideoView.js +74 -0
- package/lib/commonjs/components/FullScreenVideoView.js.map +1 -0
- package/lib/commonjs/components/GridView.js +129 -48
- package/lib/commonjs/components/GridView.js.map +1 -1
- package/lib/commonjs/components/{ParticipantsModal.js → HLSFooter.js} +19 -27
- package/lib/commonjs/components/HLSFooter.js.map +1 -0
- package/lib/commonjs/components/HLSView.js +10 -22
- package/lib/commonjs/components/HLSView.js.map +1 -1
- package/lib/commonjs/components/HMSChat.js +15 -14
- package/lib/commonjs/components/HMSChat.js.map +1 -1
- package/lib/commonjs/components/HMSHLSMessage.js +67 -0
- package/lib/commonjs/components/HMSHLSMessage.js.map +1 -0
- package/lib/commonjs/components/HMSHLSMessageList.js +58 -0
- package/lib/commonjs/components/HMSHLSMessageList.js.map +1 -0
- package/lib/commonjs/components/HMSHLSNotStarted.js +27 -24
- package/lib/commonjs/components/HMSHLSNotStarted.js.map +1 -1
- package/lib/commonjs/components/HMSHandRaiseNotification.js +84 -0
- package/lib/commonjs/components/HMSHandRaiseNotification.js.map +1 -0
- package/lib/commonjs/components/HMSKeyboardAvoidingView.js +49 -0
- package/lib/commonjs/components/HMSKeyboardAvoidingView.js.map +1 -0
- package/lib/commonjs/components/HMSLiveIndicator.js +105 -0
- package/lib/commonjs/components/HMSLiveIndicator.js.map +1 -0
- package/lib/commonjs/components/HMSLocalScreenshareNotification.js +38 -0
- package/lib/commonjs/components/HMSLocalScreenshareNotification.js.map +1 -0
- package/lib/commonjs/components/HMSLocalVideoView.js +4 -23
- package/lib/commonjs/components/HMSLocalVideoView.js.map +1 -1
- package/lib/commonjs/components/HMSManageAudioOutput.js +7 -1
- package/lib/commonjs/components/HMSManageAudioOutput.js.map +1 -1
- package/lib/commonjs/components/HMSManageLeave.js +47 -37
- package/lib/commonjs/components/HMSManageLeave.js.map +1 -1
- package/lib/commonjs/components/HMSManageRaiseHand.js +2 -15
- package/lib/commonjs/components/HMSManageRaiseHand.js.map +1 -1
- package/lib/commonjs/components/HMSNotification.js +96 -0
- package/lib/commonjs/components/HMSNotification.js.map +1 -0
- package/lib/commonjs/components/HMSNotifications.js +114 -0
- package/lib/commonjs/components/HMSNotifications.js.map +1 -0
- package/lib/commonjs/components/HMSOverlayChatView.js +30 -0
- package/lib/commonjs/components/HMSOverlayChatView.js.map +1 -0
- package/lib/commonjs/components/HMSPreviewJoinButton.js +1 -2
- package/lib/commonjs/components/HMSPreviewJoinButton.js.map +1 -1
- package/lib/commonjs/components/HMSPreviewNetworkQuality.js +1 -1
- package/lib/commonjs/components/HMSPreviewNetworkQuality.js.map +1 -1
- package/lib/commonjs/components/HMSPreviewSubtitle.js +1 -3
- package/lib/commonjs/components/HMSPreviewSubtitle.js.map +1 -1
- package/lib/commonjs/components/HMSPreviewTitle.js +1 -3
- package/lib/commonjs/components/HMSPreviewTitle.js.map +1 -1
- package/lib/commonjs/components/HMSRecordingIndicator.js +7 -3
- package/lib/commonjs/components/HMSRecordingIndicator.js.map +1 -1
- package/lib/commonjs/components/HMSRoleChangeDeclinedNotification.js +30 -0
- package/lib/commonjs/components/HMSRoleChangeDeclinedNotification.js.map +1 -0
- package/lib/commonjs/components/HMSSendMessageInput.js +57 -0
- package/lib/commonjs/components/HMSSendMessageInput.js.map +1 -0
- package/lib/commonjs/components/HMSTextInput.js +98 -12
- package/lib/commonjs/components/HMSTextInput.js.map +1 -1
- package/lib/commonjs/components/HMSVideoView.js +43 -0
- package/lib/commonjs/components/HMSVideoView.js.map +1 -0
- package/lib/commonjs/components/Header.js +19 -123
- package/lib/commonjs/components/Header.js.map +1 -1
- package/lib/commonjs/components/LocalPeerScreenshareView.js +1 -7
- package/lib/commonjs/components/LocalPeerScreenshareView.js.map +1 -1
- package/lib/commonjs/components/Meeting.js +7 -5
- package/lib/commonjs/components/Meeting.js.map +1 -1
- package/lib/commonjs/components/MeetingScreenContent.js +23 -9
- package/lib/commonjs/components/MeetingScreenContent.js.map +1 -1
- package/lib/commonjs/components/MenuModal/Menu.js +2 -2
- package/lib/commonjs/components/MenuModal/Menu.js.map +1 -1
- package/lib/commonjs/components/MiniView.js +8 -3
- package/lib/commonjs/components/MiniView.js.map +1 -1
- package/lib/commonjs/components/Modals.js +88 -317
- package/lib/commonjs/components/Modals.js.map +1 -1
- package/lib/commonjs/components/OverlayContainer.js +41 -0
- package/lib/commonjs/components/OverlayContainer.js.map +1 -0
- package/lib/commonjs/components/OverlayedViews.js +22 -0
- package/lib/commonjs/components/OverlayedViews.js.map +1 -0
- package/lib/commonjs/components/PaginationDots.js +4 -4
- package/lib/commonjs/components/PaginationDots.js.map +1 -1
- package/lib/commonjs/components/Participants/ParticipantsGroupHeader.js +131 -0
- package/lib/commonjs/components/Participants/ParticipantsGroupHeader.js.map +1 -0
- package/lib/commonjs/components/Participants/ParticipantsGroupOptions.js +80 -0
- package/lib/commonjs/components/Participants/ParticipantsGroupOptions.js.map +1 -0
- package/lib/commonjs/components/Participants/ParticipantsItem.js +132 -0
- package/lib/commonjs/components/Participants/ParticipantsItem.js.map +1 -0
- package/lib/commonjs/components/Participants/ParticipantsItemOption.js +46 -0
- package/lib/commonjs/components/Participants/ParticipantsItemOption.js.map +1 -0
- package/lib/commonjs/components/Participants/ParticipantsItemOptions.js +220 -0
- package/lib/commonjs/components/Participants/ParticipantsItemOptions.js.map +1 -0
- package/lib/commonjs/components/Participants/ParticipantsList.js +40 -224
- package/lib/commonjs/components/Participants/ParticipantsList.js.map +1 -1
- package/lib/commonjs/components/Participants/ParticipantsSeachInput.js +36 -30
- package/lib/commonjs/components/Participants/ParticipantsSeachInput.js.map +1 -1
- package/lib/commonjs/components/Participants/index.js +0 -33
- package/lib/commonjs/components/Participants/index.js.map +1 -1
- package/lib/commonjs/components/PeerMinimizedView.js +1 -1
- package/lib/commonjs/components/PeerSettingsModalContent.js +47 -123
- package/lib/commonjs/components/PeerSettingsModalContent.js.map +1 -1
- package/lib/commonjs/components/PeerVideoTile/AvatarView.js +19 -5
- package/lib/commonjs/components/PeerVideoTile/AvatarView.js.map +1 -1
- package/lib/commonjs/components/PeerVideoTile/HMSFullScreenButton.js +45 -0
- package/lib/commonjs/components/PeerVideoTile/HMSFullScreenButton.js.map +1 -0
- package/lib/commonjs/components/PeerVideoTile/HMSPinchGesture.js +202 -0
- package/lib/commonjs/components/PeerVideoTile/HMSPinchGesture.js.map +1 -0
- package/lib/commonjs/components/PeerVideoTile/{PeerAudioMutedIndicator.js → PeerAudioIndicator.js} +30 -4
- package/lib/commonjs/components/PeerVideoTile/PeerAudioIndicator.js.map +1 -0
- package/lib/commonjs/components/PeerVideoTile/PeerNameAndNetwork.js +10 -2
- package/lib/commonjs/components/PeerVideoTile/PeerNameAndNetwork.js.map +1 -1
- package/lib/commonjs/components/PeerVideoTile/PeerVideoTileView.js +38 -17
- package/lib/commonjs/components/PeerVideoTile/PeerVideoTileView.js.map +1 -1
- package/lib/commonjs/components/PeerVideoTile/VideoView.js +43 -10
- package/lib/commonjs/components/PeerVideoTile/VideoView.js.map +1 -1
- package/lib/commonjs/components/PressableIcon.js +10 -5
- package/lib/commonjs/components/PressableIcon.js.map +1 -1
- package/lib/commonjs/components/Preview.js +5 -14
- package/lib/commonjs/components/Preview.js.map +1 -1
- package/lib/commonjs/components/PreviewForRoleChangeModal.js +332 -0
- package/lib/commonjs/components/PreviewForRoleChangeModal.js.map +1 -0
- package/lib/commonjs/components/ReconnectionView.js +66 -0
- package/lib/commonjs/components/ReconnectionView.js.map +1 -0
- package/lib/commonjs/components/RoomSettingsModalContent.js +25 -33
- package/lib/commonjs/components/RoomSettingsModalContent.js.map +1 -1
- package/lib/commonjs/components/RoomSettingsModalDebugModeContent.js +31 -70
- package/lib/commonjs/components/RoomSettingsModalDebugModeContent.js.map +1 -1
- package/lib/commonjs/components/StatusBar.js +7 -5
- package/lib/commonjs/components/StatusBar.js.map +1 -1
- package/lib/commonjs/components/StopRecordingModalContent.js.map +1 -1
- package/lib/commonjs/components/StreamingQualityModalContent.js +8 -9
- package/lib/commonjs/components/StreamingQualityModalContent.js.map +1 -1
- package/lib/commonjs/components/TilesContainer.js +31 -9
- package/lib/commonjs/components/TilesContainer.js.map +1 -1
- package/lib/commonjs/components/WebrtcView.js +11 -14
- package/lib/commonjs/components/WebrtcView.js.map +1 -1
- package/lib/commonjs/components/WelcomeInMeeting.js +7 -31
- package/lib/commonjs/components/WelcomeInMeeting.js.map +1 -1
- package/lib/commonjs/components/index.js +0 -33
- package/lib/commonjs/components/index.js.map +1 -1
- package/lib/commonjs/hooks-util-selectors.js +43 -9
- package/lib/commonjs/hooks-util-selectors.js.map +1 -1
- package/lib/commonjs/hooks-util.js +619 -213
- package/lib/commonjs/hooks-util.js.map +1 -1
- package/lib/commonjs/modules/HMSManager.js +3 -3
- package/lib/commonjs/modules/HMSManager.js.map +1 -1
- package/lib/commonjs/modules/parser.js +2 -3
- package/lib/commonjs/modules/parser.js.map +1 -1
- package/lib/commonjs/redux/actionTypes.js +25 -1
- package/lib/commonjs/redux/actionTypes.js.map +1 -1
- package/lib/commonjs/redux/actions/index.js +90 -1
- package/lib/commonjs/redux/actions/index.js.map +1 -1
- package/lib/commonjs/redux/reducers/appState.js +77 -2
- package/lib/commonjs/redux/reducers/appState.js.map +1 -1
- package/lib/commonjs/redux/reducers/chatWindow.js +3 -7
- package/lib/commonjs/redux/reducers/chatWindow.js.map +1 -1
- package/lib/commonjs/redux/reducers/hmsStates.js +70 -7
- package/lib/commonjs/redux/reducers/hmsStates.js.map +1 -1
- package/lib/commonjs/utils/functions.js +11 -4
- package/lib/commonjs/utils/functions.js.map +1 -1
- package/lib/commonjs/utils/theme.js +2 -0
- package/lib/commonjs/utils/theme.js.map +1 -1
- package/lib/commonjs/utils/types.js +9 -3
- package/lib/commonjs/utils/types.js.map +1 -1
- package/lib/commonjs/utils.js +8 -1
- package/lib/commonjs/utils.js.map +1 -1
- package/lib/module/HMSPrebuilt.js +6 -6
- package/lib/module/HMSPrebuilt.js.map +1 -1
- package/lib/module/HMSRoomSetup.js +29 -32
- package/lib/module/HMSRoomSetup.js.map +1 -1
- package/lib/module/Icons/AlertTriangle/assets/alert-triangle-filled.png +0 -0
- package/lib/module/Icons/AlertTriangle/assets/alert-triangle-filled@2x.png +0 -0
- package/lib/module/Icons/AlertTriangle/assets/alert-triangle-filled@3x.png +0 -0
- package/lib/module/Icons/AlertTriangle/index.js +2 -1
- package/lib/module/Icons/AlertTriangle/index.js.map +1 -1
- package/lib/module/Icons/Eye/assets/eye-on-small.png +0 -0
- package/lib/module/Icons/Eye/assets/eye-on-small@2x.png +0 -0
- package/lib/module/Icons/Eye/assets/eye-on-small@3x.png +0 -0
- package/lib/module/Icons/Eye/index.js +27 -0
- package/lib/module/Icons/Eye/index.js.map +1 -0
- package/lib/module/Icons/Hamburger/assets/hamburger.png +0 -0
- package/lib/module/Icons/Hamburger/assets/hamburger@2x.png +0 -0
- package/lib/module/Icons/Hamburger/assets/hamburger@3x.png +0 -0
- package/lib/module/Icons/Person/assets/person-left.png +0 -0
- package/lib/module/Icons/Person/assets/person-left@2x.png +0 -0
- package/lib/module/Icons/Person/assets/person-left@3x.png +0 -0
- package/lib/module/Icons/Person/assets/person-off.png +0 -0
- package/lib/module/Icons/Person/assets/person-off@2x.png +0 -0
- package/lib/module/Icons/Person/assets/person-off@3x.png +0 -0
- package/lib/module/Icons/Person/assets/person-rectangle.png +0 -0
- package/lib/module/Icons/Person/assets/person-rectangle@2x.png +0 -0
- package/lib/module/Icons/Person/assets/person-rectangle@3x.png +0 -0
- package/lib/module/Icons/Person/index.js +2 -1
- package/lib/module/Icons/Person/index.js.map +1 -1
- package/lib/module/Icons/Radio/assets/radio-xlarge.png +0 -0
- package/lib/module/Icons/Radio/assets/radio-xlarge@2x.png +0 -0
- package/lib/module/Icons/Radio/assets/radio-xlarge@3x.png +0 -0
- package/lib/module/Icons/Radio/index.js +30 -2
- package/lib/module/Icons/Radio/index.js.map +1 -1
- package/lib/module/Icons/Search/assets/search.png +0 -0
- package/lib/module/Icons/Search/assets/search@2x.png +0 -0
- package/lib/module/Icons/Search/assets/search@3x.png +0 -0
- package/lib/module/Icons/Search/index.js +26 -0
- package/lib/module/Icons/Search/index.js.map +1 -0
- package/lib/module/Icons/Stop/assets/stop.png +0 -0
- package/lib/module/Icons/Stop/assets/stop@2x.png +0 -0
- package/lib/module/Icons/Stop/assets/stop@3x.png +0 -0
- package/lib/module/Icons/Stop/index.js.map +1 -1
- package/lib/module/Icons/index.js +2 -0
- package/lib/module/Icons/index.js.map +1 -1
- package/lib/module/assets/audio-level-white.json +1271 -0
- package/lib/module/assets/empty-chat-illustration/empty-chat.png +0 -0
- package/lib/module/assets/empty-chat-illustration/empty-chat@2x.png +0 -0
- package/lib/module/assets/empty-chat-illustration/empty-chat@3x.png +0 -0
- package/lib/module/assets/welcome.png +0 -0
- package/lib/module/components/AnimatedFooter.js +26 -0
- package/lib/module/components/AnimatedFooter.js.map +1 -0
- package/lib/module/components/AnimatedHLSFooter.js +27 -0
- package/lib/module/components/AnimatedHLSFooter.js.map +1 -0
- package/lib/module/components/AnimatedHeader.js +35 -0
- package/lib/module/components/AnimatedHeader.js.map +1 -0
- package/lib/module/components/BottomSheet.js +6 -3
- package/lib/module/components/BottomSheet.js.map +1 -1
- package/lib/module/components/ChangeNameModalContent.js +2 -14
- package/lib/module/components/ChangeNameModalContent.js.map +1 -1
- package/lib/module/components/Chat/ChatBanner.js +36 -55
- package/lib/module/components/Chat/ChatBanner.js.map +1 -1
- package/lib/module/components/Chat/ChatFilterBottomSheetOpener.js +74 -0
- package/lib/module/components/Chat/ChatFilterBottomSheetOpener.js.map +1 -0
- package/lib/module/components/Chat/ChatFilterBottomSheetView.js +60 -0
- package/lib/module/components/Chat/ChatFilterBottomSheetView.js.map +1 -0
- package/lib/module/components/Chat/ChatFilterItem.js +62 -0
- package/lib/module/components/Chat/ChatFilterItem.js.map +1 -0
- package/lib/module/components/Chat/ChatFilterView.js +189 -0
- package/lib/module/components/Chat/ChatFilterView.js.map +1 -0
- package/lib/module/components/Chat/ChatList.js +6 -6
- package/lib/module/components/Chat/ChatList.js.map +1 -1
- package/lib/module/components/Chat/ChatMessage.js +36 -135
- package/lib/module/components/Chat/ChatMessage.js.map +1 -1
- package/lib/module/components/Chat/PinnedMessage.js +40 -43
- package/lib/module/components/Chat/PinnedMessage.js.map +1 -1
- package/lib/module/components/ChatAndParticipants/ChatAndParticipantsBottomSheet.js +33 -0
- package/lib/module/components/ChatAndParticipants/ChatAndParticipantsBottomSheet.js.map +1 -0
- package/lib/module/components/ChatAndParticipants/ChatAndParticipantsHeader.js +96 -0
- package/lib/module/components/ChatAndParticipants/ChatAndParticipantsHeader.js.map +1 -0
- package/lib/module/components/ChatAndParticipants/ChatAndParticipantsView.js +57 -0
- package/lib/module/components/ChatAndParticipants/ChatAndParticipantsView.js.map +1 -0
- package/lib/module/components/ChatAndParticipants/ChatView.js +28 -0
- package/lib/module/components/ChatAndParticipants/ChatView.js.map +1 -0
- package/lib/module/components/ChatAndParticipants/ParticipantsView.js +30 -0
- package/lib/module/components/ChatAndParticipants/ParticipantsView.js.map +1 -0
- package/lib/module/components/ChatAndParticipants/index.js +2 -0
- package/lib/module/components/ChatAndParticipants/index.js.map +1 -0
- package/lib/module/components/CompanyLogo.js +5 -4
- package/lib/module/components/CompanyLogo.js.map +1 -1
- package/lib/module/components/DefaultModal.js +2 -6
- package/lib/module/components/DefaultModal.js.map +1 -1
- package/lib/module/components/DisplayView.js +10 -22
- package/lib/module/components/DisplayView.js.map +1 -1
- package/lib/module/components/EndRoomModalContent.js +20 -6
- package/lib/module/components/EndRoomModalContent.js.map +1 -1
- package/lib/module/components/Footer.js +43 -29
- package/lib/module/components/Footer.js.map +1 -1
- package/lib/module/components/FullScreenVideoView.js +64 -0
- package/lib/module/components/FullScreenVideoView.js.map +1 -0
- package/lib/module/components/GridView.js +130 -49
- package/lib/module/components/GridView.js.map +1 -1
- package/lib/module/components/HLSFooter.js +26 -0
- package/lib/module/components/HLSFooter.js.map +1 -0
- package/lib/module/components/HLSView.js +11 -23
- package/lib/module/components/HLSView.js.map +1 -1
- package/lib/module/components/HMSChat.js +16 -15
- package/lib/module/components/HMSChat.js.map +1 -1
- package/lib/module/components/HMSHLSMessage.js +58 -0
- package/lib/module/components/HMSHLSMessage.js.map +1 -0
- package/lib/module/components/HMSHLSMessageList.js +49 -0
- package/lib/module/components/HMSHLSMessageList.js.map +1 -0
- package/lib/module/components/HMSHLSNotStarted.js +29 -26
- package/lib/module/components/HMSHLSNotStarted.js.map +1 -1
- package/lib/module/components/HMSHandRaiseNotification.js +75 -0
- package/lib/module/components/HMSHandRaiseNotification.js.map +1 -0
- package/lib/module/components/HMSKeyboardAvoidingView.js +40 -0
- package/lib/module/components/HMSKeyboardAvoidingView.js.map +1 -0
- package/lib/module/components/HMSLiveIndicator.js +96 -0
- package/lib/module/components/HMSLiveIndicator.js.map +1 -0
- package/lib/module/components/HMSLocalScreenshareNotification.js +29 -0
- package/lib/module/components/HMSLocalScreenshareNotification.js.map +1 -0
- package/lib/module/components/HMSLocalVideoView.js +4 -23
- package/lib/module/components/HMSLocalVideoView.js.map +1 -1
- package/lib/module/components/HMSManageAudioOutput.js +8 -2
- package/lib/module/components/HMSManageAudioOutput.js.map +1 -1
- package/lib/module/components/HMSManageLeave.js +49 -39
- package/lib/module/components/HMSManageLeave.js.map +1 -1
- package/lib/module/components/HMSManageRaiseHand.js +2 -15
- package/lib/module/components/HMSManageRaiseHand.js.map +1 -1
- package/lib/module/components/HMSNotification.js +87 -0
- package/lib/module/components/HMSNotification.js.map +1 -0
- package/lib/module/components/HMSNotifications.js +105 -0
- package/lib/module/components/HMSNotifications.js.map +1 -0
- package/lib/module/components/HMSOverlayChatView.js +20 -0
- package/lib/module/components/HMSOverlayChatView.js.map +1 -0
- package/lib/module/components/HMSPreviewJoinButton.js +2 -3
- package/lib/module/components/HMSPreviewJoinButton.js.map +1 -1
- package/lib/module/components/HMSPreviewNetworkQuality.js +1 -1
- package/lib/module/components/HMSPreviewNetworkQuality.js.map +1 -1
- package/lib/module/components/HMSPreviewSubtitle.js +2 -4
- package/lib/module/components/HMSPreviewSubtitle.js.map +1 -1
- package/lib/module/components/HMSPreviewTitle.js +2 -4
- package/lib/module/components/HMSPreviewTitle.js.map +1 -1
- package/lib/module/components/HMSRecordingIndicator.js +7 -3
- package/lib/module/components/HMSRecordingIndicator.js.map +1 -1
- package/lib/module/components/HMSRoleChangeDeclinedNotification.js +21 -0
- package/lib/module/components/HMSRoleChangeDeclinedNotification.js.map +1 -0
- package/lib/module/components/HMSSendMessageInput.js +48 -0
- package/lib/module/components/HMSSendMessageInput.js.map +1 -0
- package/lib/module/components/HMSTextInput.js +99 -13
- package/lib/module/components/HMSTextInput.js.map +1 -1
- package/lib/module/components/HMSVideoView.js +34 -0
- package/lib/module/components/HMSVideoView.js.map +1 -0
- package/lib/module/components/Header.js +18 -123
- package/lib/module/components/Header.js.map +1 -1
- package/lib/module/components/LocalPeerScreenshareView.js +1 -6
- package/lib/module/components/LocalPeerScreenshareView.js.map +1 -1
- package/lib/module/components/Meeting.js +9 -7
- package/lib/module/components/Meeting.js.map +1 -1
- package/lib/module/components/MeetingScreenContent.js +25 -11
- package/lib/module/components/MeetingScreenContent.js.map +1 -1
- package/lib/module/components/MenuModal/Menu.js +2 -2
- package/lib/module/components/MenuModal/Menu.js.map +1 -1
- package/lib/module/components/MiniView.js +8 -3
- package/lib/module/components/MiniView.js.map +1 -1
- package/lib/module/components/Modals.js +88 -313
- package/lib/module/components/Modals.js.map +1 -1
- package/lib/module/components/OverlayContainer.js +32 -0
- package/lib/module/components/OverlayContainer.js.map +1 -0
- package/lib/module/components/OverlayedViews.js +13 -0
- package/lib/module/components/OverlayedViews.js.map +1 -0
- package/lib/module/components/PaginationDots.js +4 -4
- package/lib/module/components/PaginationDots.js.map +1 -1
- package/lib/module/components/Participants/ParticipantsGroupHeader.js +121 -0
- package/lib/module/components/Participants/ParticipantsGroupHeader.js.map +1 -0
- package/lib/module/components/Participants/ParticipantsGroupOptions.js +71 -0
- package/lib/module/components/Participants/ParticipantsGroupOptions.js.map +1 -0
- package/lib/module/components/Participants/ParticipantsItem.js +123 -0
- package/lib/module/components/Participants/ParticipantsItem.js.map +1 -0
- package/lib/module/components/Participants/ParticipantsItemOption.js +37 -0
- package/lib/module/components/Participants/ParticipantsItemOption.js.map +1 -0
- package/lib/module/components/Participants/ParticipantsItemOptions.js +211 -0
- package/lib/module/components/Participants/ParticipantsItemOptions.js.map +1 -0
- package/lib/module/components/Participants/ParticipantsList.js +42 -225
- package/lib/module/components/Participants/ParticipantsList.js.map +1 -1
- package/lib/module/components/Participants/ParticipantsSeachInput.js +37 -30
- package/lib/module/components/Participants/ParticipantsSeachInput.js.map +1 -1
- package/lib/module/components/Participants/index.js +0 -3
- package/lib/module/components/Participants/index.js.map +1 -1
- package/lib/module/components/PeerMinimizedView.js +1 -1
- package/lib/module/components/PeerSettingsModalContent.js +50 -126
- package/lib/module/components/PeerSettingsModalContent.js.map +1 -1
- package/lib/module/components/PeerVideoTile/AvatarView.js +19 -5
- package/lib/module/components/PeerVideoTile/AvatarView.js.map +1 -1
- package/lib/module/components/PeerVideoTile/HMSFullScreenButton.js +36 -0
- package/lib/module/components/PeerVideoTile/HMSFullScreenButton.js.map +1 -0
- package/lib/module/components/PeerVideoTile/HMSPinchGesture.js +193 -0
- package/lib/module/components/PeerVideoTile/HMSPinchGesture.js.map +1 -0
- package/lib/module/components/PeerVideoTile/PeerAudioIndicator.js +60 -0
- package/lib/module/components/PeerVideoTile/PeerAudioIndicator.js.map +1 -0
- package/lib/module/components/PeerVideoTile/PeerNameAndNetwork.js +11 -3
- package/lib/module/components/PeerVideoTile/PeerNameAndNetwork.js.map +1 -1
- package/lib/module/components/PeerVideoTile/PeerVideoTileView.js +41 -20
- package/lib/module/components/PeerVideoTile/PeerVideoTileView.js.map +1 -1
- package/lib/module/components/PeerVideoTile/VideoView.js +43 -10
- package/lib/module/components/PeerVideoTile/VideoView.js.map +1 -1
- package/lib/module/components/PressableIcon.js +11 -6
- package/lib/module/components/PressableIcon.js.map +1 -1
- package/lib/module/components/Preview.js +6 -13
- package/lib/module/components/Preview.js.map +1 -1
- package/lib/module/components/PreviewForRoleChangeModal.js +322 -0
- package/lib/module/components/PreviewForRoleChangeModal.js.map +1 -0
- package/lib/module/components/ReconnectionView.js +56 -0
- package/lib/module/components/ReconnectionView.js.map +1 -0
- package/lib/module/components/RoomSettingsModalContent.js +27 -35
- package/lib/module/components/RoomSettingsModalContent.js.map +1 -1
- package/lib/module/components/RoomSettingsModalDebugModeContent.js +31 -70
- package/lib/module/components/RoomSettingsModalDebugModeContent.js.map +1 -1
- package/lib/module/components/StatusBar.js +7 -5
- package/lib/module/components/StatusBar.js.map +1 -1
- package/lib/module/components/StopRecordingModalContent.js.map +1 -1
- package/lib/module/components/StreamingQualityModalContent.js +8 -8
- package/lib/module/components/StreamingQualityModalContent.js.map +1 -1
- package/lib/module/components/TilesContainer.js +31 -9
- package/lib/module/components/TilesContainer.js.map +1 -1
- package/lib/module/components/WebrtcView.js +11 -14
- package/lib/module/components/WebrtcView.js.map +1 -1
- package/lib/module/components/WelcomeInMeeting.js +8 -32
- package/lib/module/components/WelcomeInMeeting.js.map +1 -1
- package/lib/module/components/index.js +0 -3
- package/lib/module/components/index.js.map +1 -1
- package/lib/module/hooks-util-selectors.js +38 -8
- package/lib/module/hooks-util-selectors.js.map +1 -1
- package/lib/module/hooks-util.js +615 -213
- package/lib/module/hooks-util.js.map +1 -1
- package/lib/module/modules/HMSManager.js +3 -3
- package/lib/module/modules/HMSManager.js.map +1 -1
- package/lib/module/modules/parser.js +2 -3
- package/lib/module/modules/parser.js.map +1 -1
- package/lib/module/redux/actionTypes.js +25 -1
- package/lib/module/redux/actionTypes.js.map +1 -1
- package/lib/module/redux/actions/index.js +74 -0
- package/lib/module/redux/actions/index.js.map +1 -1
- package/lib/module/redux/reducers/appState.js +78 -2
- package/lib/module/redux/reducers/appState.js.map +1 -1
- package/lib/module/redux/reducers/chatWindow.js +3 -7
- package/lib/module/redux/reducers/chatWindow.js.map +1 -1
- package/lib/module/redux/reducers/hmsStates.js +70 -7
- package/lib/module/redux/reducers/hmsStates.js.map +1 -1
- package/lib/module/utils/functions.js +9 -3
- package/lib/module/utils/functions.js.map +1 -1
- package/lib/module/utils/theme.js +2 -0
- package/lib/module/utils/theme.js.map +1 -1
- package/lib/module/utils/types.js +6 -2
- package/lib/module/utils/types.js.map +1 -1
- package/lib/module/utils.js +6 -0
- package/lib/module/utils.js.map +1 -1
- package/lib/typescript/HMSPrebuilt.d.ts +1 -0
- package/lib/typescript/HMSPrebuilt.d.ts.map +1 -1
- package/lib/typescript/HMSRoomSetup.d.ts.map +1 -1
- package/lib/typescript/Icons/AlertTriangle/index.d.ts +1 -0
- package/lib/typescript/Icons/AlertTriangle/index.d.ts.map +1 -1
- package/lib/typescript/Icons/Eye/index.d.ts +8 -0
- package/lib/typescript/Icons/Eye/index.d.ts.map +1 -0
- package/lib/typescript/Icons/Person/index.d.ts +1 -0
- package/lib/typescript/Icons/Person/index.d.ts.map +1 -1
- package/lib/typescript/Icons/Radio/index.d.ts +7 -3
- package/lib/typescript/Icons/Radio/index.d.ts.map +1 -1
- package/lib/typescript/Icons/Search/index.d.ts +7 -0
- package/lib/typescript/Icons/Search/index.d.ts.map +1 -0
- package/lib/typescript/Icons/Stop/index.d.ts.map +1 -1
- package/lib/typescript/Icons/index.d.ts +2 -0
- package/lib/typescript/Icons/index.d.ts.map +1 -1
- package/lib/typescript/components/AnimatedFooter.d.ts +8 -0
- package/lib/typescript/components/AnimatedFooter.d.ts.map +1 -0
- package/lib/typescript/components/AnimatedHLSFooter.d.ts +11 -0
- package/lib/typescript/components/AnimatedHLSFooter.d.ts.map +1 -0
- package/lib/typescript/components/AnimatedHeader.d.ts +7 -0
- package/lib/typescript/components/AnimatedHeader.d.ts.map +1 -0
- package/lib/typescript/components/BottomSheet.d.ts +4 -1
- package/lib/typescript/components/BottomSheet.d.ts.map +1 -1
- package/lib/typescript/components/ChangeNameModalContent.d.ts.map +1 -1
- package/lib/typescript/components/Chat/ChatBanner.d.ts +1 -1
- package/lib/typescript/components/Chat/ChatBanner.d.ts.map +1 -1
- package/lib/typescript/components/Chat/ChatFilterBottomSheetOpener.d.ts +6 -0
- package/lib/typescript/components/Chat/ChatFilterBottomSheetOpener.d.ts.map +1 -0
- package/lib/typescript/components/Chat/ChatFilterBottomSheetView.d.ts +6 -0
- package/lib/typescript/components/Chat/ChatFilterBottomSheetView.d.ts.map +1 -0
- package/lib/typescript/components/Chat/ChatFilterItem.d.ts +12 -0
- package/lib/typescript/components/Chat/ChatFilterItem.d.ts.map +1 -0
- package/lib/typescript/components/Chat/ChatFilterView.d.ts +6 -0
- package/lib/typescript/components/Chat/ChatFilterView.d.ts.map +1 -0
- package/lib/typescript/components/Chat/ChatList.d.ts.map +1 -1
- package/lib/typescript/components/Chat/ChatMessage.d.ts +2 -2
- package/lib/typescript/components/Chat/ChatMessage.d.ts.map +1 -1
- package/lib/typescript/components/Chat/PinnedMessage.d.ts.map +1 -1
- package/lib/typescript/components/ChatAndParticipants/ChatAndParticipantsBottomSheet.d.ts +3 -0
- package/lib/typescript/components/ChatAndParticipants/ChatAndParticipantsBottomSheet.d.ts.map +1 -0
- package/lib/typescript/components/ChatAndParticipants/ChatAndParticipantsHeader.d.ts +7 -0
- package/lib/typescript/components/ChatAndParticipants/ChatAndParticipantsHeader.d.ts.map +1 -0
- package/lib/typescript/components/ChatAndParticipants/ChatAndParticipantsView.d.ts +3 -0
- package/lib/typescript/components/ChatAndParticipants/ChatAndParticipantsView.d.ts.map +1 -0
- package/lib/typescript/components/ChatAndParticipants/ChatView.d.ts +6 -0
- package/lib/typescript/components/ChatAndParticipants/ChatView.d.ts.map +1 -0
- package/lib/typescript/components/ChatAndParticipants/ParticipantsView.d.ts +5 -0
- package/lib/typescript/components/ChatAndParticipants/ParticipantsView.d.ts.map +1 -0
- package/lib/typescript/components/ChatAndParticipants/index.d.ts +2 -0
- package/lib/typescript/components/ChatAndParticipants/index.d.ts.map +1 -0
- package/lib/typescript/components/CompanyLogo.d.ts.map +1 -1
- package/lib/typescript/components/DefaultModal.d.ts.map +1 -1
- package/lib/typescript/components/DisplayView.d.ts.map +1 -1
- package/lib/typescript/components/EndRoomModalContent.d.ts.map +1 -1
- package/lib/typescript/components/Footer.d.ts +0 -2
- package/lib/typescript/components/Footer.d.ts.map +1 -1
- package/lib/typescript/components/FullScreenVideoView.d.ts +3 -0
- package/lib/typescript/components/FullScreenVideoView.d.ts.map +1 -0
- package/lib/typescript/components/GridView.d.ts +12 -1
- package/lib/typescript/components/GridView.d.ts.map +1 -1
- package/lib/typescript/components/HLSFooter.d.ts +8 -0
- package/lib/typescript/components/HLSFooter.d.ts.map +1 -0
- package/lib/typescript/components/HLSView.d.ts.map +1 -1
- package/lib/typescript/components/HMSBaseButton.d.ts +2 -2
- package/lib/typescript/components/HMSBaseButton.d.ts.map +1 -1
- package/lib/typescript/components/HMSChat.d.ts.map +1 -1
- package/lib/typescript/components/HMSHLSMessage.d.ts +8 -0
- package/lib/typescript/components/HMSHLSMessage.d.ts.map +1 -0
- package/lib/typescript/components/HMSHLSMessageList.d.ts +3 -0
- package/lib/typescript/components/HMSHLSMessageList.d.ts.map +1 -0
- package/lib/typescript/components/HMSHLSNotStarted.d.ts.map +1 -1
- package/lib/typescript/components/HMSHandRaiseNotification.d.ts +10 -0
- package/lib/typescript/components/HMSHandRaiseNotification.d.ts.map +1 -0
- package/lib/typescript/components/HMSKeyboardAvoidingView.d.ts +8 -0
- package/lib/typescript/components/HMSKeyboardAvoidingView.d.ts.map +1 -0
- package/lib/typescript/components/HMSLiveIndicator.d.ts +3 -0
- package/lib/typescript/components/HMSLiveIndicator.d.ts.map +1 -0
- package/lib/typescript/components/HMSLocalScreenshareNotification.d.ts +5 -0
- package/lib/typescript/components/HMSLocalScreenshareNotification.d.ts.map +1 -0
- package/lib/typescript/components/HMSLocalVideoView.d.ts.map +1 -1
- package/lib/typescript/components/HMSManageAudioOutput.d.ts.map +1 -1
- package/lib/typescript/components/HMSManageLeave.d.ts.map +1 -1
- package/lib/typescript/components/HMSManageRaiseHand.d.ts.map +1 -1
- package/lib/typescript/components/HMSNotification.d.ts +15 -0
- package/lib/typescript/components/HMSNotification.d.ts.map +1 -0
- package/lib/typescript/components/HMSNotifications.d.ts +5 -0
- package/lib/typescript/components/HMSNotifications.d.ts.map +1 -0
- package/lib/typescript/components/HMSOverlayChatView.d.ts +3 -0
- package/lib/typescript/components/HMSOverlayChatView.d.ts.map +1 -0
- package/lib/typescript/components/HMSPreviewJoinButton.d.ts.map +1 -1
- package/lib/typescript/components/HMSPreviewNetworkQuality.d.ts.map +1 -1
- package/lib/typescript/components/HMSPreviewSubtitle.d.ts.map +1 -1
- package/lib/typescript/components/HMSPreviewTitle.d.ts.map +1 -1
- package/lib/typescript/components/HMSRecordingIndicator.d.ts.map +1 -1
- package/lib/typescript/components/HMSRoleChangeDeclinedNotification.d.ts +9 -0
- package/lib/typescript/components/HMSRoleChangeDeclinedNotification.d.ts.map +1 -0
- package/lib/typescript/components/HMSSendMessageInput.d.ts +9 -0
- package/lib/typescript/components/HMSSendMessageInput.d.ts.map +1 -0
- package/lib/typescript/components/HMSTextInput.d.ts +20 -6
- package/lib/typescript/components/HMSTextInput.d.ts.map +1 -1
- package/lib/typescript/components/HMSVideoView.d.ts +6 -0
- package/lib/typescript/components/HMSVideoView.d.ts.map +1 -0
- package/lib/typescript/components/Header.d.ts +3 -2
- package/lib/typescript/components/Header.d.ts.map +1 -1
- package/lib/typescript/components/LocalPeerScreenshareView.d.ts.map +1 -1
- package/lib/typescript/components/Meeting.d.ts.map +1 -1
- package/lib/typescript/components/MeetingScreenContent.d.ts.map +1 -1
- package/lib/typescript/components/MiniView.d.ts.map +1 -1
- package/lib/typescript/components/Modals.d.ts +1 -21
- package/lib/typescript/components/Modals.d.ts.map +1 -1
- package/lib/typescript/components/OverlayContainer.d.ts +9 -0
- package/lib/typescript/components/OverlayContainer.d.ts.map +1 -0
- package/lib/typescript/components/OverlayedViews.d.ts +4 -0
- package/lib/typescript/components/OverlayedViews.d.ts.map +1 -0
- package/lib/typescript/components/PaginationDots.d.ts +3 -0
- package/lib/typescript/components/PaginationDots.d.ts.map +1 -1
- package/lib/typescript/components/Participants/ParticipantsGroupHeader.d.ts +9 -0
- package/lib/typescript/components/Participants/ParticipantsGroupHeader.d.ts.map +1 -0
- package/lib/typescript/components/Participants/ParticipantsGroupOptions.d.ts +8 -0
- package/lib/typescript/components/Participants/ParticipantsGroupOptions.d.ts.map +1 -0
- package/lib/typescript/components/Participants/ParticipantsItem.d.ts +9 -0
- package/lib/typescript/components/Participants/ParticipantsItem.d.ts.map +1 -0
- package/lib/typescript/components/Participants/ParticipantsItemOption.d.ts +12 -0
- package/lib/typescript/components/Participants/ParticipantsItemOption.d.ts.map +1 -0
- package/lib/typescript/components/Participants/ParticipantsItemOptions.d.ts +10 -0
- package/lib/typescript/components/Participants/ParticipantsItemOptions.d.ts.map +1 -0
- package/lib/typescript/components/Participants/ParticipantsList.d.ts +4 -2
- package/lib/typescript/components/Participants/ParticipantsList.d.ts.map +1 -1
- package/lib/typescript/components/Participants/ParticipantsSeachInput.d.ts.map +1 -1
- package/lib/typescript/components/Participants/index.d.ts +0 -3
- package/lib/typescript/components/Participants/index.d.ts.map +1 -1
- package/lib/typescript/components/PeerSettingsModalContent.d.ts.map +1 -1
- package/lib/typescript/components/PeerVideoTile/AvatarView.d.ts +4 -0
- package/lib/typescript/components/PeerVideoTile/AvatarView.d.ts.map +1 -1
- package/lib/typescript/components/PeerVideoTile/HMSFullScreenButton.d.ts +7 -0
- package/lib/typescript/components/PeerVideoTile/HMSFullScreenButton.d.ts.map +1 -0
- package/lib/typescript/components/PeerVideoTile/HMSPinchGesture.d.ts +7 -0
- package/lib/typescript/components/PeerVideoTile/HMSPinchGesture.d.ts.map +1 -0
- package/lib/typescript/components/PeerVideoTile/PeerAudioIndicator.d.ts +8 -0
- package/lib/typescript/components/PeerVideoTile/PeerAudioIndicator.d.ts.map +1 -0
- package/lib/typescript/components/PeerVideoTile/PeerNameAndNetwork.d.ts.map +1 -1
- package/lib/typescript/components/PeerVideoTile/PeerVideoTileView.d.ts +2 -1
- package/lib/typescript/components/PeerVideoTile/PeerVideoTileView.d.ts.map +1 -1
- package/lib/typescript/components/PeerVideoTile/VideoView.d.ts +1 -0
- package/lib/typescript/components/PeerVideoTile/VideoView.d.ts.map +1 -1
- package/lib/typescript/components/PressableIcon.d.ts.map +1 -1
- package/lib/typescript/components/Preview.d.ts.map +1 -1
- package/lib/typescript/components/PreviewForRoleChangeModal.d.ts +3 -0
- package/lib/typescript/components/PreviewForRoleChangeModal.d.ts.map +1 -0
- package/lib/typescript/components/ReconnectionView.d.ts +4 -0
- package/lib/typescript/components/ReconnectionView.d.ts.map +1 -0
- package/lib/typescript/components/RoomSettingsModalContent.d.ts.map +1 -1
- package/lib/typescript/components/RoomSettingsModalDebugModeContent.d.ts.map +1 -1
- package/lib/typescript/components/StatusBar.d.ts +2 -1
- package/lib/typescript/components/StatusBar.d.ts.map +1 -1
- package/lib/typescript/components/StopRecordingModalContent.d.ts.map +1 -1
- package/lib/typescript/components/StreamingQualityModalContent.d.ts.map +1 -1
- package/lib/typescript/components/TilesContainer.d.ts.map +1 -1
- package/lib/typescript/components/WebrtcView.d.ts.map +1 -1
- package/lib/typescript/components/WelcomeInMeeting.d.ts.map +1 -1
- package/lib/typescript/components/index.d.ts +0 -3
- package/lib/typescript/components/index.d.ts.map +1 -1
- package/lib/typescript/hooks-util-selectors.d.ts +7 -2
- package/lib/typescript/hooks-util-selectors.d.ts.map +1 -1
- package/lib/typescript/hooks-util.d.ts +53 -23
- package/lib/typescript/hooks-util.d.ts.map +1 -1
- package/lib/typescript/modules/HMSManager.d.ts +1 -1
- package/lib/typescript/modules/HMSManager.d.ts.map +1 -1
- package/lib/typescript/modules/parser.d.ts +1 -1
- package/lib/typescript/modules/parser.d.ts.map +1 -1
- package/lib/typescript/redux/actionTypes.d.ts +16 -1
- package/lib/typescript/redux/actionTypes.d.ts.map +1 -1
- package/lib/typescript/redux/actions/index.d.ts +92 -4
- package/lib/typescript/redux/actions/index.d.ts.map +1 -1
- package/lib/typescript/redux/index.d.ts +22 -2
- package/lib/typescript/redux/index.d.ts.map +1 -1
- package/lib/typescript/redux/reducers/appState.d.ts +10 -0
- package/lib/typescript/redux/reducers/appState.d.ts.map +1 -1
- package/lib/typescript/redux/reducers/chatWindow.d.ts +6 -6
- package/lib/typescript/redux/reducers/chatWindow.d.ts.map +1 -1
- package/lib/typescript/redux/reducers/hmsStates.d.ts +32 -4
- package/lib/typescript/redux/reducers/hmsStates.d.ts.map +1 -1
- package/lib/typescript/redux/reducers/index.d.ts +22 -2
- package/lib/typescript/redux/reducers/index.d.ts.map +1 -1
- package/lib/typescript/redux/reducers/userState.d.ts +1 -0
- package/lib/typescript/redux/reducers/userState.d.ts.map +1 -1
- package/lib/typescript/utils/functions.d.ts +3 -1
- package/lib/typescript/utils/functions.d.ts.map +1 -1
- package/lib/typescript/utils/theme.d.ts +1 -1
- package/lib/typescript/utils/theme.d.ts.map +1 -1
- package/lib/typescript/utils/types.d.ts +6 -2
- package/lib/typescript/utils/types.d.ts.map +1 -1
- package/lib/typescript/utils.d.ts +5 -0
- package/lib/typescript/utils.d.ts.map +1 -1
- package/package.json +13 -8
- package/src/HMSPrebuilt.tsx +10 -10
- package/src/HMSRoomSetup.tsx +50 -28
- package/src/Icons/AlertTriangle/assets/alert-triangle-filled.png +0 -0
- package/src/Icons/AlertTriangle/assets/alert-triangle-filled@2x.png +0 -0
- package/src/Icons/AlertTriangle/assets/alert-triangle-filled@3x.png +0 -0
- package/src/Icons/AlertTriangle/index.tsx +9 -2
- package/src/Icons/Eye/assets/eye-on-small.png +0 -0
- package/src/Icons/Eye/assets/eye-on-small@2x.png +0 -0
- package/src/Icons/Eye/assets/eye-on-small@3x.png +0 -0
- package/src/Icons/Eye/index.tsx +36 -0
- package/src/Icons/Hamburger/assets/hamburger.png +0 -0
- package/src/Icons/Hamburger/assets/hamburger@2x.png +0 -0
- package/src/Icons/Hamburger/assets/hamburger@3x.png +0 -0
- package/src/Icons/Person/assets/person-left.png +0 -0
- package/src/Icons/Person/assets/person-left@2x.png +0 -0
- package/src/Icons/Person/assets/person-left@3x.png +0 -0
- package/src/Icons/Person/assets/person-off.png +0 -0
- package/src/Icons/Person/assets/person-off@2x.png +0 -0
- package/src/Icons/Person/assets/person-off@3x.png +0 -0
- package/src/Icons/Person/assets/person-rectangle.png +0 -0
- package/src/Icons/Person/assets/person-rectangle@2x.png +0 -0
- package/src/Icons/Person/assets/person-rectangle@3x.png +0 -0
- package/src/Icons/Person/index.tsx +13 -2
- package/src/Icons/Radio/assets/radio-xlarge.png +0 -0
- package/src/Icons/Radio/assets/radio-xlarge@2x.png +0 -0
- package/src/Icons/Radio/assets/radio-xlarge@3x.png +0 -0
- package/src/Icons/Radio/index.tsx +53 -4
- package/src/Icons/Search/assets/search.png +0 -0
- package/src/Icons/Search/assets/search@2x.png +0 -0
- package/src/Icons/Search/assets/search@3x.png +0 -0
- package/src/Icons/Search/index.tsx +33 -0
- package/src/Icons/Stop/assets/stop.png +0 -0
- package/src/Icons/Stop/assets/stop@2x.png +0 -0
- package/src/Icons/Stop/assets/stop@3x.png +0 -0
- package/src/Icons/Stop/index.tsx +1 -4
- package/src/Icons/index.ts +2 -0
- package/src/assets/audio-level-white.json +1271 -0
- package/src/assets/empty-chat-illustration/empty-chat.png +0 -0
- package/src/assets/empty-chat-illustration/empty-chat@2x.png +0 -0
- package/src/assets/empty-chat-illustration/empty-chat@3x.png +0 -0
- package/src/assets/welcome.png +0 -0
- package/src/components/AnimatedFooter.tsx +37 -0
- package/src/components/AnimatedHLSFooter.tsx +43 -0
- package/src/components/AnimatedHeader.tsx +53 -0
- package/src/components/BottomSheet.tsx +8 -4
- package/src/components/ChangeNameModalContent.tsx +2 -11
- package/src/components/Chat/ChatBanner.tsx +37 -52
- package/src/components/Chat/ChatFilterBottomSheetOpener.tsx +88 -0
- package/src/components/Chat/ChatFilterBottomSheetView.tsx +81 -0
- package/src/components/Chat/ChatFilterItem.tsx +71 -0
- package/src/components/Chat/ChatFilterView.tsx +250 -0
- package/src/components/Chat/ChatList.tsx +16 -12
- package/src/components/Chat/ChatMessage.tsx +48 -197
- package/src/components/Chat/PinnedMessage.tsx +45 -45
- package/src/components/ChatAndParticipants/ChatAndParticipantsBottomSheet.tsx +38 -0
- package/src/components/ChatAndParticipants/ChatAndParticipantsHeader.tsx +140 -0
- package/src/components/ChatAndParticipants/ChatAndParticipantsView.tsx +84 -0
- package/src/components/ChatAndParticipants/ChatView.tsx +42 -0
- package/src/components/ChatAndParticipants/ParticipantsView.tsx +41 -0
- package/src/components/ChatAndParticipants/index.ts +1 -0
- package/src/components/CompanyLogo.tsx +4 -3
- package/src/components/DefaultModal.tsx +4 -6
- package/src/components/DisplayView.tsx +11 -28
- package/src/components/EndRoomModalContent.tsx +32 -7
- package/src/components/Footer.tsx +76 -36
- package/src/components/FullScreenVideoView.tsx +77 -0
- package/src/components/GridView.tsx +186 -65
- package/src/components/HLSFooter.tsx +32 -0
- package/src/components/HLSView.tsx +6 -33
- package/src/components/HMSBaseButton.tsx +2 -2
- package/src/components/HMSChat.tsx +12 -25
- package/src/components/HMSHLSMessage.tsx +72 -0
- package/src/components/HMSHLSMessageList.tsx +60 -0
- package/src/components/HMSHLSNotStarted.tsx +27 -32
- package/src/components/HMSHandRaiseNotification.tsx +101 -0
- package/src/components/HMSKeyboardAvoidingView.tsx +58 -0
- package/src/components/HMSLiveIndicator.tsx +124 -0
- package/src/components/HMSLocalScreenshareNotification.tsx +41 -0
- package/src/components/HMSLocalVideoView.tsx +4 -31
- package/src/components/HMSManageAudioOutput.tsx +14 -2
- package/src/components/HMSManageLeave.tsx +56 -35
- package/src/components/HMSManageRaiseHand.tsx +2 -16
- package/src/components/HMSNotification.tsx +126 -0
- package/src/components/HMSNotifications.tsx +154 -0
- package/src/components/HMSOverlayChatView.tsx +36 -0
- package/src/components/HMSPreviewJoinButton.tsx +6 -3
- package/src/components/HMSPreviewNetworkQuality.tsx +3 -1
- package/src/components/HMSPreviewSubtitle.tsx +2 -6
- package/src/components/HMSPreviewTitle.tsx +2 -6
- package/src/components/HMSRecordingIndicator.tsx +18 -5
- package/src/components/HMSRoleChangeDeclinedNotification.tsx +25 -0
- package/src/components/HMSSendMessageInput.tsx +59 -0
- package/src/components/HMSTextInput.tsx +157 -23
- package/src/components/HMSVideoView.tsx +43 -0
- package/src/components/Header.tsx +28 -136
- package/src/components/LocalPeerScreenshareView.tsx +0 -6
- package/src/components/Meeting.tsx +15 -8
- package/src/components/MeetingScreenContent.tsx +29 -12
- package/src/components/MiniView.tsx +10 -4
- package/src/components/Modals.tsx +112 -370
- package/src/components/OverlayContainer.tsx +31 -0
- package/src/components/OverlayedViews.tsx +22 -0
- package/src/components/PaginationDots.tsx +9 -8
- package/src/components/Participants/ParticipantsGroupHeader.tsx +145 -0
- package/src/components/Participants/ParticipantsGroupOptions.tsx +87 -0
- package/src/components/Participants/ParticipantsItem.tsx +170 -0
- package/src/components/Participants/ParticipantsItemOption.tsx +52 -0
- package/src/components/Participants/ParticipantsItemOptions.tsx +262 -0
- package/src/components/Participants/ParticipantsList.tsx +68 -278
- package/src/components/Participants/ParticipantsSeachInput.tsx +37 -35
- package/src/components/Participants/index.ts +0 -3
- package/src/components/PeerMinimizedView.tsx +1 -1
- package/src/components/PeerSettingsModalContent.tsx +44 -191
- package/src/components/PeerVideoTile/AvatarView.tsx +43 -5
- package/src/components/PeerVideoTile/HMSFullScreenButton.tsx +56 -0
- package/src/components/PeerVideoTile/HMSPinchGesture.tsx +176 -0
- package/src/components/PeerVideoTile/PeerAudioIndicator.tsx +78 -0
- package/src/components/PeerVideoTile/PeerNameAndNetwork.tsx +15 -2
- package/src/components/PeerVideoTile/PeerVideoTileView.tsx +172 -115
- package/src/components/PeerVideoTile/VideoView.tsx +59 -9
- package/src/components/PressableIcon.tsx +26 -13
- package/src/components/Preview.tsx +17 -24
- package/src/components/PreviewForRoleChangeModal.tsx +448 -0
- package/src/components/ReconnectionView.tsx +73 -0
- package/src/components/RoomSettingsModalContent.tsx +32 -29
- package/src/components/RoomSettingsModalDebugModeContent.tsx +11 -65
- package/src/components/StatusBar.tsx +6 -4
- package/src/components/StopRecordingModalContent.tsx +3 -1
- package/src/components/StreamingQualityModalContent.tsx +8 -8
- package/src/components/TilesContainer.tsx +54 -24
- package/src/components/WebrtcView.tsx +29 -19
- package/src/components/WelcomeInMeeting.tsx +5 -34
- package/src/components/index.ts +0 -3
- package/src/hooks-util-selectors.tsx +69 -6
- package/src/hooks-util.ts +856 -273
- package/src/modules/HMSManager.ts +3 -3
- package/src/modules/parser.ts +3 -4
- package/src/redux/actionTypes.ts +33 -0
- package/src/redux/actions/index.ts +99 -2
- package/src/redux/reducers/appState.ts +87 -2
- package/src/redux/reducers/chatWindow.ts +12 -5
- package/src/redux/reducers/hmsStates.ts +136 -4
- package/src/redux/reducers/userState.ts +1 -1
- package/src/utils/functions.ts +10 -1
- package/src/utils/theme.ts +3 -1
- package/src/utils/types.ts +6 -2
- package/src/utils.ts +6 -0
- package/lib/commonjs/assets/100ms-logo.png +0 -0
- package/lib/commonjs/assets/brb.png +0 -0
- package/lib/commonjs/assets/icon.png +0 -0
- package/lib/commonjs/assets/illustration.png +0 -0
- package/lib/commonjs/assets/network_0.png +0 -0
- package/lib/commonjs/assets/network_1.png +0 -0
- package/lib/commonjs/assets/network_2.png +0 -0
- package/lib/commonjs/assets/network_3.png +0 -0
- package/lib/commonjs/assets/network_4.png +0 -0
- package/lib/commonjs/assets/user_music.png +0 -0
- package/lib/commonjs/components/ChatWindow.js +0 -608
- package/lib/commonjs/components/ChatWindow.js.map +0 -1
- package/lib/commonjs/components/CustomInput.js +0 -89
- package/lib/commonjs/components/CustomInput.js.map +0 -1
- package/lib/commonjs/components/DisplayTrack.js +0 -70
- package/lib/commonjs/components/DisplayTrack.js.map +0 -1
- package/lib/commonjs/components/HMSShareScreen.js +0 -59
- package/lib/commonjs/components/HMSShareScreen.js.map +0 -1
- package/lib/commonjs/components/HMSShowNetworkQuality.js +0 -56
- package/lib/commonjs/components/HMSShowNetworkQuality.js.map +0 -1
- package/lib/commonjs/components/LiveButton.js +0 -70
- package/lib/commonjs/components/LiveButton.js.map +0 -1
- package/lib/commonjs/components/Participants/ParticipantsFilter.js +0 -128
- package/lib/commonjs/components/Participants/ParticipantsFilter.js.map +0 -1
- package/lib/commonjs/components/Participants/ParticipantsHeader.js +0 -67
- package/lib/commonjs/components/Participants/ParticipantsHeader.js.map +0 -1
- package/lib/commonjs/components/Participants/SearchableParticipantsView.js.map +0 -1
- package/lib/commonjs/components/ParticipantsModal.js.map +0 -1
- package/lib/commonjs/components/PeerVideoTile/PeerAudioMutedIndicator.js.map +0 -1
- package/lib/commonjs/components/Picker.js +0 -93
- package/lib/commonjs/components/Picker.js.map +0 -1
- package/lib/module/assets/100ms-logo.png +0 -0
- package/lib/module/assets/brb.png +0 -0
- package/lib/module/assets/icon.png +0 -0
- package/lib/module/assets/illustration.png +0 -0
- package/lib/module/assets/network_0.png +0 -0
- package/lib/module/assets/network_1.png +0 -0
- package/lib/module/assets/network_2.png +0 -0
- package/lib/module/assets/network_3.png +0 -0
- package/lib/module/assets/network_4.png +0 -0
- package/lib/module/assets/user_music.png +0 -0
- package/lib/module/components/ChatWindow.js +0 -595
- package/lib/module/components/ChatWindow.js.map +0 -1
- package/lib/module/components/CustomInput.js +0 -82
- package/lib/module/components/CustomInput.js.map +0 -1
- package/lib/module/components/DisplayTrack.js +0 -63
- package/lib/module/components/DisplayTrack.js.map +0 -1
- package/lib/module/components/HMSShareScreen.js +0 -50
- package/lib/module/components/HMSShareScreen.js.map +0 -1
- package/lib/module/components/HMSShowNetworkQuality.js +0 -47
- package/lib/module/components/HMSShowNetworkQuality.js.map +0 -1
- package/lib/module/components/LiveButton.js +0 -61
- package/lib/module/components/LiveButton.js.map +0 -1
- package/lib/module/components/Participants/ParticipantsFilter.js +0 -121
- package/lib/module/components/Participants/ParticipantsFilter.js.map +0 -1
- package/lib/module/components/Participants/ParticipantsHeader.js +0 -58
- package/lib/module/components/Participants/ParticipantsHeader.js.map +0 -1
- package/lib/module/components/Participants/SearchableParticipantsView.js +0 -18
- package/lib/module/components/Participants/SearchableParticipantsView.js.map +0 -1
- package/lib/module/components/ParticipantsModal.js +0 -34
- package/lib/module/components/ParticipantsModal.js.map +0 -1
- package/lib/module/components/PeerVideoTile/PeerAudioMutedIndicator.js +0 -35
- package/lib/module/components/PeerVideoTile/PeerAudioMutedIndicator.js.map +0 -1
- package/lib/module/components/Picker.js +0 -83
- package/lib/module/components/Picker.js.map +0 -1
- package/lib/typescript/components/ChatWindow.d.ts +0 -22
- package/lib/typescript/components/ChatWindow.d.ts.map +0 -1
- package/lib/typescript/components/CustomInput.d.ts +0 -24
- package/lib/typescript/components/CustomInput.d.ts.map +0 -1
- package/lib/typescript/components/DisplayTrack.d.ts +0 -9
- package/lib/typescript/components/DisplayTrack.d.ts.map +0 -1
- package/lib/typescript/components/HMSShareScreen.d.ts +0 -9
- package/lib/typescript/components/HMSShareScreen.d.ts.map +0 -1
- package/lib/typescript/components/HMSShowNetworkQuality.d.ts +0 -3
- package/lib/typescript/components/HMSShowNetworkQuality.d.ts.map +0 -1
- package/lib/typescript/components/LiveButton.d.ts +0 -17
- package/lib/typescript/components/LiveButton.d.ts.map +0 -1
- package/lib/typescript/components/Participants/ParticipantsFilter.d.ts +0 -6
- package/lib/typescript/components/Participants/ParticipantsFilter.d.ts.map +0 -1
- package/lib/typescript/components/Participants/ParticipantsHeader.d.ts +0 -9
- package/lib/typescript/components/Participants/ParticipantsHeader.d.ts.map +0 -1
- package/lib/typescript/components/Participants/SearchableParticipantsView.d.ts +0 -3
- package/lib/typescript/components/Participants/SearchableParticipantsView.d.ts.map +0 -1
- package/lib/typescript/components/ParticipantsModal.d.ts +0 -5
- package/lib/typescript/components/ParticipantsModal.d.ts.map +0 -1
- package/lib/typescript/components/PeerVideoTile/PeerAudioMutedIndicator.d.ts +0 -6
- package/lib/typescript/components/PeerVideoTile/PeerAudioMutedIndicator.d.ts.map +0 -1
- package/lib/typescript/components/Picker.d.ts +0 -9
- package/lib/typescript/components/Picker.d.ts.map +0 -1
- package/src/assets/100ms-logo.png +0 -0
- package/src/assets/brb.png +0 -0
- package/src/assets/icon.png +0 -0
- package/src/assets/illustration.png +0 -0
- package/src/assets/network_0.png +0 -0
- package/src/assets/network_1.png +0 -0
- package/src/assets/network_2.png +0 -0
- package/src/assets/network_3.png +0 -0
- package/src/assets/network_4.png +0 -0
- package/src/assets/user_music.png +0 -0
- package/src/components/ChatWindow.tsx +0 -706
- package/src/components/CustomInput.tsx +0 -138
- package/src/components/DisplayTrack.tsx +0 -92
- package/src/components/HMSShareScreen.tsx +0 -71
- package/src/components/HMSShowNetworkQuality.tsx +0 -68
- package/src/components/LiveButton.tsx +0 -77
- package/src/components/Participants/ParticipantsFilter.tsx +0 -144
- package/src/components/Participants/ParticipantsHeader.tsx +0 -64
- package/src/components/Participants/SearchableParticipantsView.tsx +0 -21
- package/src/components/ParticipantsModal.tsx +0 -46
- package/src/components/PeerVideoTile/PeerAudioMutedIndicator.tsx +0 -41
- package/src/components/Picker.tsx +0 -108
package/src/hooks-util.ts
CHANGED
|
@@ -3,6 +3,7 @@ import {
|
|
|
3
3
|
HMSConfig,
|
|
4
4
|
HMSLocalPeer,
|
|
5
5
|
HMSMessage,
|
|
6
|
+
HMSMessageRecipientType,
|
|
6
7
|
HMSPIPListenerActions,
|
|
7
8
|
HMSPeer,
|
|
8
9
|
HMSPeerUpdate,
|
|
@@ -16,15 +17,21 @@ import {
|
|
|
16
17
|
HMSTrackType,
|
|
17
18
|
HMSTrackUpdate,
|
|
18
19
|
HMSUpdateListenerActions,
|
|
20
|
+
HMSMessageRecipient,
|
|
19
21
|
// useHMSPeerUpdates,
|
|
20
22
|
} from '@100mslive/react-native-hms';
|
|
23
|
+
import type { Chat as ChatConfig } from '@100mslive/types-prebuilt/elements/chat';
|
|
21
24
|
import type {
|
|
25
|
+
HMSRole,
|
|
22
26
|
HMSSessionStore,
|
|
23
27
|
HMSSessionStoreValue,
|
|
24
28
|
HMSSpeaker,
|
|
25
29
|
} from '@100mslive/react-native-hms';
|
|
26
30
|
import type {
|
|
27
31
|
ColorPalette,
|
|
32
|
+
DefaultConferencingScreen,
|
|
33
|
+
HLSLiveStreamingScreen,
|
|
34
|
+
Layout,
|
|
28
35
|
Theme,
|
|
29
36
|
Typography,
|
|
30
37
|
} from '@100mslive/types-prebuilt';
|
|
@@ -40,7 +47,7 @@ import {
|
|
|
40
47
|
import type { DependencyList } from 'react';
|
|
41
48
|
|
|
42
49
|
import { MaxTilesInOnePage, ModalTypes, PipModes } from './utils/types';
|
|
43
|
-
import type { PeerTrackNode } from './utils/types';
|
|
50
|
+
import type { ChatBroadcastFilter, PeerTrackNode } from './utils/types';
|
|
44
51
|
import { createPeerTrackNode, parseMetadata } from './utils/functions';
|
|
45
52
|
import {
|
|
46
53
|
batch,
|
|
@@ -52,12 +59,22 @@ import {
|
|
|
52
59
|
import type { RootState } from './redux';
|
|
53
60
|
import {
|
|
54
61
|
addMessage,
|
|
62
|
+
addNotification,
|
|
63
|
+
addParticipant,
|
|
55
64
|
addPinnedMessage,
|
|
65
|
+
addScreenshareTile,
|
|
66
|
+
addUpdateParticipant,
|
|
56
67
|
changeMeetingState,
|
|
57
68
|
changePipModeStatus,
|
|
58
69
|
changeStartingHLSStream,
|
|
59
70
|
clearStore,
|
|
71
|
+
removeNotification,
|
|
72
|
+
removeParticipant,
|
|
73
|
+
removeScreenshareTile,
|
|
60
74
|
saveUserData,
|
|
75
|
+
setActiveChatBottomSheetTab,
|
|
76
|
+
setActiveSpeakers,
|
|
77
|
+
setFullScreenPeerTrackNode,
|
|
61
78
|
setHMSLocalPeerState,
|
|
62
79
|
setHMSRoleState,
|
|
63
80
|
setHMSRoomState,
|
|
@@ -67,9 +84,13 @@ import {
|
|
|
67
84
|
setLocalPeerTrackNode,
|
|
68
85
|
setMiniViewPeerTrackNode,
|
|
69
86
|
setModalType,
|
|
87
|
+
setReconnecting,
|
|
88
|
+
setRoleChangeRequest,
|
|
70
89
|
setStartingOrStoppingRecording,
|
|
90
|
+
updateFullScreenPeerTrackNode,
|
|
71
91
|
updateLocalPeerTrackNode,
|
|
72
92
|
updateMiniViewPeerTrackNode,
|
|
93
|
+
updateScreenshareTile,
|
|
73
94
|
} from './redux/actions';
|
|
74
95
|
import {
|
|
75
96
|
createPeerTrackNodeUniqueId,
|
|
@@ -85,6 +106,7 @@ import { MeetingState } from './types';
|
|
|
85
106
|
import {
|
|
86
107
|
AppState,
|
|
87
108
|
InteractionManager,
|
|
109
|
+
Keyboard,
|
|
88
110
|
LayoutAnimation,
|
|
89
111
|
Platform,
|
|
90
112
|
} from 'react-native';
|
|
@@ -95,13 +117,17 @@ import {
|
|
|
95
117
|
useIsPortraitOrientation,
|
|
96
118
|
} from './utils/dimension';
|
|
97
119
|
import {
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
120
|
+
selectChatLayoutConfig,
|
|
121
|
+
selectConferencingScreenConfig,
|
|
122
|
+
selectIsHLSViewer,
|
|
123
|
+
selectLayoutConfigForRole,
|
|
124
|
+
selectShouldGoLive,
|
|
125
|
+
selectVideoTileLayoutConfig,
|
|
126
|
+
} from './hooks-util-selectors';
|
|
102
127
|
import type { GridViewRefAttrs } from './components/GridView';
|
|
103
128
|
import { getRoomLayout } from './modules/HMSManager';
|
|
104
129
|
import { DEFAULT_THEME, DEFAULT_TYPOGRAPHY } from './utils/theme';
|
|
130
|
+
import { NotificationTypes } from './utils';
|
|
105
131
|
|
|
106
132
|
export const useHMSListeners = (
|
|
107
133
|
setPeerTrackNodes: React.Dispatch<React.SetStateAction<PeerTrackNode[]>>
|
|
@@ -129,58 +155,15 @@ const useHMSRoomUpdate = (hmsInstance: HMSSDK) => {
|
|
|
129
155
|
|
|
130
156
|
dispatch(setHMSRoomState(room));
|
|
131
157
|
|
|
132
|
-
/**
|
|
133
|
-
* Handle case when User is joining as HLSViewer,
|
|
134
|
-
* before ON_JOIN, if ON_ROOM comes then we can show Meeting screen to user, instead of Loader or Preview
|
|
135
|
-
*/
|
|
136
|
-
if (room.localPeer.role?.name?.includes('hls-') ?? false) {
|
|
137
|
-
const meetingState = reduxStore.getState().app.meetingState;
|
|
138
|
-
|
|
139
|
-
batch(() => {
|
|
140
|
-
dispatch(setHMSLocalPeerState(room.localPeer));
|
|
141
|
-
if (meetingState !== MeetingState.IN_MEETING) {
|
|
142
|
-
dispatch(changeMeetingState(MeetingState.IN_MEETING));
|
|
143
|
-
}
|
|
144
|
-
});
|
|
145
|
-
}
|
|
146
|
-
|
|
147
158
|
if (type === HMSRoomUpdate.BROWSER_RECORDING_STATE_UPDATED) {
|
|
148
|
-
const startingOrStoppingRecording =
|
|
159
|
+
const startingOrStoppingRecording =
|
|
160
|
+
reduxStore.getState().app.startingOrStoppingRecording;
|
|
149
161
|
|
|
150
162
|
if (startingOrStoppingRecording) {
|
|
151
163
|
dispatch(setStartingOrStoppingRecording(false));
|
|
152
164
|
}
|
|
153
|
-
|
|
154
|
-
let streaming = room?.browserRecordingState?.running;
|
|
155
|
-
const startAtDate = room?.browserRecordingState?.startedAt;
|
|
156
|
-
|
|
157
|
-
let startTime: null | string = null;
|
|
158
|
-
|
|
159
|
-
if (startAtDate) {
|
|
160
|
-
let hours = startAtDate.getHours().toString();
|
|
161
|
-
let minutes = startAtDate.getMinutes()?.toString();
|
|
162
|
-
startTime = hours + ':' + minutes;
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
Toast.showWithGravity(
|
|
166
|
-
`Browser Recording ${
|
|
167
|
-
streaming
|
|
168
|
-
? `Started ${startTime ? 'At ' + startTime : ''}`
|
|
169
|
-
: 'Stopped'
|
|
170
|
-
}`,
|
|
171
|
-
Toast.LONG,
|
|
172
|
-
Toast.TOP
|
|
173
|
-
);
|
|
174
165
|
} else if (type === HMSRoomUpdate.HLS_STREAMING_STATE_UPDATED) {
|
|
175
166
|
dispatch(changeStartingHLSStream(false));
|
|
176
|
-
|
|
177
|
-
let streaming = room?.hlsStreamingState?.running;
|
|
178
|
-
|
|
179
|
-
Toast.showWithGravity(
|
|
180
|
-
`HLS Streaming ${streaming ? 'Started' : 'Stopped'}`,
|
|
181
|
-
Toast.LONG,
|
|
182
|
-
Toast.TOP
|
|
183
|
-
);
|
|
184
167
|
} else if (type === HMSRoomUpdate.RTMP_STREAMING_STATE_UPDATED) {
|
|
185
168
|
let streaming = room?.rtmpHMSRtmpStreamingState?.running;
|
|
186
169
|
const startAtDate = room?.rtmpHMSRtmpStreamingState?.startedAt;
|
|
@@ -267,41 +250,108 @@ const useHMSPeersUpdate = (
|
|
|
267
250
|
|
|
268
251
|
// Handle State for Meeting screen
|
|
269
252
|
if (type === HMSPeerUpdate.PEER_JOINED) {
|
|
253
|
+
dispatch(addParticipant(peer));
|
|
270
254
|
return;
|
|
271
255
|
}
|
|
272
256
|
if (type === HMSPeerUpdate.PEER_LEFT) {
|
|
257
|
+
dispatch(removeParticipant(peer));
|
|
258
|
+
|
|
259
|
+
// Handling regular tiles list
|
|
273
260
|
setPeerTrackNodes((prevPeerTrackNodes) =>
|
|
274
261
|
removePeerTrackNodes(prevPeerTrackNodes, peer)
|
|
275
262
|
);
|
|
263
|
+
|
|
264
|
+
const reduxState = store.getState();
|
|
265
|
+
|
|
266
|
+
// Handling Screenshare tiles list
|
|
267
|
+
const screensharePeerTrackNodes =
|
|
268
|
+
reduxState.app.screensharePeerTrackNodes;
|
|
269
|
+
const nodeToRemove = screensharePeerTrackNodes.find(
|
|
270
|
+
(node) => node.peer.peerID === peer.peerID
|
|
271
|
+
);
|
|
272
|
+
if (nodeToRemove) {
|
|
273
|
+
dispatch(removeScreenshareTile(nodeToRemove.id));
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
// Handling Full screen view
|
|
277
|
+
const fullScreenPeerTrackNode = reduxState.app.fullScreenPeerTrackNode;
|
|
278
|
+
if (
|
|
279
|
+
fullScreenPeerTrackNode !== null &&
|
|
280
|
+
fullScreenPeerTrackNode.peer.peerID === peer.peerID
|
|
281
|
+
) {
|
|
282
|
+
dispatch(setFullScreenPeerTrackNode(null));
|
|
283
|
+
}
|
|
276
284
|
return;
|
|
277
285
|
}
|
|
278
286
|
if (peer.isLocal) {
|
|
279
|
-
setPeerTrackNodes((prevPeerTrackNodes) => {
|
|
280
|
-
if (peerTrackNodeExistForPeer(prevPeerTrackNodes, peer)) {
|
|
281
|
-
return replacePeerTrackNodes(prevPeerTrackNodes, peer);
|
|
282
|
-
}
|
|
283
|
-
return prevPeerTrackNodes;
|
|
284
|
-
});
|
|
285
|
-
|
|
286
287
|
const reduxState = store.getState();
|
|
288
|
+
const fullScreenPeerTrackNode = reduxState.app.fullScreenPeerTrackNode;
|
|
287
289
|
const miniviewPeerTrackNode = reduxState.app.miniviewPeerTrackNode;
|
|
288
290
|
const localPeerTrackNode = reduxState.app.localPeerTrackNode;
|
|
289
291
|
|
|
292
|
+
// Currently Applied Layout config
|
|
293
|
+
const currentLayoutConfig = selectLayoutConfigForRole(
|
|
294
|
+
reduxState.hmsStates.layoutConfig,
|
|
295
|
+
peer.role || null
|
|
296
|
+
);
|
|
297
|
+
|
|
298
|
+
// Local Tile Inset layout is enabled
|
|
299
|
+
const enableLocalTileInset =
|
|
300
|
+
selectVideoTileLayoutConfig(currentLayoutConfig)?.grid
|
|
301
|
+
?.enable_local_tile_inset;
|
|
302
|
+
|
|
303
|
+
// Local Tile Inset layout is disabled
|
|
304
|
+
const localTileInsetDisbaled = !enableLocalTileInset;
|
|
305
|
+
|
|
306
|
+
// Local Tile Inset layout is disabled
|
|
307
|
+
// then update local peer track node available in list of peer track nodes
|
|
308
|
+
if (localTileInsetDisbaled) {
|
|
309
|
+
setPeerTrackNodes((prevPeerTrackNodes) => {
|
|
310
|
+
if (peerTrackNodeExistForPeer(prevPeerTrackNodes, peer)) {
|
|
311
|
+
return replacePeerTrackNodes(prevPeerTrackNodes, peer);
|
|
312
|
+
}
|
|
313
|
+
return prevPeerTrackNodes;
|
|
314
|
+
});
|
|
315
|
+
}
|
|
316
|
+
|
|
290
317
|
batch(() => {
|
|
291
318
|
if (localPeerTrackNode) {
|
|
292
319
|
dispatch(updateLocalPeerTrackNode({ peer }));
|
|
293
|
-
} else {
|
|
320
|
+
} else if (isPublishingAllowed(peer)) {
|
|
294
321
|
dispatch(
|
|
295
322
|
setLocalPeerTrackNode(createPeerTrackNode(peer, peer.videoTrack))
|
|
296
323
|
);
|
|
297
324
|
}
|
|
298
325
|
|
|
299
|
-
// only set `localPeerTrackNode` as miniview peer track node when we are already using it.
|
|
300
326
|
if (
|
|
301
|
-
|
|
302
|
-
|
|
327
|
+
fullScreenPeerTrackNode &&
|
|
328
|
+
fullScreenPeerTrackNode.peer.peerID === peer.peerID
|
|
303
329
|
) {
|
|
304
|
-
dispatch(
|
|
330
|
+
dispatch(updateFullScreenPeerTrackNode({ peer }));
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
// If Local Tile Inset layout is enabled, then update or set it
|
|
334
|
+
if (enableLocalTileInset) {
|
|
335
|
+
if (
|
|
336
|
+
miniviewPeerTrackNode !== null &&
|
|
337
|
+
miniviewPeerTrackNode.peer.peerID === peer.peerID
|
|
338
|
+
) {
|
|
339
|
+
dispatch(updateMiniViewPeerTrackNode({ peer }));
|
|
340
|
+
} else if (
|
|
341
|
+
miniviewPeerTrackNode === null &&
|
|
342
|
+
peer.role?.publishSettings?.allowed &&
|
|
343
|
+
peer.role.publishSettings.allowed.length > 0
|
|
344
|
+
) {
|
|
345
|
+
dispatch(
|
|
346
|
+
setMiniViewPeerTrackNode(
|
|
347
|
+
createPeerTrackNode(peer, peer.videoTrack)
|
|
348
|
+
)
|
|
349
|
+
);
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
// If Local Tile Inset layout is disabled, then remove it if it exists
|
|
353
|
+
else if (miniviewPeerTrackNode) {
|
|
354
|
+
dispatch(setMiniViewPeerTrackNode(null));
|
|
305
355
|
}
|
|
306
356
|
});
|
|
307
357
|
|
|
@@ -311,6 +361,9 @@ const useHMSPeersUpdate = (
|
|
|
311
361
|
return;
|
|
312
362
|
}
|
|
313
363
|
if (type === HMSPeerUpdate.ROLE_CHANGED) {
|
|
364
|
+
dispatch(addUpdateParticipant(peer));
|
|
365
|
+
|
|
366
|
+
// Handling regular tiles list
|
|
314
367
|
if (
|
|
315
368
|
peer.role?.publishSettings?.allowed === undefined ||
|
|
316
369
|
(peer.role?.publishSettings?.allowed &&
|
|
@@ -323,6 +376,40 @@ const useHMSPeersUpdate = (
|
|
|
323
376
|
return prevPeerTrackNodes;
|
|
324
377
|
});
|
|
325
378
|
}
|
|
379
|
+
|
|
380
|
+
const reduxState = store.getState();
|
|
381
|
+
|
|
382
|
+
// Handling screenshare tiles list
|
|
383
|
+
if (
|
|
384
|
+
peer.role?.publishSettings?.allowed === undefined ||
|
|
385
|
+
(peer.role?.publishSettings?.allowed &&
|
|
386
|
+
!peer.role?.publishSettings?.allowed.includes('screen'))
|
|
387
|
+
) {
|
|
388
|
+
const screensharePeerTrackNodes =
|
|
389
|
+
reduxState.app.screensharePeerTrackNodes;
|
|
390
|
+
const nodeToRemove = screensharePeerTrackNodes.find(
|
|
391
|
+
(node) => node.peer.peerID === peer.peerID
|
|
392
|
+
);
|
|
393
|
+
if (nodeToRemove) {
|
|
394
|
+
dispatch(removeScreenshareTile(nodeToRemove.id));
|
|
395
|
+
}
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
// Handling full screen view
|
|
399
|
+
if (
|
|
400
|
+
peer.role?.publishSettings?.allowed === undefined ||
|
|
401
|
+
(peer.role?.publishSettings?.allowed &&
|
|
402
|
+
!peer.role?.publishSettings?.allowed.includes('video'))
|
|
403
|
+
) {
|
|
404
|
+
const fullScreenPeerTrackNode =
|
|
405
|
+
reduxState.app.fullScreenPeerTrackNode;
|
|
406
|
+
if (
|
|
407
|
+
fullScreenPeerTrackNode !== null &&
|
|
408
|
+
fullScreenPeerTrackNode.peer.peerID === peer.peerID
|
|
409
|
+
) {
|
|
410
|
+
dispatch(setFullScreenPeerTrackNode(null));
|
|
411
|
+
}
|
|
412
|
+
}
|
|
326
413
|
return;
|
|
327
414
|
}
|
|
328
415
|
if (
|
|
@@ -330,12 +417,80 @@ const useHMSPeersUpdate = (
|
|
|
330
417
|
type === HMSPeerUpdate.NAME_CHANGED ||
|
|
331
418
|
type === HMSPeerUpdate.NETWORK_QUALITY_UPDATED
|
|
332
419
|
) {
|
|
420
|
+
dispatch(addUpdateParticipant(peer));
|
|
421
|
+
|
|
422
|
+
const reduxState = store.getState();
|
|
423
|
+
|
|
424
|
+
if (type === HMSPeerUpdate.METADATA_CHANGED) {
|
|
425
|
+
const handRaised = parseMetadata(peer.metadata).isHandRaised;
|
|
426
|
+
|
|
427
|
+
if (handRaised) {
|
|
428
|
+
const { layoutConfig, localPeer } = reduxState.hmsStates;
|
|
429
|
+
|
|
430
|
+
const selectedLayoutConfig = selectLayoutConfigForRole(
|
|
431
|
+
layoutConfig,
|
|
432
|
+
localPeer?.role || null
|
|
433
|
+
);
|
|
434
|
+
|
|
435
|
+
// list of roles which should be brought on stage when they raise hand
|
|
436
|
+
const offStageRoles =
|
|
437
|
+
selectedLayoutConfig?.screens?.conferencing?.default?.elements
|
|
438
|
+
?.on_stage_exp?.off_stage_roles;
|
|
439
|
+
|
|
440
|
+
// checking if the current peer role is included in the above list
|
|
441
|
+
const shouldBringOnStage =
|
|
442
|
+
offStageRoles && offStageRoles.includes(peer.role?.name!);
|
|
443
|
+
|
|
444
|
+
const canChangeRole =
|
|
445
|
+
reduxState.hmsStates.localPeer?.role?.permissions?.changeRole;
|
|
446
|
+
|
|
447
|
+
if (shouldBringOnStage && canChangeRole) {
|
|
448
|
+
dispatch(
|
|
449
|
+
addNotification({
|
|
450
|
+
id: `${peer.peerID}-${NotificationTypes.HAND_RAISE}`,
|
|
451
|
+
type: NotificationTypes.HAND_RAISE,
|
|
452
|
+
peer,
|
|
453
|
+
})
|
|
454
|
+
);
|
|
455
|
+
}
|
|
456
|
+
} else {
|
|
457
|
+
const notifications = reduxState.app.notifications;
|
|
458
|
+
const notificationToRemove = notifications.find(
|
|
459
|
+
(notification) =>
|
|
460
|
+
notification.id ===
|
|
461
|
+
`${peer.peerID}-${NotificationTypes.HAND_RAISE}`
|
|
462
|
+
);
|
|
463
|
+
if (notificationToRemove) {
|
|
464
|
+
dispatch(removeNotification(notificationToRemove.id));
|
|
465
|
+
}
|
|
466
|
+
}
|
|
467
|
+
}
|
|
468
|
+
|
|
333
469
|
setPeerTrackNodes((prevPeerTrackNodes) => {
|
|
334
470
|
if (peerTrackNodeExistForPeer(prevPeerTrackNodes, peer)) {
|
|
335
471
|
return replacePeerTrackNodes(prevPeerTrackNodes, peer);
|
|
336
472
|
}
|
|
337
473
|
return prevPeerTrackNodes;
|
|
338
474
|
});
|
|
475
|
+
|
|
476
|
+
// Handling screenshare tile views
|
|
477
|
+
const screensharePeerTrackNodes =
|
|
478
|
+
reduxState.app.screensharePeerTrackNodes;
|
|
479
|
+
const nodeToUpdate = screensharePeerTrackNodes.find(
|
|
480
|
+
(node) => node.peer.peerID === peer.peerID
|
|
481
|
+
);
|
|
482
|
+
if (nodeToUpdate) {
|
|
483
|
+
dispatch(updateScreenshareTile({ id: nodeToUpdate.id, peer }));
|
|
484
|
+
}
|
|
485
|
+
|
|
486
|
+
// Handling fullscreen view
|
|
487
|
+
const fullScreenPeerTrackNode = reduxState.app.fullScreenPeerTrackNode;
|
|
488
|
+
if (
|
|
489
|
+
fullScreenPeerTrackNode !== null &&
|
|
490
|
+
fullScreenPeerTrackNode.peer.peerID === peer.peerID
|
|
491
|
+
) {
|
|
492
|
+
dispatch(updateFullScreenPeerTrackNode({ peer }));
|
|
493
|
+
}
|
|
339
494
|
return;
|
|
340
495
|
}
|
|
341
496
|
};
|
|
@@ -357,6 +512,14 @@ type TrackUpdate = {
|
|
|
357
512
|
type: HMSTrackUpdate;
|
|
358
513
|
};
|
|
359
514
|
|
|
515
|
+
export const isPublishingAllowed = (peer: HMSPeer): boolean => {
|
|
516
|
+
return (
|
|
517
|
+
(peer.role?.publishSettings?.allowed &&
|
|
518
|
+
peer.role?.publishSettings?.allowed?.length > 0) ??
|
|
519
|
+
false
|
|
520
|
+
);
|
|
521
|
+
};
|
|
522
|
+
|
|
360
523
|
const useHMSTrackUpdate = (
|
|
361
524
|
hmsInstance: HMSSDK,
|
|
362
525
|
updateLocalPeer: () => void,
|
|
@@ -368,48 +531,66 @@ const useHMSTrackUpdate = (
|
|
|
368
531
|
useEffect(() => {
|
|
369
532
|
const trackUpdateHandler = ({ peer, track, type }: TrackUpdate) => {
|
|
370
533
|
const reduxState = store.getState();
|
|
534
|
+
const fullScreenPeerTrackNode = reduxState.app.fullScreenPeerTrackNode;
|
|
371
535
|
const miniviewPeerTrackNode = reduxState.app.miniviewPeerTrackNode;
|
|
372
536
|
const localPeerTrackNode = reduxState.app.localPeerTrackNode;
|
|
373
537
|
|
|
538
|
+
const currentLayoutConfig = selectLayoutConfigForRole(
|
|
539
|
+
reduxState.hmsStates.layoutConfig,
|
|
540
|
+
reduxState.hmsStates.localPeer?.role ?? null
|
|
541
|
+
);
|
|
542
|
+
|
|
543
|
+
const localTileInsetEnabled =
|
|
544
|
+
selectVideoTileLayoutConfig(currentLayoutConfig)?.grid
|
|
545
|
+
?.enable_local_tile_inset;
|
|
546
|
+
|
|
374
547
|
if (type === HMSTrackUpdate.TRACK_ADDED) {
|
|
375
548
|
const newPeerTrackNode = createPeerTrackNode(peer, track);
|
|
376
549
|
|
|
377
|
-
|
|
378
|
-
!
|
|
379
|
-
|
|
380
|
-
|
|
550
|
+
if (track.source === HMSTrackSource.SCREEN) {
|
|
551
|
+
if (!peer.isLocal && track.type === HMSTrackType.VIDEO) {
|
|
552
|
+
dispatch(addScreenshareTile(newPeerTrackNode));
|
|
553
|
+
}
|
|
554
|
+
} else {
|
|
555
|
+
setPeerTrackNodes((prevPeerTrackNodes) => {
|
|
556
|
+
if (
|
|
557
|
+
peerTrackNodeExistForPeerAndTrack(prevPeerTrackNodes, peer, track)
|
|
558
|
+
) {
|
|
559
|
+
if (track.type === HMSTrackType.VIDEO) {
|
|
560
|
+
return replacePeerTrackNodesWithTrack(
|
|
561
|
+
prevPeerTrackNodes,
|
|
562
|
+
peer,
|
|
563
|
+
track
|
|
564
|
+
);
|
|
565
|
+
}
|
|
566
|
+
return replacePeerTrackNodes(prevPeerTrackNodes, peer);
|
|
567
|
+
}
|
|
381
568
|
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
peerTrackNodeExistForPeerAndTrack(prevPeerTrackNodes, peer, track)
|
|
385
|
-
) {
|
|
386
|
-
if (track.type === HMSTrackType.VIDEO) {
|
|
387
|
-
return replacePeerTrackNodesWithTrack(
|
|
388
|
-
prevPeerTrackNodes,
|
|
389
|
-
peer,
|
|
390
|
-
track
|
|
391
|
-
);
|
|
569
|
+
if (peer.isLocal && !localTileInsetEnabled) {
|
|
570
|
+
return [newPeerTrackNode, ...prevPeerTrackNodes];
|
|
392
571
|
}
|
|
393
|
-
return replacePeerTrackNodes(prevPeerTrackNodes, peer);
|
|
394
|
-
}
|
|
395
572
|
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
573
|
+
if (
|
|
574
|
+
!peer.isLocal &&
|
|
575
|
+
(miniviewPeerTrackNode
|
|
576
|
+
? newPeerTrackNode.id !== miniviewPeerTrackNode.id
|
|
577
|
+
: true)
|
|
578
|
+
) {
|
|
579
|
+
return [...prevPeerTrackNodes, newPeerTrackNode];
|
|
580
|
+
}
|
|
403
581
|
|
|
404
|
-
|
|
405
|
-
|
|
582
|
+
return prevPeerTrackNodes;
|
|
583
|
+
});
|
|
584
|
+
}
|
|
406
585
|
|
|
407
586
|
// - TODO: update local localPeer state
|
|
408
587
|
// - Pass this updated data to Meeting component -> DisplayView component
|
|
409
588
|
if (peer.isLocal) {
|
|
410
589
|
if (track.source === HMSTrackSource.REGULAR) {
|
|
411
590
|
if (!localPeerTrackNode) {
|
|
412
|
-
|
|
591
|
+
if (isPublishingAllowed(newPeerTrackNode.peer)) {
|
|
592
|
+
dispatch(setLocalPeerTrackNode(newPeerTrackNode));
|
|
593
|
+
}
|
|
413
594
|
} else {
|
|
414
595
|
dispatch(
|
|
415
596
|
updateLocalPeerTrackNode(
|
|
@@ -418,18 +599,28 @@ const useHMSTrackUpdate = (
|
|
|
418
599
|
);
|
|
419
600
|
}
|
|
420
601
|
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
602
|
+
if (localTileInsetEnabled) {
|
|
603
|
+
// only setting `miniviewPeerTrackNode`, when:
|
|
604
|
+
// - there is no `miniviewPeerTrackNode`
|
|
605
|
+
// - if there is, then it is of regular track
|
|
606
|
+
if (!miniviewPeerTrackNode) {
|
|
607
|
+
dispatch(setMiniViewPeerTrackNode(newPeerTrackNode));
|
|
608
|
+
} else if (miniviewPeerTrackNode.id === newPeerTrackNode.id) {
|
|
609
|
+
dispatch(
|
|
610
|
+
updateMiniViewPeerTrackNode(
|
|
611
|
+
track.type === HMSTrackType.VIDEO
|
|
612
|
+
? { peer, track }
|
|
613
|
+
: { peer }
|
|
614
|
+
)
|
|
615
|
+
);
|
|
616
|
+
}
|
|
432
617
|
}
|
|
618
|
+
|
|
619
|
+
// if (track.type === HMSTrackType.AUDIO) {
|
|
620
|
+
// dispatch(setIsLocalAudioMutedState(track.isMute()));
|
|
621
|
+
// } else if (track.type === HMSTrackType.VIDEO) {
|
|
622
|
+
// dispatch(setIsLocalVideoMutedState(track.isMute()));
|
|
623
|
+
// }
|
|
433
624
|
}
|
|
434
625
|
// else -> {
|
|
435
626
|
// should `localPeerTrackNode` be created/updated for non-regular track addition?
|
|
@@ -455,8 +646,19 @@ const useHMSTrackUpdate = (
|
|
|
455
646
|
return;
|
|
456
647
|
}
|
|
457
648
|
if (type === HMSTrackUpdate.TRACK_REMOVED) {
|
|
458
|
-
if (
|
|
459
|
-
track.
|
|
649
|
+
if (track.source === HMSTrackSource.SCREEN) {
|
|
650
|
+
if (!peer.isLocal && track.type === HMSTrackType.VIDEO) {
|
|
651
|
+
const screensharePeerTrackNodes =
|
|
652
|
+
reduxState.app.screensharePeerTrackNodes;
|
|
653
|
+
const nodeToRemove = screensharePeerTrackNodes.find(
|
|
654
|
+
(node) => node.track?.trackId === track.trackId
|
|
655
|
+
);
|
|
656
|
+
if (nodeToRemove) {
|
|
657
|
+
dispatch(removeScreenshareTile(nodeToRemove.id));
|
|
658
|
+
}
|
|
659
|
+
}
|
|
660
|
+
} else if (
|
|
661
|
+
track.source === HMSTrackSource.PLUGIN ||
|
|
460
662
|
(peer.audioTrack?.trackId === undefined &&
|
|
461
663
|
peer.videoTrack?.trackId === undefined)
|
|
462
664
|
) {
|
|
@@ -465,6 +667,14 @@ const useHMSTrackUpdate = (
|
|
|
465
667
|
);
|
|
466
668
|
}
|
|
467
669
|
|
|
670
|
+
if (
|
|
671
|
+
fullScreenPeerTrackNode &&
|
|
672
|
+
fullScreenPeerTrackNode.track &&
|
|
673
|
+
fullScreenPeerTrackNode.track.trackId === track.trackId
|
|
674
|
+
) {
|
|
675
|
+
dispatch(setFullScreenPeerTrackNode(null));
|
|
676
|
+
}
|
|
677
|
+
|
|
468
678
|
// - TODO: update local localPeer state
|
|
469
679
|
// - Pass this updated data to Meeting component -> DisplayView component
|
|
470
680
|
if (peer.isLocal) {
|
|
@@ -551,48 +761,67 @@ const useHMSTrackUpdate = (
|
|
|
551
761
|
|
|
552
762
|
// - TODO: update local localPeer state
|
|
553
763
|
// - Pass this updated data to Meeting component -> DisplayView component
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
track.type === HMSTrackType.VIDEO ? { peer, track } : { peer };
|
|
764
|
+
const updatePayload =
|
|
765
|
+
track.type === HMSTrackType.VIDEO ? { peer, track } : { peer };
|
|
557
766
|
|
|
767
|
+
if (peer.isLocal) {
|
|
558
768
|
dispatch(updateLocalPeerTrackNode(updatePayload));
|
|
559
|
-
|
|
560
|
-
// Take care of miniviewPeerTrackNode
|
|
561
|
-
if (miniviewPeerTrackNode && miniviewPeerTrackNode.id === uniqueId) {
|
|
562
|
-
dispatch(updateMiniViewPeerTrackNode(updatePayload));
|
|
563
|
-
}
|
|
564
|
-
|
|
565
769
|
updateLocalPeer();
|
|
566
|
-
}
|
|
567
|
-
if (miniviewPeerTrackNode && miniviewPeerTrackNode.id === uniqueId) {
|
|
568
|
-
const updatePayload =
|
|
569
|
-
track.type === HMSTrackType.VIDEO ? { peer, track } : { peer };
|
|
770
|
+
}
|
|
570
771
|
|
|
571
|
-
|
|
572
|
-
|
|
772
|
+
if (miniviewPeerTrackNode && miniviewPeerTrackNode.id === uniqueId) {
|
|
773
|
+
dispatch(updateMiniViewPeerTrackNode(updatePayload));
|
|
774
|
+
}
|
|
775
|
+
|
|
776
|
+
if (
|
|
777
|
+
fullScreenPeerTrackNode &&
|
|
778
|
+
fullScreenPeerTrackNode.id === uniqueId
|
|
779
|
+
) {
|
|
780
|
+
dispatch(updateFullScreenPeerTrackNode(updatePayload));
|
|
573
781
|
}
|
|
782
|
+
|
|
574
783
|
return;
|
|
575
784
|
}
|
|
576
785
|
if (
|
|
577
786
|
type === HMSTrackUpdate.TRACK_RESTORED ||
|
|
578
787
|
type === HMSTrackUpdate.TRACK_DEGRADED
|
|
579
788
|
) {
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
789
|
+
// Checking if track source is screenshare
|
|
790
|
+
if (track.source === HMSTrackSource.SCREEN) {
|
|
791
|
+
// Handling screenshare tiles list
|
|
792
|
+
const screensharePeerTrackNodes =
|
|
793
|
+
reduxState.app.screensharePeerTrackNodes;
|
|
794
|
+
const nodeToUpdate = screensharePeerTrackNodes.find(
|
|
795
|
+
(node) => node.track?.trackId === track.trackId
|
|
796
|
+
);
|
|
797
|
+
if (nodeToUpdate) {
|
|
798
|
+
dispatch(
|
|
799
|
+
updateScreenshareTile({
|
|
800
|
+
id: nodeToUpdate.id,
|
|
801
|
+
isDegraded: type === HMSTrackUpdate.TRACK_DEGRADED,
|
|
802
|
+
})
|
|
589
803
|
);
|
|
590
804
|
}
|
|
591
|
-
|
|
592
|
-
|
|
805
|
+
} else {
|
|
806
|
+
// Handling regular tiles list
|
|
807
|
+
setPeerTrackNodes((prevPeerTrackNodes) => {
|
|
808
|
+
if (
|
|
809
|
+
peerTrackNodeExistForPeerAndTrack(prevPeerTrackNodes, peer, track)
|
|
810
|
+
) {
|
|
811
|
+
return degradeOrRestorePeerTrackNodes(
|
|
812
|
+
prevPeerTrackNodes,
|
|
813
|
+
peer,
|
|
814
|
+
track,
|
|
815
|
+
type === HMSTrackUpdate.TRACK_DEGRADED
|
|
816
|
+
);
|
|
817
|
+
}
|
|
818
|
+
return prevPeerTrackNodes;
|
|
819
|
+
});
|
|
820
|
+
}
|
|
593
821
|
|
|
594
822
|
const uniqueId = createPeerTrackNodeUniqueId(peer, track);
|
|
595
823
|
|
|
824
|
+
// Handling miniview
|
|
596
825
|
if (miniviewPeerTrackNode && miniviewPeerTrackNode.id === uniqueId) {
|
|
597
826
|
dispatch(
|
|
598
827
|
updateMiniViewPeerTrackNode({
|
|
@@ -600,6 +829,18 @@ const useHMSTrackUpdate = (
|
|
|
600
829
|
})
|
|
601
830
|
);
|
|
602
831
|
}
|
|
832
|
+
|
|
833
|
+
// Handling full screen view
|
|
834
|
+
if (
|
|
835
|
+
fullScreenPeerTrackNode &&
|
|
836
|
+
fullScreenPeerTrackNode.id === uniqueId
|
|
837
|
+
) {
|
|
838
|
+
dispatch(
|
|
839
|
+
updateFullScreenPeerTrackNode({
|
|
840
|
+
isDegraded: type === HMSTrackUpdate.TRACK_DEGRADED,
|
|
841
|
+
})
|
|
842
|
+
);
|
|
843
|
+
}
|
|
603
844
|
return;
|
|
604
845
|
}
|
|
605
846
|
};
|
|
@@ -650,9 +891,14 @@ export const useHMSInstance = () => {
|
|
|
650
891
|
};
|
|
651
892
|
|
|
652
893
|
export const useIsHLSViewer = () => {
|
|
653
|
-
return useSelector((state: RootState) =>
|
|
654
|
-
|
|
655
|
-
|
|
894
|
+
return useSelector((state: RootState) => {
|
|
895
|
+
const { layoutConfig, localPeer } = state.hmsStates;
|
|
896
|
+
const selectedLayoutConfig = selectLayoutConfigForRole(
|
|
897
|
+
layoutConfig,
|
|
898
|
+
localPeer?.role || null
|
|
899
|
+
);
|
|
900
|
+
return selectIsHLSViewer(localPeer?.role, selectedLayoutConfig);
|
|
901
|
+
});
|
|
656
902
|
};
|
|
657
903
|
|
|
658
904
|
type TrackStateChangeRequest = {
|
|
@@ -701,26 +947,20 @@ export const useHMSChangeTrackStateRequest = (
|
|
|
701
947
|
return trackStateChangeRequest;
|
|
702
948
|
};
|
|
703
949
|
|
|
704
|
-
type RoleChangeRequest = {
|
|
705
|
-
requestedBy?: string;
|
|
706
|
-
suggestedRole?: string;
|
|
707
|
-
};
|
|
708
|
-
|
|
709
950
|
export const useHMSRoleChangeRequest = (
|
|
710
951
|
callback?: (request: HMSRoleChangeRequest) => void,
|
|
711
952
|
deps?: React.DependencyList
|
|
712
953
|
) => {
|
|
954
|
+
const taskRef = useRef<any>(null);
|
|
955
|
+
const dispatch = useDispatch();
|
|
713
956
|
const hmsInstance = useHMSInstance();
|
|
714
|
-
const [roleChangeRequest, setRoleChangeRequest] =
|
|
715
|
-
useState<RoleChangeRequest | null>(null);
|
|
716
957
|
|
|
717
958
|
useEffect(() => {
|
|
718
|
-
const changeRoleRequestHandler = (request: HMSRoleChangeRequest) => {
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
959
|
+
const changeRoleRequestHandler = async (request: HMSRoleChangeRequest) => {
|
|
960
|
+
taskRef.current = InteractionManager.runAfterInteractions(() => {
|
|
961
|
+
dispatch(setRoleChangeRequest(request));
|
|
962
|
+
callback?.(request);
|
|
722
963
|
});
|
|
723
|
-
callback?.(request);
|
|
724
964
|
};
|
|
725
965
|
|
|
726
966
|
hmsInstance.addEventListener(
|
|
@@ -729,13 +969,12 @@ export const useHMSRoleChangeRequest = (
|
|
|
729
969
|
);
|
|
730
970
|
|
|
731
971
|
return () => {
|
|
972
|
+
taskRef.current?.cancel();
|
|
732
973
|
hmsInstance.removeEventListener(
|
|
733
974
|
HMSUpdateListenerActions.ON_ROLE_CHANGE_REQUEST
|
|
734
975
|
);
|
|
735
976
|
};
|
|
736
977
|
}, [...(deps || []), hmsInstance]);
|
|
737
|
-
|
|
738
|
-
return roleChangeRequest;
|
|
739
978
|
};
|
|
740
979
|
|
|
741
980
|
type SessionStoreListeners = Array<{ remove: () => void }>;
|
|
@@ -761,7 +1000,7 @@ export const useHMSSessionStoreListeners = (
|
|
|
761
1000
|
dispatch(saveUserData({ spotlightTrackId: id }));
|
|
762
1001
|
// Scroll to start of the list
|
|
763
1002
|
gridViewRef.current
|
|
764
|
-
?.
|
|
1003
|
+
?.getRegularTilesFlatlistRef()
|
|
765
1004
|
.current?.scrollToOffset({ animated: true, offset: 0 });
|
|
766
1005
|
};
|
|
767
1006
|
|
|
@@ -916,10 +1155,31 @@ export const useHMSSessionStore = () => {
|
|
|
916
1155
|
export const useHMSMessages = () => {
|
|
917
1156
|
const hmsInstance = useHMSInstance();
|
|
918
1157
|
const dispatch = useDispatch();
|
|
1158
|
+
const canChangeRole = useSelector(
|
|
1159
|
+
(state: RootState) =>
|
|
1160
|
+
state.hmsStates.localPeer?.role?.permissions?.changeRole
|
|
1161
|
+
);
|
|
1162
|
+
const canShowChat = useHMSConferencingScreenConfig(
|
|
1163
|
+
(conferencingScreenConfig) => !!conferencingScreenConfig?.elements?.chat
|
|
1164
|
+
);
|
|
919
1165
|
|
|
920
1166
|
useEffect(() => {
|
|
921
1167
|
const onMessageListener = (message: HMSMessage) => {
|
|
922
|
-
|
|
1168
|
+
if (message.type === NotificationTypes.ROLE_CHANGE_DECLINED) {
|
|
1169
|
+
if (canChangeRole) {
|
|
1170
|
+
dispatch(
|
|
1171
|
+
addNotification({
|
|
1172
|
+
id: `${message.sender?.peerID}-${NotificationTypes.ROLE_CHANGE_DECLINED}`,
|
|
1173
|
+
type: NotificationTypes.ROLE_CHANGE_DECLINED,
|
|
1174
|
+
peer: message.sender!,
|
|
1175
|
+
})
|
|
1176
|
+
);
|
|
1177
|
+
}
|
|
1178
|
+
} else if (message.type === 'EMOJI_REACTION') {
|
|
1179
|
+
console.log('Ignoring Emoji Reaction Message: ', message);
|
|
1180
|
+
} else if (canShowChat) {
|
|
1181
|
+
dispatch(addMessage(message));
|
|
1182
|
+
}
|
|
923
1183
|
};
|
|
924
1184
|
|
|
925
1185
|
hmsInstance.addEventListener(
|
|
@@ -931,12 +1191,38 @@ export const useHMSMessages = () => {
|
|
|
931
1191
|
// TODO: Remove this listener when user leaves, removed or room is ended
|
|
932
1192
|
hmsInstance.removeEventListener(HMSUpdateListenerActions.ON_MESSAGE);
|
|
933
1193
|
};
|
|
1194
|
+
}, [canChangeRole, canShowChat, hmsInstance]);
|
|
1195
|
+
};
|
|
1196
|
+
|
|
1197
|
+
export const useHMSReconnection = () => {
|
|
1198
|
+
const dispatch = useDispatch();
|
|
1199
|
+
const hmsInstance = useHMSInstance();
|
|
1200
|
+
|
|
1201
|
+
useEffect(() => {
|
|
1202
|
+
let mounted = true;
|
|
1203
|
+
|
|
1204
|
+
hmsInstance.addEventListener(HMSUpdateListenerActions.RECONNECTING, () => {
|
|
1205
|
+
if (mounted) {
|
|
1206
|
+
dispatch(setReconnecting(true));
|
|
1207
|
+
}
|
|
1208
|
+
});
|
|
1209
|
+
hmsInstance.addEventListener(HMSUpdateListenerActions.RECONNECTED, () => {
|
|
1210
|
+
if (mounted) {
|
|
1211
|
+
dispatch(setReconnecting(false));
|
|
1212
|
+
}
|
|
1213
|
+
});
|
|
1214
|
+
|
|
1215
|
+
return () => {
|
|
1216
|
+
mounted = false;
|
|
1217
|
+
hmsInstance.removeEventListener(HMSUpdateListenerActions.RECONNECTING);
|
|
1218
|
+
hmsInstance.removeEventListener(HMSUpdateListenerActions.RECONNECTED);
|
|
1219
|
+
};
|
|
934
1220
|
}, [hmsInstance]);
|
|
935
1221
|
};
|
|
936
1222
|
|
|
937
1223
|
export const useHMSPIPRoomLeave = () => {
|
|
938
1224
|
const hmsInstance = useHMSInstance();
|
|
939
|
-
const { destroy } = useLeaveMethods();
|
|
1225
|
+
const { destroy } = useLeaveMethods(true);
|
|
940
1226
|
|
|
941
1227
|
useEffect(() => {
|
|
942
1228
|
const pipRoomLeaveHandler = () => {
|
|
@@ -956,7 +1242,7 @@ export const useHMSPIPRoomLeave = () => {
|
|
|
956
1242
|
|
|
957
1243
|
export const useHMSRemovedFromRoomUpdate = () => {
|
|
958
1244
|
const hmsInstance = useHMSInstance();
|
|
959
|
-
const { destroy } = useLeaveMethods();
|
|
1245
|
+
const { destroy } = useLeaveMethods(true);
|
|
960
1246
|
|
|
961
1247
|
useEffect(() => {
|
|
962
1248
|
const removedFromRoomHandler = () => {
|
|
@@ -1035,6 +1321,7 @@ export const useHMSActiveSpeakerUpdates = (
|
|
|
1035
1321
|
active?: boolean
|
|
1036
1322
|
) => {
|
|
1037
1323
|
const hmsInstance = useHMSInstance();
|
|
1324
|
+
const dispatch = useDispatch();
|
|
1038
1325
|
const reduxStore = useStore<RootState>();
|
|
1039
1326
|
const isPortraitOrientation = useIsPortraitOrientation();
|
|
1040
1327
|
|
|
@@ -1044,6 +1331,8 @@ export const useHMSActiveSpeakerUpdates = (
|
|
|
1044
1331
|
}
|
|
1045
1332
|
|
|
1046
1333
|
const handleActiveSpeaker = (data: HMSSpeaker[]) => {
|
|
1334
|
+
dispatch(setActiveSpeakers(data));
|
|
1335
|
+
|
|
1047
1336
|
const activePage = reduxStore.getState().app.gridViewActivePage;
|
|
1048
1337
|
if (activePage !== 0) {
|
|
1049
1338
|
return;
|
|
@@ -1191,12 +1480,9 @@ export const useShowLandscapeLayout = () => {
|
|
|
1191
1480
|
const localPeerRoleName = useSelector(
|
|
1192
1481
|
(state: RootState) => state.hmsStates.localPeer?.role?.name
|
|
1193
1482
|
);
|
|
1483
|
+
const isHLSViewer = useIsHLSViewer();
|
|
1194
1484
|
|
|
1195
|
-
return
|
|
1196
|
-
isLandscapeOrientation &&
|
|
1197
|
-
!!localPeerRoleName &&
|
|
1198
|
-
localPeerRoleName.includes('hls-')
|
|
1199
|
-
);
|
|
1485
|
+
return isLandscapeOrientation && !!localPeerRoleName && isHLSViewer;
|
|
1200
1486
|
};
|
|
1201
1487
|
|
|
1202
1488
|
let hmsConfig: HMSConfig | null = null;
|
|
@@ -1226,7 +1512,7 @@ export const useHMSConfig = () => {
|
|
|
1226
1512
|
const roomLayout = await getRoomLayout(
|
|
1227
1513
|
hmsInstance,
|
|
1228
1514
|
token,
|
|
1229
|
-
|
|
1515
|
+
storeState.user.endPoints?.layout
|
|
1230
1516
|
);
|
|
1231
1517
|
dispatch(setLayoutConfig(roomLayout));
|
|
1232
1518
|
} catch (error) {
|
|
@@ -1258,155 +1544,321 @@ export const useHMSConfig = () => {
|
|
|
1258
1544
|
return { clearConfig, updateConfig, getConfig };
|
|
1259
1545
|
};
|
|
1260
1546
|
|
|
1261
|
-
export const
|
|
1262
|
-
const
|
|
1263
|
-
const
|
|
1547
|
+
export const useShowChatAndParticipants = () => {
|
|
1548
|
+
const dispatch = useDispatch();
|
|
1549
|
+
const { modalVisibleType, handleModalVisibleType: setModalVisible } =
|
|
1550
|
+
useModalType();
|
|
1264
1551
|
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1552
|
+
const overlayChatLayout = useHMSChatLayoutConfig(
|
|
1553
|
+
(chatConfig) => chatConfig?.is_overlay
|
|
1554
|
+
);
|
|
1555
|
+
const canShowChat = useHMSConferencingScreenConfig(
|
|
1556
|
+
(conferencingScreenConfig) => !!conferencingScreenConfig?.elements?.chat
|
|
1557
|
+
);
|
|
1558
|
+
const canShowParticipants = useHMSConferencingScreenConfig(
|
|
1559
|
+
(conferencingScreenConfig) =>
|
|
1560
|
+
!!conferencingScreenConfig?.elements?.participant_list
|
|
1561
|
+
);
|
|
1270
1562
|
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
(show: boolean) => void
|
|
1274
|
-
] => {
|
|
1275
|
-
const dispatch = useDispatch();
|
|
1276
|
-
const isHLSViewer = useIsHLSViewer();
|
|
1277
|
-
const showChatView = useSelector(
|
|
1563
|
+
// state for inset chat view
|
|
1564
|
+
const overlayChatVisible = useSelector(
|
|
1278
1565
|
(state: RootState) => state.chatWindow.showChatView
|
|
1279
1566
|
);
|
|
1280
|
-
const hlsAspectRatio = useSelector(
|
|
1281
|
-
(state: RootState) => state.app.hlsAspectRatio
|
|
1282
|
-
);
|
|
1283
|
-
const chatVisible: 'none' | 'inset' | 'modal' = useMemo(() => {
|
|
1284
|
-
if (!showChatView) return 'none';
|
|
1285
1567
|
|
|
1286
|
-
|
|
1287
|
-
return 'inset';
|
|
1568
|
+
const modalVisible = modalVisibleType === ModalTypes.CHAT_AND_PARTICIPANTS;
|
|
1288
1569
|
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1570
|
+
const show = useCallback(
|
|
1571
|
+
(view: 'chat' | 'participants') => {
|
|
1572
|
+
// Handle Showing Chat View/Modal
|
|
1573
|
+
if (view === 'chat') {
|
|
1574
|
+
if (!canShowChat) return;
|
|
1292
1575
|
|
|
1293
|
-
|
|
1576
|
+
if (overlayChatLayout) {
|
|
1577
|
+
dispatch({ type: 'SET_SHOW_CHAT_VIEW', showChatView: true });
|
|
1578
|
+
} else {
|
|
1579
|
+
batch(() => {
|
|
1580
|
+
dispatch({ type: 'SET_SHOW_CHAT_VIEW', showChatView: false });
|
|
1581
|
+
dispatch(setActiveChatBottomSheetTab('Chat'));
|
|
1582
|
+
});
|
|
1583
|
+
setModalVisible(ModalTypes.CHAT_AND_PARTICIPANTS);
|
|
1584
|
+
}
|
|
1585
|
+
}
|
|
1586
|
+
// Handle Showing Participant
|
|
1587
|
+
else if (canShowParticipants) {
|
|
1588
|
+
dispatch(setActiveChatBottomSheetTab('Participants'));
|
|
1589
|
+
setModalVisible(ModalTypes.CHAT_AND_PARTICIPANTS);
|
|
1590
|
+
}
|
|
1591
|
+
},
|
|
1592
|
+
[overlayChatLayout, canShowChat, canShowParticipants, setModalVisible]
|
|
1593
|
+
);
|
|
1294
1594
|
|
|
1295
|
-
const
|
|
1296
|
-
(
|
|
1297
|
-
if (
|
|
1298
|
-
|
|
1595
|
+
const hide = useCallback(
|
|
1596
|
+
(view: 'chat_overlay' | 'modal') => {
|
|
1597
|
+
if (view === 'chat_overlay') {
|
|
1598
|
+
dispatch({ type: 'SET_SHOW_CHAT_VIEW', showChatView: false });
|
|
1599
|
+
} else {
|
|
1600
|
+
setModalVisible(ModalTypes.DEFAULT);
|
|
1299
1601
|
}
|
|
1300
|
-
dispatch({ type: 'SET_SHOW_CHAT_VIEW', showChatView: show });
|
|
1301
1602
|
},
|
|
1302
|
-
[
|
|
1603
|
+
[overlayChatLayout, setModalVisible]
|
|
1303
1604
|
);
|
|
1304
1605
|
|
|
1305
|
-
return
|
|
1606
|
+
return {
|
|
1607
|
+
overlayChatVisible,
|
|
1608
|
+
modalVisible,
|
|
1609
|
+
overlayChatLayout,
|
|
1610
|
+
canShowChat,
|
|
1611
|
+
canShowParticipants,
|
|
1612
|
+
show,
|
|
1613
|
+
hide,
|
|
1614
|
+
};
|
|
1306
1615
|
};
|
|
1307
1616
|
|
|
1308
1617
|
export const usePortraitChatViewVisible = () => {
|
|
1309
|
-
const
|
|
1618
|
+
const { overlayChatVisible } = useShowChatAndParticipants();
|
|
1310
1619
|
const pipModeNotActive = useSelector(
|
|
1311
1620
|
(state: RootState) => state.app.pipModeStatus !== PipModes.ACTIVE
|
|
1312
1621
|
);
|
|
1313
1622
|
const isPortraitOrientation = useIsPortraitOrientation();
|
|
1314
1623
|
|
|
1315
|
-
return pipModeNotActive && isPortraitOrientation &&
|
|
1624
|
+
return pipModeNotActive && isPortraitOrientation && overlayChatVisible;
|
|
1316
1625
|
};
|
|
1317
1626
|
|
|
1318
1627
|
export const useLandscapeChatViewVisible = () => {
|
|
1319
|
-
const
|
|
1628
|
+
const { overlayChatVisible } = useShowChatAndParticipants();
|
|
1320
1629
|
const pipModeNotActive = useSelector(
|
|
1321
1630
|
(state: RootState) => state.app.pipModeStatus !== PipModes.ACTIVE
|
|
1322
1631
|
);
|
|
1323
1632
|
const isLandscapeOrientation = useIsLandscapeOrientation();
|
|
1324
1633
|
|
|
1325
|
-
return pipModeNotActive && isLandscapeOrientation &&
|
|
1634
|
+
return pipModeNotActive && isLandscapeOrientation && overlayChatVisible;
|
|
1635
|
+
};
|
|
1636
|
+
|
|
1637
|
+
export type ParticipantHeaderData = {
|
|
1638
|
+
label: string;
|
|
1639
|
+
role: HMSRole;
|
|
1640
|
+
itemsLength: number;
|
|
1641
|
+
};
|
|
1642
|
+
|
|
1643
|
+
export type ParticipantHandRaisedHeaderData = {
|
|
1644
|
+
label: string;
|
|
1645
|
+
itemsLength: number;
|
|
1646
|
+
};
|
|
1647
|
+
|
|
1648
|
+
export type ListItemUI<
|
|
1649
|
+
T =
|
|
1650
|
+
| ParticipantHeaderData
|
|
1651
|
+
| HMSLocalPeer
|
|
1652
|
+
| HMSPeer
|
|
1653
|
+
| ParticipantHandRaisedHeaderData,
|
|
1654
|
+
> = {
|
|
1655
|
+
type: 'EXPANDED_HEADER' | 'COLLAPSED_HEADER' | 'LAST_ITEM' | 'REGULAR_ITEM';
|
|
1656
|
+
data: T;
|
|
1657
|
+
key: string;
|
|
1326
1658
|
};
|
|
1327
1659
|
|
|
1328
1660
|
export const useFilteredParticipants = () => {
|
|
1329
|
-
const
|
|
1330
|
-
const
|
|
1331
|
-
(
|
|
1661
|
+
const roles = useSelector((state: RootState) => state.hmsStates.roles);
|
|
1662
|
+
const onStageRole = useHMSLayoutConfig(
|
|
1663
|
+
(layoutConfig) =>
|
|
1664
|
+
layoutConfig?.screens?.conferencing?.default?.elements?.on_stage_exp
|
|
1665
|
+
?.on_stage_role || null
|
|
1332
1666
|
);
|
|
1333
|
-
|
|
1334
|
-
const [
|
|
1335
|
-
const
|
|
1336
|
-
|
|
1667
|
+
|
|
1668
|
+
const [searchText, setSearchText] = useState('');
|
|
1669
|
+
const formattedSearchText = searchText.trim().toLowerCase();
|
|
1670
|
+
|
|
1671
|
+
const participants = useSelector(
|
|
1672
|
+
(state: RootState) => state.hmsStates.participants
|
|
1337
1673
|
);
|
|
1338
1674
|
|
|
1339
|
-
const
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
)
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1675
|
+
const peerGroups = useMemo(() => {
|
|
1676
|
+
return groupParticipantsAsPerRole(participants, formattedSearchText);
|
|
1677
|
+
}, [formattedSearchText, participants]);
|
|
1678
|
+
|
|
1679
|
+
const sortedRoles = useMemo(() => {
|
|
1680
|
+
return roles
|
|
1681
|
+
.filter((role) => peerGroups.has(role.name!))
|
|
1682
|
+
.sort((a, b) => {
|
|
1683
|
+
if (onStageRole) {
|
|
1684
|
+
if (a.name === onStageRole && b.name === onStageRole) {
|
|
1685
|
+
return 0;
|
|
1686
|
+
}
|
|
1350
1687
|
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1688
|
+
if (a.name === onStageRole) {
|
|
1689
|
+
return -1;
|
|
1690
|
+
}
|
|
1691
|
+
|
|
1692
|
+
if (b.name === onStageRole) {
|
|
1693
|
+
return 1;
|
|
1694
|
+
}
|
|
1695
|
+
}
|
|
1696
|
+
|
|
1697
|
+
const canAPublish: boolean =
|
|
1698
|
+
(a.publishSettings?.allowed &&
|
|
1699
|
+
a.publishSettings.allowed.length > 0) ??
|
|
1700
|
+
false;
|
|
1701
|
+
const canBPublish: boolean =
|
|
1702
|
+
(b.publishSettings?.allowed &&
|
|
1703
|
+
b.publishSettings.allowed.length > 0) ??
|
|
1704
|
+
false;
|
|
1705
|
+
|
|
1706
|
+
if (canAPublish && canBPublish) {
|
|
1707
|
+
return 0;
|
|
1708
|
+
}
|
|
1709
|
+
|
|
1710
|
+
if (canAPublish) {
|
|
1711
|
+
return -1;
|
|
1712
|
+
}
|
|
1354
1713
|
|
|
1355
|
-
|
|
1356
|
-
return newFilteredPeerTrackNodes.filter((peer) => {
|
|
1357
|
-
const parsedMetaData = parseMetadata(peer.metadata);
|
|
1358
|
-
return parsedMetaData.isHandRaised === true;
|
|
1714
|
+
return 1;
|
|
1359
1715
|
});
|
|
1716
|
+
}, [peerGroups, onStageRole, roles]);
|
|
1717
|
+
|
|
1718
|
+
const firstGroupName = peerGroups.has('hand-raised')
|
|
1719
|
+
? 'hand-raised'
|
|
1720
|
+
: sortedRoles[0]?.name;
|
|
1721
|
+
|
|
1722
|
+
const [expandedGroups, setExpandedGroups] = useState<string[]>(
|
|
1723
|
+
firstGroupName ? [firstGroupName] : []
|
|
1724
|
+
);
|
|
1725
|
+
|
|
1726
|
+
const groupedList = useMemo(() => {
|
|
1727
|
+
let list: ListItemUI[] = [];
|
|
1728
|
+
|
|
1729
|
+
const handRaisedPeers = peerGroups.get('hand-raised');
|
|
1730
|
+
|
|
1731
|
+
if (handRaisedPeers) {
|
|
1732
|
+
const expanded = expandedGroups.includes('hand-raised');
|
|
1733
|
+
|
|
1734
|
+
list.push({
|
|
1735
|
+
type: expanded ? 'EXPANDED_HEADER' : 'COLLAPSED_HEADER',
|
|
1736
|
+
key: 'hand-raised',
|
|
1737
|
+
data: {
|
|
1738
|
+
label: `Hand Raised (${handRaisedPeers.length})`,
|
|
1739
|
+
itemsLength: handRaisedPeers.length,
|
|
1740
|
+
},
|
|
1741
|
+
});
|
|
1742
|
+
|
|
1743
|
+
if (expanded) {
|
|
1744
|
+
list = list.concat(
|
|
1745
|
+
handRaisedPeers.map((peer, idx, arr) => {
|
|
1746
|
+
const isLast = arr.length - 1 === idx;
|
|
1747
|
+
|
|
1748
|
+
return {
|
|
1749
|
+
data: peer,
|
|
1750
|
+
key: `${peer.peerID}--${'hand-raised'}`,
|
|
1751
|
+
type: isLast ? 'LAST_ITEM' : 'REGULAR_ITEM',
|
|
1752
|
+
};
|
|
1753
|
+
})
|
|
1754
|
+
);
|
|
1755
|
+
}
|
|
1360
1756
|
}
|
|
1361
1757
|
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
);
|
|
1365
|
-
}, [participantsSearchInput, filter, hmsPeers]);
|
|
1758
|
+
sortedRoles.forEach((role) => {
|
|
1759
|
+
const peers = peerGroups.get(role.name!);
|
|
1366
1760
|
|
|
1367
|
-
|
|
1368
|
-
|
|
1761
|
+
if (peers) {
|
|
1762
|
+
const expanded = expandedGroups.includes(role.name!);
|
|
1369
1763
|
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1764
|
+
list.push({
|
|
1765
|
+
type: expanded ? 'EXPANDED_HEADER' : 'COLLAPSED_HEADER',
|
|
1766
|
+
key: role.name!,
|
|
1767
|
+
data: {
|
|
1768
|
+
label: `${role.name!} (${peers.length})`,
|
|
1769
|
+
role: role,
|
|
1770
|
+
itemsLength: peers.length,
|
|
1771
|
+
},
|
|
1376
1772
|
});
|
|
1773
|
+
|
|
1774
|
+
if (expanded) {
|
|
1775
|
+
list = list.concat(
|
|
1776
|
+
peers.map((peer, idx, arr) => {
|
|
1777
|
+
const isLast = arr.length - 1 === idx;
|
|
1778
|
+
|
|
1779
|
+
return {
|
|
1780
|
+
data: peer,
|
|
1781
|
+
key: `${peer.peerID}--${role.name!}`,
|
|
1782
|
+
type: isLast ? 'LAST_ITEM' : 'REGULAR_ITEM',
|
|
1783
|
+
};
|
|
1784
|
+
})
|
|
1785
|
+
);
|
|
1786
|
+
}
|
|
1377
1787
|
}
|
|
1378
1788
|
});
|
|
1379
1789
|
|
|
1380
|
-
return
|
|
1381
|
-
|
|
1382
|
-
};
|
|
1383
|
-
}, [localPeer, hmsInstance]);
|
|
1790
|
+
return list;
|
|
1791
|
+
}, [expandedGroups, peerGroups, sortedRoles]);
|
|
1384
1792
|
|
|
1385
1793
|
return {
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1794
|
+
data: groupedList,
|
|
1795
|
+
searchText,
|
|
1796
|
+
formattedSearchText,
|
|
1797
|
+
setSearchText,
|
|
1798
|
+
expandedGroups,
|
|
1799
|
+
setExpandedGroups,
|
|
1392
1800
|
};
|
|
1393
1801
|
};
|
|
1394
1802
|
|
|
1803
|
+
const groupParticipantsAsPerRole = (
|
|
1804
|
+
participants: (HMSLocalPeer | HMSPeer)[],
|
|
1805
|
+
searchText: string
|
|
1806
|
+
) => {
|
|
1807
|
+
const groups: Map<string, (HMSLocalPeer | HMSPeer)[]> = new Map();
|
|
1808
|
+
|
|
1809
|
+
for (const participant of participants) {
|
|
1810
|
+
const participantRole = participant.role;
|
|
1811
|
+
|
|
1812
|
+
if (!participantRole) {
|
|
1813
|
+
continue;
|
|
1814
|
+
}
|
|
1815
|
+
|
|
1816
|
+
if (
|
|
1817
|
+
searchText.length <= 0 ||
|
|
1818
|
+
participant.name.toLowerCase().includes(searchText)
|
|
1819
|
+
) {
|
|
1820
|
+
if (!groups.has(participantRole.name!)) {
|
|
1821
|
+
groups.set(participantRole.name!, []);
|
|
1822
|
+
}
|
|
1823
|
+
|
|
1824
|
+
const group = groups.get(participantRole.name!);
|
|
1825
|
+
|
|
1826
|
+
if (!group) {
|
|
1827
|
+
continue;
|
|
1828
|
+
}
|
|
1829
|
+
|
|
1830
|
+
group.push(participant);
|
|
1831
|
+
|
|
1832
|
+
if (parseMetadata(participant.metadata).isHandRaised) {
|
|
1833
|
+
if (!groups.has('hand-raised')) {
|
|
1834
|
+
groups.set('hand-raised', []);
|
|
1835
|
+
}
|
|
1836
|
+
|
|
1837
|
+
const group = groups.get('hand-raised');
|
|
1838
|
+
|
|
1839
|
+
if (group) group.push(participant);
|
|
1840
|
+
}
|
|
1841
|
+
}
|
|
1842
|
+
}
|
|
1843
|
+
|
|
1844
|
+
return groups;
|
|
1845
|
+
};
|
|
1846
|
+
|
|
1395
1847
|
export const useShouldGoLive = () => {
|
|
1396
1848
|
const shouldGoLive = useSelector(selectShouldGoLive);
|
|
1397
1849
|
|
|
1398
1850
|
return shouldGoLive;
|
|
1399
1851
|
};
|
|
1400
1852
|
|
|
1401
|
-
export const useLeaveMethods = () => {
|
|
1853
|
+
export const useLeaveMethods = (isUnmounted: boolean) => {
|
|
1402
1854
|
const navigation = useContext(NavigationContext);
|
|
1403
1855
|
const hmsInstance = useHMSInstance();
|
|
1404
1856
|
const dispatch = useDispatch();
|
|
1405
1857
|
const reduxStore = useStore<RootState>();
|
|
1406
1858
|
|
|
1407
|
-
const destroy = useCallback(
|
|
1859
|
+
const destroy = useCallback(() => {
|
|
1408
1860
|
try {
|
|
1409
|
-
const s =
|
|
1861
|
+
const s = hmsInstance.destroy();
|
|
1410
1862
|
console.log('Destroy Success: ', s);
|
|
1411
1863
|
// TODOS:
|
|
1412
1864
|
// - If show `Meeting_Ended` is true, show Meeting screen by setting state to MEETING_ENDED
|
|
@@ -1433,11 +1885,10 @@ export const useLeaveMethods = () => {
|
|
|
1433
1885
|
if (typeof onLeave === 'function') {
|
|
1434
1886
|
onLeave();
|
|
1435
1887
|
dispatch(clearStore());
|
|
1436
|
-
} else if (navigation && navigation.canGoBack()) {
|
|
1888
|
+
} else if (navigation && navigation.canGoBack() && !isUnmounted) {
|
|
1437
1889
|
navigation.goBack();
|
|
1438
1890
|
dispatch(clearStore());
|
|
1439
1891
|
} else {
|
|
1440
|
-
// TODO: call onLeave Callback if provided
|
|
1441
1892
|
// Otherwise default action is to show "Meeting Ended" screen
|
|
1442
1893
|
dispatch(clearStore()); // TODO: We need different clearStore for MeetingEnded
|
|
1443
1894
|
dispatch(changeMeetingState(MeetingState.MEETING_ENDED));
|
|
@@ -1453,16 +1904,24 @@ export const useLeaveMethods = () => {
|
|
|
1453
1904
|
}
|
|
1454
1905
|
}, [hmsInstance]);
|
|
1455
1906
|
|
|
1456
|
-
const leave = useCallback(
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1907
|
+
const leave = useCallback(
|
|
1908
|
+
async (shouldEndStream: boolean = false) => {
|
|
1909
|
+
if (shouldEndStream) {
|
|
1910
|
+
hmsInstance.stopHLSStreaming().catch((error) => {
|
|
1911
|
+
console.log('Stop HLS Streaming Error: ', error);
|
|
1912
|
+
});
|
|
1913
|
+
}
|
|
1914
|
+
try {
|
|
1915
|
+
const d = await hmsInstance.leave();
|
|
1916
|
+
console.log('Leave Success: ', d);
|
|
1917
|
+
await destroy();
|
|
1918
|
+
} catch (e) {
|
|
1919
|
+
console.log(`Leave Room Error: ${e}`);
|
|
1920
|
+
Toast.showWithGravity(`Leave Room Error: ${e}`, Toast.LONG, Toast.TOP);
|
|
1921
|
+
}
|
|
1922
|
+
},
|
|
1923
|
+
[destroy, hmsInstance]
|
|
1924
|
+
);
|
|
1466
1925
|
|
|
1467
1926
|
const goToPreview = useCallback(async () => {
|
|
1468
1927
|
try {
|
|
@@ -1491,21 +1950,32 @@ export const useLeaveMethods = () => {
|
|
|
1491
1950
|
return { destroy, leave, endRoom, goToPreview };
|
|
1492
1951
|
};
|
|
1493
1952
|
|
|
1494
|
-
|
|
1495
|
-
|
|
1953
|
+
// Returns layout config as it is returned from server
|
|
1954
|
+
export const useHMSLayoutConfig = <Selected = unknown>(
|
|
1955
|
+
selector: (layoutConfig: Layout | null) => Selected,
|
|
1956
|
+
equalityFn?: (left: Selected, right: Selected) => boolean
|
|
1957
|
+
): Selected => {
|
|
1958
|
+
return useSelector((state: RootState) => {
|
|
1959
|
+
return selector(
|
|
1960
|
+
selectLayoutConfigForRole(
|
|
1961
|
+
state.hmsStates.layoutConfig,
|
|
1962
|
+
state.hmsStates.localPeer?.role || null
|
|
1963
|
+
)
|
|
1964
|
+
);
|
|
1965
|
+
}, equalityFn);
|
|
1496
1966
|
};
|
|
1497
1967
|
|
|
1498
|
-
|
|
1499
|
-
selector?: (theme: Required<Theme>) => S
|
|
1500
|
-
): Required<Theme> | S => {
|
|
1501
|
-
return useSelector((state: RootState) => {
|
|
1502
|
-
const layoutConfig = state.hmsStates.layoutConfig;
|
|
1968
|
+
type ThemeWithPalette = Theme & { palette: ColorPalette };
|
|
1503
1969
|
|
|
1504
|
-
|
|
1970
|
+
export const useHMSRoomTheme = <S>(
|
|
1971
|
+
selector?: (theme: ThemeWithPalette) => S
|
|
1972
|
+
): ThemeWithPalette | S => {
|
|
1973
|
+
return useHMSLayoutConfig((layoutConfig) => {
|
|
1974
|
+
const roomTheme = layoutConfig?.themes?.find((theme) => theme.default);
|
|
1505
1975
|
|
|
1506
|
-
const defaultTheme:
|
|
1976
|
+
const defaultTheme: ThemeWithPalette = roomTheme
|
|
1507
1977
|
? roomTheme.palette
|
|
1508
|
-
? (roomTheme as
|
|
1978
|
+
? (roomTheme as ThemeWithPalette)
|
|
1509
1979
|
: { ...roomTheme, palette: DEFAULT_THEME.palette }
|
|
1510
1980
|
: DEFAULT_THEME;
|
|
1511
1981
|
|
|
@@ -1521,10 +1991,8 @@ export const useHMSRoomColorPalette = (): ColorPalette => {
|
|
|
1521
1991
|
return useHMSRoomTheme((theme) => theme.palette) as ColorPalette;
|
|
1522
1992
|
};
|
|
1523
1993
|
|
|
1524
|
-
export const useHMSRoomTypography = (): Typography => {
|
|
1525
|
-
return
|
|
1526
|
-
const layoutConfig = state.hmsStates.layoutConfig;
|
|
1527
|
-
|
|
1994
|
+
export const useHMSRoomTypography = (): Required<Typography> => {
|
|
1995
|
+
return useHMSLayoutConfig((layoutConfig) => {
|
|
1528
1996
|
const typography = layoutConfig?.typography;
|
|
1529
1997
|
|
|
1530
1998
|
if (!typography) {
|
|
@@ -1538,17 +2006,20 @@ export const useHMSRoomTypography = (): Typography => {
|
|
|
1538
2006
|
};
|
|
1539
2007
|
}
|
|
1540
2008
|
|
|
1541
|
-
|
|
2009
|
+
// formatting font family name
|
|
2010
|
+
typography.font_family = typography.font_family.replace(/ /g, '');
|
|
2011
|
+
|
|
2012
|
+
return typography as Required<Typography>;
|
|
1542
2013
|
}, shallowEqual);
|
|
1543
2014
|
};
|
|
1544
2015
|
|
|
1545
2016
|
export const useHMSRoomStyleSheet = <
|
|
1546
|
-
T extends { [key: string]: StyleProp<ViewStyle | TextStyle | ImageStyle> }
|
|
2017
|
+
T extends { [key: string]: StyleProp<ViewStyle | TextStyle | ImageStyle> },
|
|
1547
2018
|
>(
|
|
1548
|
-
updater: (theme:
|
|
2019
|
+
updater: (theme: ThemeWithPalette, typography: Required<Typography>) => T,
|
|
1549
2020
|
deps: DependencyList = []
|
|
1550
2021
|
): T => {
|
|
1551
|
-
const theme = useHMSRoomTheme<
|
|
2022
|
+
const theme = useHMSRoomTheme<ThemeWithPalette>();
|
|
1552
2023
|
const typography = useHMSRoomTypography();
|
|
1553
2024
|
|
|
1554
2025
|
return useMemo(
|
|
@@ -1558,9 +2029,9 @@ export const useHMSRoomStyleSheet = <
|
|
|
1558
2029
|
};
|
|
1559
2030
|
|
|
1560
2031
|
export const useHMSRoomStyle = <
|
|
1561
|
-
T extends StyleProp<ViewStyle | TextStyle | ImageStyle
|
|
2032
|
+
T extends StyleProp<ViewStyle | TextStyle | ImageStyle>,
|
|
1562
2033
|
>(
|
|
1563
|
-
updater: (theme:
|
|
2034
|
+
updater: (theme: ThemeWithPalette, typography: Required<Typography>) => T,
|
|
1564
2035
|
deps: DependencyList = []
|
|
1565
2036
|
): T => {
|
|
1566
2037
|
return useHMSRoomStyleSheet(
|
|
@@ -1570,3 +2041,115 @@ export const useHMSRoomStyle = <
|
|
|
1570
2041
|
deps
|
|
1571
2042
|
).default;
|
|
1572
2043
|
};
|
|
2044
|
+
|
|
2045
|
+
export const useSendMessage = () => {
|
|
2046
|
+
const hmsInstance = useHMSInstance();
|
|
2047
|
+
const dispatch = useDispatch();
|
|
2048
|
+
const reduxStore = useStore<RootState>();
|
|
2049
|
+
|
|
2050
|
+
const message = useSelector(
|
|
2051
|
+
(state: RootState) => state.chatWindow.typedMessage
|
|
2052
|
+
);
|
|
2053
|
+
|
|
2054
|
+
const setMessage = useCallback((text: string) => {
|
|
2055
|
+
dispatch({ type: 'SET_TYPED_MESSAGE', typedMessage: text });
|
|
2056
|
+
}, []);
|
|
2057
|
+
|
|
2058
|
+
const sendMessage = useCallback(async () => {
|
|
2059
|
+
const chatWindowState = reduxStore.getState().chatWindow;
|
|
2060
|
+
|
|
2061
|
+
const message = chatWindowState.typedMessage;
|
|
2062
|
+
const sendingTo = chatWindowState.sendTo as
|
|
2063
|
+
| HMSRole
|
|
2064
|
+
| HMSRemotePeer
|
|
2065
|
+
| typeof ChatBroadcastFilter;
|
|
2066
|
+
|
|
2067
|
+
if (message.length <= 0) return;
|
|
2068
|
+
|
|
2069
|
+
const hmsMessageRecipient = new HMSMessageRecipient({
|
|
2070
|
+
recipientType:
|
|
2071
|
+
'publishSettings' in sendingTo
|
|
2072
|
+
? HMSMessageRecipientType.ROLES
|
|
2073
|
+
: 'peerID' in sendingTo
|
|
2074
|
+
? HMSMessageRecipientType.PEER
|
|
2075
|
+
: HMSMessageRecipientType.BROADCAST,
|
|
2076
|
+
recipientPeer: 'peerID' in sendingTo ? sendingTo : undefined,
|
|
2077
|
+
recipientRoles: 'publishSettings' in sendingTo ? [sendingTo] : undefined,
|
|
2078
|
+
});
|
|
2079
|
+
|
|
2080
|
+
// Saving reference of `message` state to local variable
|
|
2081
|
+
// to use the typed message after clearing state
|
|
2082
|
+
const messageText = message;
|
|
2083
|
+
|
|
2084
|
+
dispatch({ type: 'SET_TYPED_MESSAGE', typedMessage: '' });
|
|
2085
|
+
|
|
2086
|
+
const handleMessageID = ({
|
|
2087
|
+
messageId,
|
|
2088
|
+
}: {
|
|
2089
|
+
messageId: string | undefined;
|
|
2090
|
+
}) => {
|
|
2091
|
+
const localPeer = reduxStore.getState().hmsStates.localPeer;
|
|
2092
|
+
|
|
2093
|
+
if (messageId) {
|
|
2094
|
+
Keyboard.dismiss();
|
|
2095
|
+
const localMessage = new HMSMessage({
|
|
2096
|
+
messageId: messageId,
|
|
2097
|
+
message: messageText,
|
|
2098
|
+
type: 'chat',
|
|
2099
|
+
time: new Date(),
|
|
2100
|
+
sender: localPeer || undefined,
|
|
2101
|
+
recipient: hmsMessageRecipient,
|
|
2102
|
+
});
|
|
2103
|
+
dispatch(addMessage(localMessage));
|
|
2104
|
+
}
|
|
2105
|
+
};
|
|
2106
|
+
|
|
2107
|
+
try {
|
|
2108
|
+
let result: { messageId: string | undefined };
|
|
2109
|
+
if ('publishSettings' in sendingTo) {
|
|
2110
|
+
result = await hmsInstance.sendGroupMessage(messageText, [sendingTo]);
|
|
2111
|
+
} else if ('peerID' in sendingTo) {
|
|
2112
|
+
result = await hmsInstance.sendDirectMessage(messageText, sendingTo);
|
|
2113
|
+
} else {
|
|
2114
|
+
result = await hmsInstance.sendBroadcastMessage(messageText);
|
|
2115
|
+
}
|
|
2116
|
+
handleMessageID(result);
|
|
2117
|
+
|
|
2118
|
+
return Promise.resolve(result);
|
|
2119
|
+
} catch (error) {
|
|
2120
|
+
return Promise.reject(error);
|
|
2121
|
+
}
|
|
2122
|
+
}, []);
|
|
2123
|
+
|
|
2124
|
+
return {
|
|
2125
|
+
message,
|
|
2126
|
+
setMessage,
|
|
2127
|
+
sendMessage,
|
|
2128
|
+
};
|
|
2129
|
+
};
|
|
2130
|
+
|
|
2131
|
+
export const useHMSChatLayoutConfig = <Selected = unknown>(
|
|
2132
|
+
selector: (chatConfig: ChatConfig | null) => Selected,
|
|
2133
|
+
equalityFn?: (left: Selected, right: Selected) => boolean
|
|
2134
|
+
): Selected => {
|
|
2135
|
+
return useHMSLayoutConfig((layoutConfig) => {
|
|
2136
|
+
const chatConfig = selectChatLayoutConfig(layoutConfig);
|
|
2137
|
+
return selector(chatConfig);
|
|
2138
|
+
}, equalityFn);
|
|
2139
|
+
};
|
|
2140
|
+
|
|
2141
|
+
export const useHMSConferencingScreenConfig = <Selected = unknown>(
|
|
2142
|
+
selector: (
|
|
2143
|
+
conferencingScreenConfig:
|
|
2144
|
+
| DefaultConferencingScreen
|
|
2145
|
+
| HLSLiveStreamingScreen
|
|
2146
|
+
| null
|
|
2147
|
+
) => Selected,
|
|
2148
|
+
equalityFn?: (left: Selected, right: Selected) => boolean
|
|
2149
|
+
): Selected => {
|
|
2150
|
+
return useHMSLayoutConfig((layoutConfig) => {
|
|
2151
|
+
const conferencingScreenConfig =
|
|
2152
|
+
selectConferencingScreenConfig(layoutConfig);
|
|
2153
|
+
return selector(conferencingScreenConfig);
|
|
2154
|
+
}, equalityFn);
|
|
2155
|
+
};
|