@ethora/chat-component-rn 26.10.9 → 26.10.11
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/CHANGELOG.md +17 -0
- package/README.md +126 -1
- package/lib/commonjs/booking/index.js +44 -0
- package/lib/commonjs/booking/index.js.map +1 -0
- package/lib/commonjs/booking/pendingScheduledCall.js +275 -0
- package/lib/commonjs/booking/pendingScheduledCall.js.map +1 -0
- package/lib/commonjs/booking/scheduleForm.js +91 -0
- package/lib/commonjs/booking/scheduleForm.js.map +1 -0
- package/lib/commonjs/booking/scheduledCall.js +141 -0
- package/lib/commonjs/booking/scheduledCall.js.map +1 -0
- package/lib/commonjs/booking/scheduledCallActions.js +128 -0
- package/lib/commonjs/booking/scheduledCallActions.js.map +1 -0
- package/lib/commonjs/booking/scheduledCallLink.js +143 -0
- package/lib/commonjs/booking/scheduledCallLink.js.map +1 -0
- package/lib/commonjs/booking/scheduledCallStore.js +64 -0
- package/lib/commonjs/booking/scheduledCallStore.js.map +1 -0
- package/lib/commonjs/booking/startRoomCall.js +84 -0
- package/lib/commonjs/booking/startRoomCall.js.map +1 -0
- package/lib/commonjs/calls/callBusy.js +18 -0
- package/lib/commonjs/calls/callBusy.js.map +1 -0
- package/lib/commonjs/calls/callDisplay.js +73 -0
- package/lib/commonjs/calls/callDisplay.js.map +1 -0
- package/lib/commonjs/calls/callMode.js +175 -0
- package/lib/commonjs/calls/callMode.js.map +1 -0
- package/lib/commonjs/calls/declineReport.js +20 -0
- package/lib/commonjs/calls/declineReport.js.map +1 -0
- package/lib/commonjs/calls/p2p/P2PCallController.js +724 -0
- package/lib/commonjs/calls/p2p/P2PCallController.js.map +1 -0
- package/lib/commonjs/calls/p2p/icePolicy.js +107 -0
- package/lib/commonjs/calls/p2p/icePolicy.js.map +1 -0
- package/lib/commonjs/calls/p2p/negotiator.js +202 -0
- package/lib/commonjs/calls/p2p/negotiator.js.map +1 -0
- package/lib/commonjs/calls/p2p/p2pRuntime.js +147 -0
- package/lib/commonjs/calls/p2p/p2pRuntime.js.map +1 -0
- package/lib/commonjs/calls/p2p/signalInbox.js +98 -0
- package/lib/commonjs/calls/p2p/signalInbox.js.map +1 -0
- package/lib/commonjs/calls/p2p/signalStanza.js +141 -0
- package/lib/commonjs/calls/p2p/signalStanza.js.map +1 -0
- package/lib/commonjs/calls/p2p/webrtcRuntime.js +53 -0
- package/lib/commonjs/calls/p2p/webrtcRuntime.js.map +1 -0
- package/lib/commonjs/calls/senderTrust.js +43 -0
- package/lib/commonjs/calls/senderTrust.js.map +1 -0
- package/lib/commonjs/calls/startCall.js +51 -0
- package/lib/commonjs/calls/startCall.js.map +1 -0
- package/lib/commonjs/components/Booking/BookingIcons.js +55 -0
- package/lib/commonjs/components/Booking/BookingIcons.js.map +1 -0
- package/lib/commonjs/components/Booking/ScheduleCallButton.js +64 -0
- package/lib/commonjs/components/Booking/ScheduleCallButton.js.map +1 -0
- package/lib/commonjs/components/Booking/ScheduleCallSheet.js +351 -0
- package/lib/commonjs/components/Booking/ScheduleCallSheet.js.map +1 -0
- package/lib/commonjs/components/Booking/ScheduledCallCard.js +203 -0
- package/lib/commonjs/components/Booking/ScheduledCallCard.js.map +1 -0
- package/lib/commonjs/components/Booking/ScheduledCallHost.js +23 -0
- package/lib/commonjs/components/Booking/ScheduledCallHost.js.map +1 -0
- package/lib/commonjs/components/Booking/ScheduledCallMessage.js +55 -0
- package/lib/commonjs/components/Booking/ScheduledCallMessage.js.map +1 -0
- package/lib/commonjs/components/Booking/ScheduledCallPreJoin.js +235 -0
- package/lib/commonjs/components/Booking/ScheduledCallPreJoin.js.map +1 -0
- package/lib/commonjs/components/Booking/bookingShared.js +305 -0
- package/lib/commonjs/components/Booking/bookingShared.js.map +1 -0
- package/lib/commonjs/components/MainComponents/AlbumGrid.js +6 -2
- package/lib/commonjs/components/MainComponents/AlbumGrid.js.map +1 -1
- package/lib/commonjs/components/MainComponents/ChatHeader.js +18 -12
- package/lib/commonjs/components/MainComponents/ChatHeader.js.map +1 -1
- package/lib/commonjs/components/MainComponents/LanguageSelectorButton.js +5 -2
- package/lib/commonjs/components/MainComponents/LanguageSelectorButton.js.map +1 -1
- package/lib/commonjs/components/MainComponents/LanguageSelectorModal.js +6 -3
- package/lib/commonjs/components/MainComponents/LanguageSelectorModal.js.map +1 -1
- package/lib/commonjs/components/MainComponents/MediaMessage.js +13 -0
- package/lib/commonjs/components/MainComponents/MediaMessage.js.map +1 -1
- package/lib/commonjs/components/MainComponents/MessageContainer.js +13 -0
- package/lib/commonjs/components/MainComponents/MessageContainer.js.map +1 -1
- package/lib/commonjs/components/MainComponents/ReduxWrapper.js +10 -0
- package/lib/commonjs/components/MainComponents/ReduxWrapper.js.map +1 -1
- package/lib/commonjs/components/MainComponents/RoomList.js +7 -16
- package/lib/commonjs/components/MainComponents/RoomList.js.map +1 -1
- package/lib/commonjs/components/MessageBubble/Message.js +27 -1
- package/lib/commonjs/components/MessageBubble/Message.js.map +1 -1
- package/lib/commonjs/components/Modals/ChatProfileModal/ChatMediaGrid.js +159 -0
- package/lib/commonjs/components/Modals/ChatProfileModal/ChatMediaGrid.js.map +1 -0
- package/lib/commonjs/components/Modals/ChatProfileModal/ChatProfileModal.js +203 -134
- package/lib/commonjs/components/Modals/ChatProfileModal/ChatProfileModal.js.map +1 -1
- package/lib/commonjs/components/Modals/ChatProfileModal/LeaveChatModal.js +180 -0
- package/lib/commonjs/components/Modals/ChatProfileModal/LeaveChatModal.js.map +1 -0
- package/lib/commonjs/components/Modals/ChatProfileModal/ReportChatModal.js +19 -15
- package/lib/commonjs/components/Modals/ChatProfileModal/ReportChatModal.js.map +1 -1
- package/lib/commonjs/components/Modals/FilePreviewModal/FilePreviewModal.js +100 -162
- package/lib/commonjs/components/Modals/FilePreviewModal/FilePreviewModal.js.map +1 -1
- package/lib/commonjs/components/Modals/FilePreviewModal/MediaViewer.js +824 -0
- package/lib/commonjs/components/Modals/FilePreviewModal/MediaViewer.js.map +1 -0
- package/lib/commonjs/components/Modals/FilePreviewModal/useSaveFile.js +179 -0
- package/lib/commonjs/components/Modals/FilePreviewModal/useSaveFile.js.map +1 -0
- package/lib/commonjs/components/Modals/MessageSearchModal/MessageSearchModal.js +22 -5
- package/lib/commonjs/components/Modals/MessageSearchModal/MessageSearchModal.js.map +1 -1
- package/lib/commonjs/components/Modals/UserProfileModal/UserProfileModal.js +15 -8
- package/lib/commonjs/components/Modals/UserProfileModal/UserProfileModal.js.map +1 -1
- package/lib/commonjs/components/Modals/UserSettingsModal/LanguageCard.js +1 -1
- package/lib/commonjs/components/Modals/UserSettingsModal/LanguageCard.js.map +1 -1
- package/lib/commonjs/components/VideoCalls/ActiveCallBar.js +3 -2
- package/lib/commonjs/components/VideoCalls/ActiveCallBar.js.map +1 -1
- package/lib/commonjs/components/VideoCalls/CallButtons.js +19 -11
- package/lib/commonjs/components/VideoCalls/CallButtons.js.map +1 -1
- package/lib/commonjs/components/VideoCalls/CallControlBar.js +119 -0
- package/lib/commonjs/components/VideoCalls/CallControlBar.js.map +1 -0
- package/lib/commonjs/components/VideoCalls/CallVideo.js +49 -0
- package/lib/commonjs/components/VideoCalls/CallVideo.js.map +1 -0
- package/lib/commonjs/components/VideoCalls/GroupCallView.js +281 -0
- package/lib/commonjs/components/VideoCalls/GroupCallView.js.map +1 -0
- package/lib/commonjs/components/VideoCalls/P2PCallRunner.js +151 -0
- package/lib/commonjs/components/VideoCalls/P2PCallRunner.js.map +1 -0
- package/lib/commonjs/components/VideoCalls/VideoCallOverlay.js +38 -14
- package/lib/commonjs/components/VideoCalls/VideoCallOverlay.js.map +1 -1
- package/lib/commonjs/components/VideoCalls/VideoCallSession.js +57 -128
- package/lib/commonjs/components/VideoCalls/VideoCallSession.js.map +1 -1
- package/lib/commonjs/components/VideoCalls/callActions.js +3 -0
- package/lib/commonjs/components/VideoCalls/callActions.js.map +1 -1
- package/lib/commonjs/components/VideoCalls/callElapsed.js +38 -0
- package/lib/commonjs/components/VideoCalls/callElapsed.js.map +1 -0
- package/lib/commonjs/components/VideoCalls/callLive.js +15 -0
- package/lib/commonjs/components/VideoCalls/callLive.js.map +1 -0
- package/lib/commonjs/components/VideoCalls/callSessionController.js +81 -24
- package/lib/commonjs/components/VideoCalls/callSessionController.js.map +1 -1
- package/lib/commonjs/components/VideoCalls/callSessionTypes.js +41 -0
- package/lib/commonjs/components/VideoCalls/callSessionTypes.js.map +1 -0
- package/lib/commonjs/components/VideoCalls/groupLayout.js +43 -0
- package/lib/commonjs/components/VideoCalls/groupLayout.js.map +1 -0
- package/lib/commonjs/components/VideoCalls/p2pCallSession.js +272 -0
- package/lib/commonjs/components/VideoCalls/p2pCallSession.js.map +1 -0
- package/lib/commonjs/components/VideoCalls/useCallKeep.js +7 -2
- package/lib/commonjs/components/VideoCalls/useCallKeep.js.map +1 -1
- package/lib/commonjs/components/VideoCalls/useOngoingCallNotification.js +2 -1
- package/lib/commonjs/components/VideoCalls/useOngoingCallNotification.js.map +1 -1
- package/lib/commonjs/components/styled/MessageImage.js +4 -1
- package/lib/commonjs/components/styled/MessageImage.js.map +1 -1
- package/lib/commonjs/components/styled/VideoMessage.js +5 -1
- package/lib/commonjs/components/styled/VideoMessage.js.map +1 -1
- package/lib/commonjs/context/MediaSourceContext.js +18 -0
- package/lib/commonjs/context/MediaSourceContext.js.map +1 -0
- package/lib/commonjs/context/xmppProvider.js +2 -1
- package/lib/commonjs/context/xmppProvider.js.map +1 -1
- package/lib/commonjs/helpers/callPush.js +3 -1
- package/lib/commonjs/helpers/callPush.js.map +1 -1
- package/lib/commonjs/helpers/constants/MODAL_COMPONENTS.js +3 -1
- package/lib/commonjs/helpers/constants/MODAL_COMPONENTS.js.map +1 -1
- package/lib/commonjs/helpers/constants/MODAL_TYPES.js +2 -0
- package/lib/commonjs/helpers/constants/MODAL_TYPES.js.map +1 -1
- package/lib/commonjs/helpers/incomingCallFromPush.js +63 -7
- package/lib/commonjs/helpers/incomingCallFromPush.js.map +1 -1
- package/lib/commonjs/helpers/publicChatsEntry.js +8 -6
- package/lib/commonjs/helpers/publicChatsEntry.js.map +1 -1
- package/lib/commonjs/helpers/pushPayload.js +5 -0
- package/lib/commonjs/helpers/pushPayload.js.map +1 -1
- package/lib/commonjs/helpers/reportRoom.js +76 -0
- package/lib/commonjs/helpers/reportRoom.js.map +1 -0
- package/lib/commonjs/helpers/roomMedia.js +118 -0
- package/lib/commonjs/helpers/roomMedia.js.map +1 -0
- package/lib/commonjs/i18n/strings.js +480 -0
- package/lib/commonjs/i18n/strings.js.map +1 -1
- package/lib/commonjs/main.js +93 -0
- package/lib/commonjs/main.js.map +1 -1
- package/lib/commonjs/networking/api-requests/callState.api.js +75 -0
- package/lib/commonjs/networking/api-requests/callState.api.js.map +1 -0
- package/lib/commonjs/networking/api-requests/push.api.js +29 -6
- package/lib/commonjs/networking/api-requests/push.api.js.map +1 -1
- package/lib/commonjs/networking/api-requests/rooms.api.js +17 -15
- package/lib/commonjs/networking/api-requests/rooms.api.js.map +1 -1
- package/lib/commonjs/networking/api-requests/scheduledCalls.api.js +141 -0
- package/lib/commonjs/networking/api-requests/scheduledCalls.api.js.map +1 -0
- package/lib/commonjs/networking/callTokenStanza.js +210 -50
- package/lib/commonjs/networking/callTokenStanza.js.map +1 -1
- package/lib/commonjs/roomStore/callSlice.js +59 -4
- package/lib/commonjs/roomStore/callSlice.js.map +1 -1
- package/lib/commonjs/services/appBadge.js +80 -0
- package/lib/commonjs/services/appBadge.js.map +1 -0
- package/lib/commonjs/services/languageSettings.js +47 -15
- package/lib/commonjs/services/languageSettings.js.map +1 -1
- package/lib/commonjs/services/pushRegistration.js +21 -5
- package/lib/commonjs/services/pushRegistration.js.map +1 -1
- package/lib/commonjs/version.js +1 -1
- package/lib/commonjs/version.js.map +1 -1
- package/lib/module/booking/index.js +5 -0
- package/lib/module/booking/index.js.map +1 -0
- package/lib/module/booking/pendingScheduledCall.js +261 -0
- package/lib/module/booking/pendingScheduledCall.js.map +1 -0
- package/lib/module/booking/scheduleForm.js +79 -0
- package/lib/module/booking/scheduleForm.js.map +1 -0
- package/lib/module/booking/scheduledCall.js +129 -0
- package/lib/module/booking/scheduledCall.js.map +1 -0
- package/lib/module/booking/scheduledCallActions.js +118 -0
- package/lib/module/booking/scheduledCallActions.js.map +1 -0
- package/lib/module/booking/scheduledCallLink.js +136 -0
- package/lib/module/booking/scheduledCallLink.js.map +1 -0
- package/lib/module/booking/scheduledCallStore.js +60 -0
- package/lib/module/booking/scheduledCallStore.js.map +1 -0
- package/lib/module/booking/startRoomCall.js +80 -0
- package/lib/module/booking/startRoomCall.js.map +1 -0
- package/lib/module/calls/callBusy.js +13 -0
- package/lib/module/calls/callBusy.js.map +1 -0
- package/lib/module/calls/callDisplay.js +65 -0
- package/lib/module/calls/callDisplay.js.map +1 -0
- package/lib/module/calls/callMode.js +168 -0
- package/lib/module/calls/callMode.js.map +1 -0
- package/lib/module/calls/declineReport.js +16 -0
- package/lib/module/calls/declineReport.js.map +1 -0
- package/lib/module/calls/p2p/P2PCallController.js +718 -0
- package/lib/module/calls/p2p/P2PCallController.js.map +1 -0
- package/lib/module/calls/p2p/icePolicy.js +102 -0
- package/lib/module/calls/p2p/icePolicy.js.map +1 -0
- package/lib/module/calls/p2p/negotiator.js +197 -0
- package/lib/module/calls/p2p/negotiator.js.map +1 -0
- package/lib/module/calls/p2p/p2pRuntime.js +137 -0
- package/lib/module/calls/p2p/p2pRuntime.js.map +1 -0
- package/lib/module/calls/p2p/signalInbox.js +93 -0
- package/lib/module/calls/p2p/signalInbox.js.map +1 -0
- package/lib/module/calls/p2p/signalStanza.js +135 -0
- package/lib/module/calls/p2p/signalStanza.js.map +1 -0
- package/lib/module/calls/p2p/webrtcRuntime.js +46 -0
- package/lib/module/calls/p2p/webrtcRuntime.js.map +1 -0
- package/lib/module/calls/senderTrust.js +38 -0
- package/lib/module/calls/senderTrust.js.map +1 -0
- package/lib/module/calls/startCall.js +47 -0
- package/lib/module/calls/startCall.js.map +1 -0
- package/lib/module/components/Booking/BookingIcons.js +48 -0
- package/lib/module/components/Booking/BookingIcons.js.map +1 -0
- package/lib/module/components/Booking/ScheduleCallButton.js +59 -0
- package/lib/module/components/Booking/ScheduleCallButton.js.map +1 -0
- package/lib/module/components/Booking/ScheduleCallSheet.js +345 -0
- package/lib/module/components/Booking/ScheduleCallSheet.js.map +1 -0
- package/lib/module/components/Booking/ScheduledCallCard.js +197 -0
- package/lib/module/components/Booking/ScheduledCallCard.js.map +1 -0
- package/lib/module/components/Booking/ScheduledCallHost.js +18 -0
- package/lib/module/components/Booking/ScheduledCallHost.js.map +1 -0
- package/lib/module/components/Booking/ScheduledCallMessage.js +48 -0
- package/lib/module/components/Booking/ScheduledCallMessage.js.map +1 -0
- package/lib/module/components/Booking/ScheduledCallPreJoin.js +229 -0
- package/lib/module/components/Booking/ScheduledCallPreJoin.js.map +1 -0
- package/lib/module/components/Booking/bookingShared.js +291 -0
- package/lib/module/components/Booking/bookingShared.js.map +1 -0
- package/lib/module/components/MainComponents/AlbumGrid.js +6 -2
- package/lib/module/components/MainComponents/AlbumGrid.js.map +1 -1
- package/lib/module/components/MainComponents/ChatHeader.js +20 -14
- package/lib/module/components/MainComponents/ChatHeader.js.map +1 -1
- package/lib/module/components/MainComponents/LanguageSelectorButton.js +5 -2
- package/lib/module/components/MainComponents/LanguageSelectorButton.js.map +1 -1
- package/lib/module/components/MainComponents/LanguageSelectorModal.js +7 -4
- package/lib/module/components/MainComponents/LanguageSelectorModal.js.map +1 -1
- package/lib/module/components/MainComponents/MediaMessage.js +13 -0
- package/lib/module/components/MainComponents/MediaMessage.js.map +1 -1
- package/lib/module/components/MainComponents/MessageContainer.js +13 -0
- package/lib/module/components/MainComponents/MessageContainer.js.map +1 -1
- package/lib/module/components/MainComponents/ReduxWrapper.js +10 -0
- package/lib/module/components/MainComponents/ReduxWrapper.js.map +1 -1
- package/lib/module/components/MainComponents/RoomList.js +7 -16
- package/lib/module/components/MainComponents/RoomList.js.map +1 -1
- package/lib/module/components/MessageBubble/Message.js +27 -1
- package/lib/module/components/MessageBubble/Message.js.map +1 -1
- package/lib/module/components/Modals/ChatProfileModal/ChatMediaGrid.js +154 -0
- package/lib/module/components/Modals/ChatProfileModal/ChatMediaGrid.js.map +1 -0
- package/lib/module/components/Modals/ChatProfileModal/ChatProfileModal.js +204 -136
- package/lib/module/components/Modals/ChatProfileModal/ChatProfileModal.js.map +1 -1
- package/lib/module/components/Modals/ChatProfileModal/LeaveChatModal.js +175 -0
- package/lib/module/components/Modals/ChatProfileModal/LeaveChatModal.js.map +1 -0
- package/lib/module/components/Modals/ChatProfileModal/ReportChatModal.js +21 -15
- package/lib/module/components/Modals/ChatProfileModal/ReportChatModal.js.map +1 -1
- package/lib/module/components/Modals/FilePreviewModal/FilePreviewModal.js +100 -163
- package/lib/module/components/Modals/FilePreviewModal/FilePreviewModal.js.map +1 -1
- package/lib/module/components/Modals/FilePreviewModal/MediaViewer.js +819 -0
- package/lib/module/components/Modals/FilePreviewModal/MediaViewer.js.map +1 -0
- package/lib/module/components/Modals/FilePreviewModal/useSaveFile.js +172 -0
- package/lib/module/components/Modals/FilePreviewModal/useSaveFile.js.map +1 -0
- package/lib/module/components/Modals/MessageSearchModal/MessageSearchModal.js +20 -4
- package/lib/module/components/Modals/MessageSearchModal/MessageSearchModal.js.map +1 -1
- package/lib/module/components/Modals/UserProfileModal/UserProfileModal.js +17 -10
- package/lib/module/components/Modals/UserProfileModal/UserProfileModal.js.map +1 -1
- package/lib/module/components/Modals/UserSettingsModal/LanguageCard.js +1 -1
- package/lib/module/components/Modals/UserSettingsModal/LanguageCard.js.map +1 -1
- package/lib/module/components/VideoCalls/ActiveCallBar.js +3 -2
- package/lib/module/components/VideoCalls/ActiveCallBar.js.map +1 -1
- package/lib/module/components/VideoCalls/CallButtons.js +19 -11
- package/lib/module/components/VideoCalls/CallButtons.js.map +1 -1
- package/lib/module/components/VideoCalls/CallControlBar.js +113 -0
- package/lib/module/components/VideoCalls/CallControlBar.js.map +1 -0
- package/lib/module/components/VideoCalls/CallVideo.js +43 -0
- package/lib/module/components/VideoCalls/CallVideo.js.map +1 -0
- package/lib/module/components/VideoCalls/GroupCallView.js +275 -0
- package/lib/module/components/VideoCalls/GroupCallView.js.map +1 -0
- package/lib/module/components/VideoCalls/P2PCallRunner.js +147 -0
- package/lib/module/components/VideoCalls/P2PCallRunner.js.map +1 -0
- package/lib/module/components/VideoCalls/VideoCallOverlay.js +38 -14
- package/lib/module/components/VideoCalls/VideoCallOverlay.js.map +1 -1
- package/lib/module/components/VideoCalls/VideoCallSession.js +46 -127
- package/lib/module/components/VideoCalls/VideoCallSession.js.map +1 -1
- package/lib/module/components/VideoCalls/callActions.js +3 -0
- package/lib/module/components/VideoCalls/callActions.js.map +1 -1
- package/lib/module/components/VideoCalls/callElapsed.js +33 -0
- package/lib/module/components/VideoCalls/callElapsed.js.map +1 -0
- package/lib/module/components/VideoCalls/callLive.js +10 -0
- package/lib/module/components/VideoCalls/callLive.js.map +1 -0
- package/lib/module/components/VideoCalls/callSessionController.js +80 -24
- package/lib/module/components/VideoCalls/callSessionController.js.map +1 -1
- package/lib/module/components/VideoCalls/callSessionTypes.js +37 -0
- package/lib/module/components/VideoCalls/callSessionTypes.js.map +1 -0
- package/lib/module/components/VideoCalls/groupLayout.js +36 -0
- package/lib/module/components/VideoCalls/groupLayout.js.map +1 -0
- package/lib/module/components/VideoCalls/p2pCallSession.js +256 -0
- package/lib/module/components/VideoCalls/p2pCallSession.js.map +1 -0
- package/lib/module/components/VideoCalls/useCallKeep.js +8 -2
- package/lib/module/components/VideoCalls/useCallKeep.js.map +1 -1
- package/lib/module/components/VideoCalls/useOngoingCallNotification.js +2 -1
- package/lib/module/components/VideoCalls/useOngoingCallNotification.js.map +1 -1
- package/lib/module/components/styled/MessageImage.js +4 -1
- package/lib/module/components/styled/MessageImage.js.map +1 -1
- package/lib/module/components/styled/VideoMessage.js +5 -1
- package/lib/module/components/styled/VideoMessage.js.map +1 -1
- package/lib/module/context/MediaSourceContext.js +13 -0
- package/lib/module/context/MediaSourceContext.js.map +1 -0
- package/lib/module/context/xmppProvider.js +2 -1
- package/lib/module/context/xmppProvider.js.map +1 -1
- package/lib/module/helpers/callPush.js +3 -1
- package/lib/module/helpers/callPush.js.map +1 -1
- package/lib/module/helpers/constants/MODAL_COMPONENTS.js +2 -1
- package/lib/module/helpers/constants/MODAL_COMPONENTS.js.map +1 -1
- package/lib/module/helpers/constants/MODAL_TYPES.js +2 -0
- package/lib/module/helpers/constants/MODAL_TYPES.js.map +1 -1
- package/lib/module/helpers/incomingCallFromPush.js +63 -7
- package/lib/module/helpers/incomingCallFromPush.js.map +1 -1
- package/lib/module/helpers/publicChatsEntry.js +8 -6
- package/lib/module/helpers/publicChatsEntry.js.map +1 -1
- package/lib/module/helpers/pushPayload.js +5 -0
- package/lib/module/helpers/pushPayload.js.map +1 -1
- package/lib/module/helpers/reportRoom.js +70 -0
- package/lib/module/helpers/reportRoom.js.map +1 -0
- package/lib/module/helpers/roomMedia.js +112 -0
- package/lib/module/helpers/roomMedia.js.map +1 -0
- package/lib/module/i18n/strings.js +480 -0
- package/lib/module/i18n/strings.js.map +1 -1
- package/lib/module/main.js +5 -0
- package/lib/module/main.js.map +1 -1
- package/lib/module/networking/api-requests/callState.api.js +66 -0
- package/lib/module/networking/api-requests/callState.api.js.map +1 -0
- package/lib/module/networking/api-requests/push.api.js +29 -6
- package/lib/module/networking/api-requests/push.api.js.map +1 -1
- package/lib/module/networking/api-requests/rooms.api.js +17 -15
- package/lib/module/networking/api-requests/rooms.api.js.map +1 -1
- package/lib/module/networking/api-requests/scheduledCalls.api.js +130 -0
- package/lib/module/networking/api-requests/scheduledCalls.api.js.map +1 -0
- package/lib/module/networking/callTokenStanza.js +210 -50
- package/lib/module/networking/callTokenStanza.js.map +1 -1
- package/lib/module/roomStore/callSlice.js +57 -3
- package/lib/module/roomStore/callSlice.js.map +1 -1
- package/lib/module/services/appBadge.js +74 -0
- package/lib/module/services/appBadge.js.map +1 -0
- package/lib/module/services/languageSettings.js +44 -13
- package/lib/module/services/languageSettings.js.map +1 -1
- package/lib/module/services/pushRegistration.js +21 -5
- package/lib/module/services/pushRegistration.js.map +1 -1
- package/lib/module/version.js +1 -1
- package/lib/module/version.js.map +1 -1
- package/lib/typescript/booking/index.d.ts +3 -0
- package/lib/typescript/booking/index.d.ts.map +1 -0
- package/lib/typescript/booking/pendingScheduledCall.d.ts +80 -0
- package/lib/typescript/booking/pendingScheduledCall.d.ts.map +1 -0
- package/lib/typescript/booking/scheduleForm.d.ts +28 -0
- package/lib/typescript/booking/scheduleForm.d.ts.map +1 -0
- package/lib/typescript/booking/scheduledCall.d.ts +52 -0
- package/lib/typescript/booking/scheduledCall.d.ts.map +1 -0
- package/lib/typescript/booking/scheduledCallActions.d.ts +22 -0
- package/lib/typescript/booking/scheduledCallActions.d.ts.map +1 -0
- package/lib/typescript/booking/scheduledCallLink.d.ts +37 -0
- package/lib/typescript/booking/scheduledCallLink.d.ts.map +1 -0
- package/lib/typescript/booking/scheduledCallStore.d.ts +47 -0
- package/lib/typescript/booking/scheduledCallStore.d.ts.map +1 -0
- package/lib/typescript/booking/startRoomCall.d.ts +12 -0
- package/lib/typescript/booking/startRoomCall.d.ts.map +1 -0
- package/lib/typescript/calls/callBusy.d.ts +9 -0
- package/lib/typescript/calls/callBusy.d.ts.map +1 -0
- package/lib/typescript/calls/callDisplay.d.ts +23 -0
- package/lib/typescript/calls/callDisplay.d.ts.map +1 -0
- package/lib/typescript/calls/callMode.d.ts +106 -0
- package/lib/typescript/calls/callMode.d.ts.map +1 -0
- package/lib/typescript/calls/declineReport.d.ts +11 -0
- package/lib/typescript/calls/declineReport.d.ts.map +1 -0
- package/lib/typescript/calls/p2p/P2PCallController.d.ts +150 -0
- package/lib/typescript/calls/p2p/P2PCallController.d.ts.map +1 -0
- package/lib/typescript/calls/p2p/icePolicy.d.ts +37 -0
- package/lib/typescript/calls/p2p/icePolicy.d.ts.map +1 -0
- package/lib/typescript/calls/p2p/negotiator.d.ts +57 -0
- package/lib/typescript/calls/p2p/negotiator.d.ts.map +1 -0
- package/lib/typescript/calls/p2p/p2pRuntime.d.ts +41 -0
- package/lib/typescript/calls/p2p/p2pRuntime.d.ts.map +1 -0
- package/lib/typescript/calls/p2p/signalInbox.d.ts +35 -0
- package/lib/typescript/calls/p2p/signalInbox.d.ts.map +1 -0
- package/lib/typescript/calls/p2p/signalStanza.d.ts +52 -0
- package/lib/typescript/calls/p2p/signalStanza.d.ts.map +1 -0
- package/lib/typescript/calls/p2p/webrtcRuntime.d.ts +32 -0
- package/lib/typescript/calls/p2p/webrtcRuntime.d.ts.map +1 -0
- package/lib/typescript/calls/senderTrust.d.ts +8 -0
- package/lib/typescript/calls/senderTrust.d.ts.map +1 -0
- package/lib/typescript/calls/startCall.d.ts +17 -0
- package/lib/typescript/calls/startCall.d.ts.map +1 -0
- package/lib/typescript/components/Booking/BookingIcons.d.ts +9 -0
- package/lib/typescript/components/Booking/BookingIcons.d.ts.map +1 -0
- package/lib/typescript/components/Booking/ScheduleCallButton.d.ts +11 -0
- package/lib/typescript/components/Booking/ScheduleCallButton.d.ts.map +1 -0
- package/lib/typescript/components/Booking/ScheduleCallSheet.d.ts +4 -0
- package/lib/typescript/components/Booking/ScheduleCallSheet.d.ts.map +1 -0
- package/lib/typescript/components/Booking/ScheduledCallCard.d.ts +14 -0
- package/lib/typescript/components/Booking/ScheduledCallCard.d.ts.map +1 -0
- package/lib/typescript/components/Booking/ScheduledCallHost.d.ts +10 -0
- package/lib/typescript/components/Booking/ScheduledCallHost.d.ts.map +1 -0
- package/lib/typescript/components/Booking/ScheduledCallMessage.d.ts +20 -0
- package/lib/typescript/components/Booking/ScheduledCallMessage.d.ts.map +1 -0
- package/lib/typescript/components/Booking/ScheduledCallPreJoin.d.ts +8 -0
- package/lib/typescript/components/Booking/ScheduledCallPreJoin.d.ts.map +1 -0
- package/lib/typescript/components/Booking/bookingShared.d.ts +199 -0
- package/lib/typescript/components/Booking/bookingShared.d.ts.map +1 -0
- package/lib/typescript/components/MainComponents/AlbumGrid.d.ts.map +1 -1
- package/lib/typescript/components/MainComponents/ChatHeader.d.ts.map +1 -1
- package/lib/typescript/components/MainComponents/LanguageSelectorButton.d.ts +3 -1
- package/lib/typescript/components/MainComponents/LanguageSelectorButton.d.ts.map +1 -1
- package/lib/typescript/components/MainComponents/LanguageSelectorModal.d.ts.map +1 -1
- package/lib/typescript/components/MainComponents/MediaMessage.d.ts +3 -1
- package/lib/typescript/components/MainComponents/MediaMessage.d.ts.map +1 -1
- package/lib/typescript/components/MainComponents/MessageContainer.d.ts.map +1 -1
- package/lib/typescript/components/MainComponents/ReduxWrapper.d.ts.map +1 -1
- package/lib/typescript/components/MainComponents/RoomList.d.ts.map +1 -1
- package/lib/typescript/components/MessageBubble/Message.d.ts.map +1 -1
- package/lib/typescript/components/Modals/ChatProfileModal/ChatMediaGrid.d.ts +16 -0
- package/lib/typescript/components/Modals/ChatProfileModal/ChatMediaGrid.d.ts.map +1 -0
- package/lib/typescript/components/Modals/ChatProfileModal/ChatProfileModal.d.ts.map +1 -1
- package/lib/typescript/components/Modals/ChatProfileModal/LeaveChatModal.d.ts +18 -0
- package/lib/typescript/components/Modals/ChatProfileModal/LeaveChatModal.d.ts.map +1 -0
- package/lib/typescript/components/Modals/ChatProfileModal/ReportChatModal.d.ts.map +1 -1
- package/lib/typescript/components/Modals/FilePreviewModal/FilePreviewModal.d.ts +16 -0
- package/lib/typescript/components/Modals/FilePreviewModal/FilePreviewModal.d.ts.map +1 -1
- package/lib/typescript/components/Modals/FilePreviewModal/MediaViewer.d.ts +27 -0
- package/lib/typescript/components/Modals/FilePreviewModal/MediaViewer.d.ts.map +1 -0
- package/lib/typescript/components/Modals/FilePreviewModal/useSaveFile.d.ts +9 -0
- package/lib/typescript/components/Modals/FilePreviewModal/useSaveFile.d.ts.map +1 -0
- package/lib/typescript/components/Modals/MessageSearchModal/MessageSearchModal.d.ts +8 -0
- package/lib/typescript/components/Modals/MessageSearchModal/MessageSearchModal.d.ts.map +1 -1
- package/lib/typescript/components/Modals/UserProfileModal/UserProfileModal.d.ts.map +1 -1
- package/lib/typescript/components/Modals/UserSettingsModal/LanguageCard.d.ts.map +1 -1
- package/lib/typescript/components/VideoCalls/ActiveCallBar.d.ts.map +1 -1
- package/lib/typescript/components/VideoCalls/CallButtons.d.ts +2 -1
- package/lib/typescript/components/VideoCalls/CallButtons.d.ts.map +1 -1
- package/lib/typescript/components/VideoCalls/CallControlBar.d.ts +17 -0
- package/lib/typescript/components/VideoCalls/CallControlBar.d.ts.map +1 -0
- package/lib/typescript/components/VideoCalls/CallVideo.d.ts +23 -0
- package/lib/typescript/components/VideoCalls/CallVideo.d.ts.map +1 -0
- package/lib/typescript/components/VideoCalls/GroupCallView.d.ts +22 -0
- package/lib/typescript/components/VideoCalls/GroupCallView.d.ts.map +1 -0
- package/lib/typescript/components/VideoCalls/P2PCallRunner.d.ts +2 -0
- package/lib/typescript/components/VideoCalls/P2PCallRunner.d.ts.map +1 -0
- package/lib/typescript/components/VideoCalls/VideoCallOverlay.d.ts.map +1 -1
- package/lib/typescript/components/VideoCalls/VideoCallSession.d.ts +10 -12
- package/lib/typescript/components/VideoCalls/VideoCallSession.d.ts.map +1 -1
- package/lib/typescript/components/VideoCalls/callActions.d.ts.map +1 -1
- package/lib/typescript/components/VideoCalls/callElapsed.d.ts +8 -0
- package/lib/typescript/components/VideoCalls/callElapsed.d.ts.map +1 -0
- package/lib/typescript/components/VideoCalls/callLive.d.ts +9 -0
- package/lib/typescript/components/VideoCalls/callLive.d.ts.map +1 -0
- package/lib/typescript/components/VideoCalls/callSessionController.d.ts +10 -31
- package/lib/typescript/components/VideoCalls/callSessionController.d.ts.map +1 -1
- package/lib/typescript/components/VideoCalls/callSessionTypes.d.ts +60 -0
- package/lib/typescript/components/VideoCalls/callSessionTypes.d.ts.map +1 -0
- package/lib/typescript/components/VideoCalls/groupLayout.d.ts +23 -0
- package/lib/typescript/components/VideoCalls/groupLayout.d.ts.map +1 -0
- package/lib/typescript/components/VideoCalls/p2pCallSession.d.ts +31 -0
- package/lib/typescript/components/VideoCalls/p2pCallSession.d.ts.map +1 -0
- package/lib/typescript/components/VideoCalls/useCallKeep.d.ts.map +1 -1
- package/lib/typescript/components/VideoCalls/useOngoingCallNotification.d.ts.map +1 -1
- package/lib/typescript/components/styled/MessageImage.d.ts.map +1 -1
- package/lib/typescript/components/styled/VideoMessage.d.ts.map +1 -1
- package/lib/typescript/context/MediaSourceContext.d.ts +4 -0
- package/lib/typescript/context/MediaSourceContext.d.ts.map +1 -0
- package/lib/typescript/context/xmppProvider.d.ts.map +1 -1
- package/lib/typescript/helpers/callPush.d.ts +11 -1
- package/lib/typescript/helpers/callPush.d.ts.map +1 -1
- package/lib/typescript/helpers/constants/MODAL_COMPONENTS.d.ts.map +1 -1
- package/lib/typescript/helpers/constants/MODAL_TYPES.d.ts +2 -0
- package/lib/typescript/helpers/constants/MODAL_TYPES.d.ts.map +1 -1
- package/lib/typescript/helpers/incomingCallFromPush.d.ts.map +1 -1
- package/lib/typescript/helpers/publicChatsEntry.d.ts +7 -5
- package/lib/typescript/helpers/publicChatsEntry.d.ts.map +1 -1
- package/lib/typescript/helpers/pushPayload.d.ts +1 -1
- package/lib/typescript/helpers/pushPayload.d.ts.map +1 -1
- package/lib/typescript/helpers/reportRoom.d.ts +19 -0
- package/lib/typescript/helpers/reportRoom.d.ts.map +1 -0
- package/lib/typescript/helpers/roomMedia.d.ts +26 -0
- package/lib/typescript/helpers/roomMedia.d.ts.map +1 -0
- package/lib/typescript/i18n/strings.d.ts.map +1 -1
- package/lib/typescript/main.d.ts +6 -1
- package/lib/typescript/main.d.ts.map +1 -1
- package/lib/typescript/networking/api-requests/callState.api.d.ts +25 -0
- package/lib/typescript/networking/api-requests/callState.api.d.ts.map +1 -0
- package/lib/typescript/networking/api-requests/push.api.d.ts +9 -2
- package/lib/typescript/networking/api-requests/push.api.d.ts.map +1 -1
- package/lib/typescript/networking/api-requests/rooms.api.d.ts +8 -6
- package/lib/typescript/networking/api-requests/rooms.api.d.ts.map +1 -1
- package/lib/typescript/networking/api-requests/scheduledCalls.api.d.ts +86 -0
- package/lib/typescript/networking/api-requests/scheduledCalls.api.d.ts.map +1 -0
- package/lib/typescript/networking/callTokenStanza.d.ts.map +1 -1
- package/lib/typescript/roomStore/callSlice.d.ts +23 -1
- package/lib/typescript/roomStore/callSlice.d.ts.map +1 -1
- package/lib/typescript/services/appBadge.d.ts +3 -0
- package/lib/typescript/services/appBadge.d.ts.map +1 -0
- package/lib/typescript/services/languageSettings.d.ts +7 -0
- package/lib/typescript/services/languageSettings.d.ts.map +1 -1
- package/lib/typescript/services/pushRegistration.d.ts.map +1 -1
- package/lib/typescript/types/models/modal.model.d.ts +18 -0
- package/lib/typescript/types/models/modal.model.d.ts.map +1 -1
- package/lib/typescript/types/types.d.ts +85 -4
- package/lib/typescript/types/types.d.ts.map +1 -1
- package/lib/typescript/version.d.ts +1 -1
- package/lib/typescript/version.d.ts.map +1 -1
- package/package.json +9 -2
- package/src/booking/index.ts +10 -0
- package/src/booking/pendingScheduledCall.ts +272 -0
- package/src/booking/scheduleForm.ts +84 -0
- package/src/booking/scheduledCall.ts +163 -0
- package/src/booking/scheduledCallActions.ts +141 -0
- package/src/booking/scheduledCallLink.ts +145 -0
- package/src/booking/scheduledCallStore.ts +69 -0
- package/src/booking/startRoomCall.ts +103 -0
- package/src/calls/callBusy.ts +10 -0
- package/src/calls/callDisplay.ts +74 -0
- package/src/calls/callMode.ts +286 -0
- package/src/calls/declineReport.ts +16 -0
- package/src/calls/p2p/P2PCallController.ts +813 -0
- package/src/calls/p2p/icePolicy.ts +99 -0
- package/src/calls/p2p/negotiator.ts +186 -0
- package/src/calls/p2p/p2pRuntime.ts +164 -0
- package/src/calls/p2p/signalInbox.ts +117 -0
- package/src/calls/p2p/signalStanza.ts +205 -0
- package/src/calls/p2p/webrtcRuntime.ts +60 -0
- package/src/calls/senderTrust.ts +40 -0
- package/src/calls/startCall.ts +56 -0
- package/src/components/Booking/BookingIcons.tsx +44 -0
- package/src/components/Booking/ScheduleCallButton.tsx +66 -0
- package/src/components/Booking/ScheduleCallSheet.tsx +380 -0
- package/src/components/Booking/ScheduledCallCard.tsx +216 -0
- package/src/components/Booking/ScheduledCallHost.tsx +18 -0
- package/src/components/Booking/ScheduledCallMessage.tsx +62 -0
- package/src/components/Booking/ScheduledCallPreJoin.tsx +230 -0
- package/src/components/Booking/bookingShared.tsx +295 -0
- package/src/components/MainComponents/AlbumGrid.tsx +5 -1
- package/src/components/MainComponents/ChatHeader.tsx +18 -11
- package/src/components/MainComponents/LanguageSelectorButton.tsx +9 -2
- package/src/components/MainComponents/LanguageSelectorModal.tsx +10 -6
- package/src/components/MainComponents/MediaMessage.tsx +13 -2
- package/src/components/MainComponents/MessageContainer.tsx +15 -0
- package/src/components/MainComponents/ReduxWrapper.tsx +10 -0
- package/src/components/MainComponents/RoomList.tsx +8 -19
- package/src/components/MessageBubble/Message.tsx +24 -1
- package/src/components/Modals/ChatProfileModal/ChatMediaGrid.tsx +174 -0
- package/src/components/Modals/ChatProfileModal/ChatProfileModal.tsx +119 -48
- package/src/components/Modals/ChatProfileModal/LeaveChatModal.tsx +191 -0
- package/src/components/Modals/ChatProfileModal/ReportChatModal.tsx +22 -22
- package/src/components/Modals/FilePreviewModal/FilePreviewModal.tsx +115 -185
- package/src/components/Modals/FilePreviewModal/MediaViewer.tsx +880 -0
- package/src/components/Modals/FilePreviewModal/useSaveFile.ts +207 -0
- package/src/components/Modals/MessageSearchModal/MessageSearchModal.tsx +56 -30
- package/src/components/Modals/UserProfileModal/UserProfileModal.tsx +28 -9
- package/src/components/Modals/UserSettingsModal/LanguageCard.tsx +9 -7
- package/src/components/VideoCalls/ActiveCallBar.tsx +6 -5
- package/src/components/VideoCalls/CallButtons.tsx +23 -12
- package/src/components/VideoCalls/CallControlBar.tsx +131 -0
- package/src/components/VideoCalls/CallVideo.tsx +59 -0
- package/src/components/VideoCalls/GroupCallView.tsx +324 -0
- package/src/components/VideoCalls/P2PCallRunner.tsx +192 -0
- package/src/components/VideoCalls/VideoCallOverlay.tsx +62 -17
- package/src/components/VideoCalls/VideoCallSession.tsx +55 -133
- package/src/components/VideoCalls/callActions.ts +3 -0
- package/src/components/VideoCalls/callElapsed.ts +27 -0
- package/src/components/VideoCalls/callLive.ts +13 -0
- package/src/components/VideoCalls/callSessionController.ts +130 -55
- package/src/components/VideoCalls/callSessionTypes.ts +80 -0
- package/src/components/VideoCalls/groupLayout.ts +48 -0
- package/src/components/VideoCalls/p2pCallSession.ts +291 -0
- package/src/components/VideoCalls/useCallKeep.ts +9 -2
- package/src/components/VideoCalls/useOngoingCallNotification.ts +2 -2
- package/src/components/styled/MessageImage.tsx +3 -1
- package/src/components/styled/VideoMessage.tsx +5 -1
- package/src/context/MediaSourceContext.tsx +14 -0
- package/src/context/xmppProvider.tsx +3 -0
- package/src/helpers/callPush.ts +13 -1
- package/src/helpers/constants/MODAL_COMPONENTS.tsx +4 -1
- package/src/helpers/constants/MODAL_TYPES.ts +2 -0
- package/src/helpers/incomingCallFromPush.ts +65 -7
- package/src/helpers/publicChatsEntry.ts +8 -7
- package/src/helpers/pushPayload.ts +9 -1
- package/src/helpers/reportRoom.ts +93 -0
- package/src/helpers/roomMedia.ts +126 -0
- package/src/i18n/strings.ts +480 -0
- package/src/main.ts +33 -0
- package/src/networking/api-requests/callState.api.ts +83 -0
- package/src/networking/api-requests/push.api.ts +28 -3
- package/src/networking/api-requests/rooms.api.ts +25 -15
- package/src/networking/api-requests/scheduledCalls.api.ts +232 -0
- package/src/networking/callTokenStanza.ts +247 -50
- package/src/roomStore/callSlice.ts +86 -2
- package/src/services/appBadge.ts +85 -0
- package/src/services/languageSettings.ts +43 -8
- package/src/services/pushRegistration.ts +34 -3
- package/src/types/models/modal.model.ts +16 -0
- package/src/types/types.ts +86 -4
- package/src/version.ts +1 -1
|
@@ -0,0 +1,275 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { ScrollView, StyleSheet, Text, TouchableOpacity, useWindowDimensions, View } from 'react-native';
|
|
5
|
+
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
6
|
+
import { ProfileImagePlaceholder } from '../MainComponents/ProfileImagePlaceholder';
|
|
7
|
+
import { CallVideo } from './CallVideo';
|
|
8
|
+
import { CallControlBar } from './CallControlBar';
|
|
9
|
+
import { MicOffIcon, MinimizeIcon } from './CallIcons';
|
|
10
|
+
import { dismissCallDeviceError } from './callSessionController';
|
|
11
|
+
import { gridColumns, pickVideoTiles, speakingNames } from './groupLayout';
|
|
12
|
+
import { formatCallDuration, useSharedCallElapsed } from './callElapsed';
|
|
13
|
+
import { useT } from '../../i18n/useT';
|
|
14
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
15
|
+
const SURFACE_DARK = '#0B1220';
|
|
16
|
+
const TILE_DARK = '#111827';
|
|
17
|
+
const TEXT_ON_DARK = '#FFFFFF';
|
|
18
|
+
const TEXT_MUTED = 'rgba(255, 255, 255, 0.7)';
|
|
19
|
+
const DANGER = '#E53935';
|
|
20
|
+
const GAP = 8;
|
|
21
|
+
const PAD = 12;
|
|
22
|
+
const ParticipantTile = ({
|
|
23
|
+
participant,
|
|
24
|
+
width,
|
|
25
|
+
height,
|
|
26
|
+
showVideo,
|
|
27
|
+
primaryColor,
|
|
28
|
+
youLabel,
|
|
29
|
+
fallbackName,
|
|
30
|
+
micOffLabel
|
|
31
|
+
}) => {
|
|
32
|
+
const name = participant.isLocal ? youLabel : participant.name || fallbackName;
|
|
33
|
+
return /*#__PURE__*/_jsxs(View, {
|
|
34
|
+
testID: "group-call-tile",
|
|
35
|
+
accessibilityLabel: name,
|
|
36
|
+
style: [styles.tile, {
|
|
37
|
+
width,
|
|
38
|
+
height
|
|
39
|
+
}, participant.speaking ? [styles.tileSpeaking, {
|
|
40
|
+
borderColor: primaryColor
|
|
41
|
+
}] : styles.tileIdle],
|
|
42
|
+
children: [showVideo && participant.video ? /*#__PURE__*/_jsx(CallVideo, {
|
|
43
|
+
source: participant.video,
|
|
44
|
+
style: StyleSheet.absoluteFill,
|
|
45
|
+
objectFit: "cover"
|
|
46
|
+
// Mirror our own camera like every call app.
|
|
47
|
+
,
|
|
48
|
+
mirror: participant.isLocal,
|
|
49
|
+
zOrder: 0
|
|
50
|
+
}) : /*#__PURE__*/_jsx(ProfileImagePlaceholder, {
|
|
51
|
+
name: name,
|
|
52
|
+
size: Math.max(48, Math.min(96, Math.round(width * 0.4)))
|
|
53
|
+
}), /*#__PURE__*/_jsxs(View, {
|
|
54
|
+
style: styles.nameTag,
|
|
55
|
+
children: [participant.micMuted && /*#__PURE__*/_jsx(View, {
|
|
56
|
+
accessibilityLabel: micOffLabel,
|
|
57
|
+
style: styles.micOffBadge,
|
|
58
|
+
children: /*#__PURE__*/_jsx(MicOffIcon, {
|
|
59
|
+
color: TEXT_ON_DARK,
|
|
60
|
+
size: 11
|
|
61
|
+
})
|
|
62
|
+
}), /*#__PURE__*/_jsx(Text, {
|
|
63
|
+
style: styles.nameText,
|
|
64
|
+
numberOfLines: 1,
|
|
65
|
+
children: name
|
|
66
|
+
})]
|
|
67
|
+
})]
|
|
68
|
+
});
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* The group call screen: everyone in the room as a grid of tiles, the person
|
|
73
|
+
* who is speaking outlined, a mic-off badge on anyone muted. Cameras are drawn
|
|
74
|
+
* for at most MAX_VIDEO_TILES people (speakers first). Nothing here assumes
|
|
75
|
+
* two people; the 1:1 layout stays in VideoCallSession.
|
|
76
|
+
*/
|
|
77
|
+
export const GroupCallView = ({
|
|
78
|
+
session,
|
|
79
|
+
kind,
|
|
80
|
+
title,
|
|
81
|
+
primaryColor,
|
|
82
|
+
icons,
|
|
83
|
+
onToggleMinimize,
|
|
84
|
+
onHangup
|
|
85
|
+
}) => {
|
|
86
|
+
const t = useT();
|
|
87
|
+
const insets = useSafeAreaInsets();
|
|
88
|
+
const {
|
|
89
|
+
width,
|
|
90
|
+
height
|
|
91
|
+
} = useWindowDimensions();
|
|
92
|
+
const elapsed = useSharedCallElapsed(session.anchorAt);
|
|
93
|
+
const {
|
|
94
|
+
participants,
|
|
95
|
+
deviceError,
|
|
96
|
+
connected
|
|
97
|
+
} = session;
|
|
98
|
+
const isVideo = kind === 'video';
|
|
99
|
+
const columns = gridColumns(participants.length, width > height);
|
|
100
|
+
const tileWidth = Math.floor((width - PAD * 2 - GAP * (columns - 1)) / columns);
|
|
101
|
+
const tileHeight = columns === 1 ? Math.round(tileWidth * 0.75) : Math.round(tileWidth * (isVideo ? 1.15 : 0.85));
|
|
102
|
+
const videoIds = isVideo ? pickVideoTiles(participants) : new Set();
|
|
103
|
+
const speaking = speakingNames(participants, t('call.participant.you'));
|
|
104
|
+
const countLabel = t('call.status.participants', {
|
|
105
|
+
count: participants.length
|
|
106
|
+
});
|
|
107
|
+
const status = elapsed !== null ? `${countLabel} · ${formatCallDuration(elapsed)}` : !connected ? t('call.status.connecting') : t('call.status.waitingForOthers');
|
|
108
|
+
const heading = title || (isVideo ? t('call.groupVideoCall') : t('call.groupAudioCall'));
|
|
109
|
+
return /*#__PURE__*/_jsxs(View, {
|
|
110
|
+
style: styles.canvas,
|
|
111
|
+
children: [/*#__PURE__*/_jsxs(View, {
|
|
112
|
+
style: [styles.header, {
|
|
113
|
+
paddingTop: 14 + insets.top
|
|
114
|
+
}],
|
|
115
|
+
children: [/*#__PURE__*/_jsx(Text, {
|
|
116
|
+
style: styles.headerTitle,
|
|
117
|
+
numberOfLines: 1,
|
|
118
|
+
children: heading
|
|
119
|
+
}), /*#__PURE__*/_jsx(Text, {
|
|
120
|
+
style: styles.headerStatus,
|
|
121
|
+
numberOfLines: 1,
|
|
122
|
+
children: status
|
|
123
|
+
}), speaking.length > 0 && /*#__PURE__*/_jsx(Text, {
|
|
124
|
+
style: styles.headerSpeaking,
|
|
125
|
+
numberOfLines: 1,
|
|
126
|
+
children: t('call.status.speaking', {
|
|
127
|
+
names: speaking.join(', ')
|
|
128
|
+
})
|
|
129
|
+
})]
|
|
130
|
+
}), onToggleMinimize && /*#__PURE__*/_jsx(TouchableOpacity, {
|
|
131
|
+
accessibilityRole: "button",
|
|
132
|
+
accessibilityLabel: t('call.action.minimize'),
|
|
133
|
+
onPress: onToggleMinimize,
|
|
134
|
+
style: [styles.minimizeButton, {
|
|
135
|
+
top: 12 + insets.top
|
|
136
|
+
}],
|
|
137
|
+
children: /*#__PURE__*/_jsx(MinimizeIcon, {
|
|
138
|
+
color: TEXT_ON_DARK,
|
|
139
|
+
size: 20
|
|
140
|
+
})
|
|
141
|
+
}), !!deviceError && /*#__PURE__*/_jsx(TouchableOpacity, {
|
|
142
|
+
style: styles.deviceErrorBanner,
|
|
143
|
+
onPress: dismissCallDeviceError,
|
|
144
|
+
accessibilityRole: "button",
|
|
145
|
+
children: /*#__PURE__*/_jsx(Text, {
|
|
146
|
+
style: styles.deviceErrorText,
|
|
147
|
+
numberOfLines: 2,
|
|
148
|
+
children: deviceError
|
|
149
|
+
})
|
|
150
|
+
}), /*#__PURE__*/_jsx(ScrollView, {
|
|
151
|
+
testID: "group-call-grid",
|
|
152
|
+
style: styles.scroll,
|
|
153
|
+
contentContainerStyle: styles.grid,
|
|
154
|
+
children: participants.map(participant => /*#__PURE__*/_jsx(ParticipantTile, {
|
|
155
|
+
participant: participant,
|
|
156
|
+
width: tileWidth,
|
|
157
|
+
height: tileHeight,
|
|
158
|
+
showVideo: videoIds.has(participant.identity),
|
|
159
|
+
primaryColor: primaryColor,
|
|
160
|
+
youLabel: t('call.participant.you'),
|
|
161
|
+
fallbackName: t('call.participant.default'),
|
|
162
|
+
micOffLabel: t('call.participant.micOff')
|
|
163
|
+
}, participant.identity || (participant.isLocal ? 'local' : participant.name)))
|
|
164
|
+
}), /*#__PURE__*/_jsx(CallControlBar, {
|
|
165
|
+
session: session,
|
|
166
|
+
isVideo: isVideo,
|
|
167
|
+
icons: icons,
|
|
168
|
+
onHangup: onHangup
|
|
169
|
+
})]
|
|
170
|
+
});
|
|
171
|
+
};
|
|
172
|
+
const styles = StyleSheet.create({
|
|
173
|
+
canvas: {
|
|
174
|
+
flex: 1,
|
|
175
|
+
backgroundColor: SURFACE_DARK
|
|
176
|
+
},
|
|
177
|
+
header: {
|
|
178
|
+
paddingHorizontal: 64,
|
|
179
|
+
paddingBottom: 10,
|
|
180
|
+
alignItems: 'center',
|
|
181
|
+
gap: 2
|
|
182
|
+
},
|
|
183
|
+
headerTitle: {
|
|
184
|
+
color: TEXT_ON_DARK,
|
|
185
|
+
fontSize: 16,
|
|
186
|
+
fontWeight: '600'
|
|
187
|
+
},
|
|
188
|
+
headerStatus: {
|
|
189
|
+
color: TEXT_MUTED,
|
|
190
|
+
fontSize: 13,
|
|
191
|
+
fontVariant: ['tabular-nums']
|
|
192
|
+
},
|
|
193
|
+
headerSpeaking: {
|
|
194
|
+
color: TEXT_MUTED,
|
|
195
|
+
fontSize: 12
|
|
196
|
+
},
|
|
197
|
+
minimizeButton: {
|
|
198
|
+
position: 'absolute',
|
|
199
|
+
left: 16,
|
|
200
|
+
width: 36,
|
|
201
|
+
height: 36,
|
|
202
|
+
borderRadius: 18,
|
|
203
|
+
alignItems: 'center',
|
|
204
|
+
justifyContent: 'center',
|
|
205
|
+
backgroundColor: 'rgba(255, 255, 255, 0.14)',
|
|
206
|
+
zIndex: 6
|
|
207
|
+
},
|
|
208
|
+
scroll: {
|
|
209
|
+
flex: 1
|
|
210
|
+
},
|
|
211
|
+
grid: {
|
|
212
|
+
flexDirection: 'row',
|
|
213
|
+
flexWrap: 'wrap',
|
|
214
|
+
justifyContent: 'center',
|
|
215
|
+
alignContent: 'flex-start',
|
|
216
|
+
gap: GAP,
|
|
217
|
+
paddingHorizontal: PAD,
|
|
218
|
+
paddingBottom: PAD
|
|
219
|
+
},
|
|
220
|
+
tile: {
|
|
221
|
+
borderRadius: 16,
|
|
222
|
+
overflow: 'hidden',
|
|
223
|
+
backgroundColor: TILE_DARK,
|
|
224
|
+
alignItems: 'center',
|
|
225
|
+
justifyContent: 'center'
|
|
226
|
+
},
|
|
227
|
+
tileSpeaking: {
|
|
228
|
+
borderWidth: 3
|
|
229
|
+
},
|
|
230
|
+
tileIdle: {
|
|
231
|
+
borderWidth: 1,
|
|
232
|
+
borderColor: 'rgba(255, 255, 255, 0.12)'
|
|
233
|
+
},
|
|
234
|
+
nameTag: {
|
|
235
|
+
position: 'absolute',
|
|
236
|
+
left: 8,
|
|
237
|
+
bottom: 8,
|
|
238
|
+
maxWidth: '90%',
|
|
239
|
+
flexDirection: 'row',
|
|
240
|
+
alignItems: 'center',
|
|
241
|
+
gap: 6,
|
|
242
|
+
paddingVertical: 3,
|
|
243
|
+
paddingHorizontal: 8,
|
|
244
|
+
borderRadius: 999,
|
|
245
|
+
backgroundColor: 'rgba(0, 0, 0, 0.5)'
|
|
246
|
+
},
|
|
247
|
+
nameText: {
|
|
248
|
+
color: TEXT_ON_DARK,
|
|
249
|
+
fontSize: 13,
|
|
250
|
+
flexShrink: 1
|
|
251
|
+
},
|
|
252
|
+
micOffBadge: {
|
|
253
|
+
width: 18,
|
|
254
|
+
height: 18,
|
|
255
|
+
borderRadius: 9,
|
|
256
|
+
backgroundColor: DANGER,
|
|
257
|
+
alignItems: 'center',
|
|
258
|
+
justifyContent: 'center'
|
|
259
|
+
},
|
|
260
|
+
deviceErrorBanner: {
|
|
261
|
+
marginHorizontal: 16,
|
|
262
|
+
marginBottom: 8,
|
|
263
|
+
backgroundColor: 'rgba(229, 57, 53, 0.92)',
|
|
264
|
+
borderRadius: 12,
|
|
265
|
+
paddingVertical: 10,
|
|
266
|
+
paddingHorizontal: 14
|
|
267
|
+
},
|
|
268
|
+
deviceErrorText: {
|
|
269
|
+
color: TEXT_ON_DARK,
|
|
270
|
+
fontSize: 13,
|
|
271
|
+
textAlign: 'center'
|
|
272
|
+
}
|
|
273
|
+
});
|
|
274
|
+
export default GroupCallView;
|
|
275
|
+
//# sourceMappingURL=GroupCallView.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","ScrollView","StyleSheet","Text","TouchableOpacity","useWindowDimensions","View","useSafeAreaInsets","ProfileImagePlaceholder","CallVideo","CallControlBar","MicOffIcon","MinimizeIcon","dismissCallDeviceError","gridColumns","pickVideoTiles","speakingNames","formatCallDuration","useSharedCallElapsed","useT","jsx","_jsx","jsxs","_jsxs","SURFACE_DARK","TILE_DARK","TEXT_ON_DARK","TEXT_MUTED","DANGER","GAP","PAD","ParticipantTile","participant","width","height","showVideo","primaryColor","youLabel","fallbackName","micOffLabel","name","isLocal","testID","accessibilityLabel","style","styles","tile","speaking","tileSpeaking","borderColor","tileIdle","children","video","source","absoluteFill","objectFit","mirror","zOrder","size","Math","max","min","round","nameTag","micMuted","micOffBadge","color","nameText","numberOfLines","GroupCallView","session","kind","title","icons","onToggleMinimize","onHangup","t","insets","elapsed","anchorAt","participants","deviceError","connected","isVideo","columns","length","tileWidth","floor","tileHeight","videoIds","Set","countLabel","count","status","heading","canvas","header","paddingTop","top","headerTitle","headerStatus","headerSpeaking","names","join","accessibilityRole","onPress","minimizeButton","deviceErrorBanner","deviceErrorText","scroll","contentContainerStyle","grid","map","has","identity","create","flex","backgroundColor","paddingHorizontal","paddingBottom","alignItems","gap","fontSize","fontWeight","fontVariant","position","left","borderRadius","justifyContent","zIndex","flexDirection","flexWrap","alignContent","overflow","borderWidth","bottom","maxWidth","paddingVertical","flexShrink","marginHorizontal","marginBottom","textAlign"],"sourceRoot":"../../../../src","sources":["components/VideoCalls/GroupCallView.tsx"],"mappings":";;AAAA,OAAOA,KAAK,MAAc,OAAO;AACjC,SACEC,UAAU,EACVC,UAAU,EACVC,IAAI,EACJC,gBAAgB,EAChBC,mBAAmB,EACnBC,IAAI,QACC,cAAc;AACrB,SAASC,iBAAiB,QAAQ,gCAAgC;AAElE,SAASC,uBAAuB,QAAQ,2CAA2C;AACnF,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ACRoF,WAAW,EAAE,CAAC;IACdrF,WAAW,EAAE;EACf,CAAC;EACDc,OAAO,EAAE;IACP8D,QAAQ,EAAE,UAAU;IACpBC,IAAI,EAAE,CAAC;IACPS,MAAM,EAAE,CAAC;IACTC,QAAQ,EAAE,KAAK;IACfN,aAAa,EAAE,KAAK;IACpBV,UAAU,EAAE,QAAQ;IACpBC,GAAG,EAAE,CAAC;IACNgB,eAAe,EAAE,CAAC;IAClBnB,iBAAiB,EAAE,CAAC;IACpBS,YAAY,EAAE,GAAG;IACjBV,eAAe,EAAE;EACnB,CAAC;EACDlD,QAAQ,EAAE;IACRD,KAAK,EAAExC,YAAY;IACnBgG,QAAQ,EAAE,EAAE;IACZgB,UAAU,EAAE;EACd,CAAC;EACDzE,WAAW,EAAE;IACXhC,KAAK,EAAE,EAAE;IACTC,MAAM,EAAE,EAAE;IACV6F,YAAY,EAAE,CAAC;IACfV,eAAe,EAAEzF,MAAM;IACvB4F,UAAU,EAAE,QAAQ;IACpBQ,cAAc,EAAE;EAClB,CAAC;EACDrB,iBAAiB,EAAE;IACjBgC,gBAAgB,EAAE,EAAE;IACpBC,YAAY,EAAE,CAAC;IACfvB,eAAe,EAAE,yBAAyB;IAC1CU,YAAY,EAAE,EAAE;IAChBU,eAAe,EAAE,EAAE;IACnBnB,iBAAiB,EAAE;EACrB,CAAC;EACDV,eAAe,EAAE;IACf1C,KAAK,EAAExC,YAAY;IACnBgG,QAAQ,EAAE,EAAE;IACZmB,SAAS,EAAE;EACb;AACF,CAAC,CAAC;AAEF,eAAexE,aAAa","ignoreList":[]}
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { useEffect, useRef } from 'react';
|
|
4
|
+
import { useDispatch, useSelector } from 'react-redux';
|
|
5
|
+
import { store } from '../../roomStore';
|
|
6
|
+
import { endCall, setCallError, setCallPhase } from '../../roomStore/callSlice';
|
|
7
|
+
import { useChatSettingState } from '../../hooks/useChatSettingState';
|
|
8
|
+
import { P2PCallController, remoteEndNotice } from '../../calls/p2p/P2PCallController';
|
|
9
|
+
import { acquireP2PController, createNativeP2PDeps, p2pInbox, releaseP2PController } from '../../calls/p2p/p2pRuntime';
|
|
10
|
+
import { isP2PAvailable } from '../../calls/p2p/webrtcRuntime';
|
|
11
|
+
import { reportCallConnected, reportCallDeclined, reportCallEnded, reportCallRinging } from '../../networking/api-requests/callState.api';
|
|
12
|
+
import { translateCallString } from './callActions';
|
|
13
|
+
import { bindP2PSession, localizeP2PMessage, startP2PController } from './p2pCallSession';
|
|
14
|
+
|
|
15
|
+
// Headless owner of the p2p controller for the call in the redux call slice.
|
|
16
|
+
// It builds the controller when a p2p call needs one, wires its events back
|
|
17
|
+
// into the slice, and releases it on EVERY way a call can stop (the phase goes
|
|
18
|
+
// idle or error, the call changes, the overlay unmounts), which is what keeps
|
|
19
|
+
// camera, microphone and the peer connection from leaking.
|
|
20
|
+
//
|
|
21
|
+
// caller: the controller exists from the moment the create response says
|
|
22
|
+
// `p2p` and starts at once (media, offer);
|
|
23
|
+
// callee: the controller exists while the incoming call rings, so the
|
|
24
|
+
// caller's offer / candidates / cancel are caught, but it only
|
|
25
|
+
// starts (media, answer) after the user accepts.
|
|
26
|
+
//
|
|
27
|
+
// RN specific: the call also rings from a VoIP push, with the app still
|
|
28
|
+
// starting. The caller keeps re-sending its offer for the whole ring window
|
|
29
|
+
// (longer than on web) because a cold-started callee may need several seconds
|
|
30
|
+
// to bring the XMPP socket up.
|
|
31
|
+
|
|
32
|
+
const RN_OFFER_RESEND_MS = [4_000, 10_000, 18_000, 26_000];
|
|
33
|
+
const isCurrentCall = callId => {
|
|
34
|
+
const current = store.getState().call;
|
|
35
|
+
return current.phase !== 'idle' && current.callId === callId;
|
|
36
|
+
};
|
|
37
|
+
export const P2PCallRunner = () => {
|
|
38
|
+
const dispatch = useDispatch();
|
|
39
|
+
const call = useSelector(state => state.call);
|
|
40
|
+
const {
|
|
41
|
+
config
|
|
42
|
+
} = useChatSettingState();
|
|
43
|
+
const videoCalls = config?.videoCalls;
|
|
44
|
+
const enabled = videoCalls?.enabled === true;
|
|
45
|
+
const callId = call.callId;
|
|
46
|
+
const isIncoming = call.direction === 'incoming';
|
|
47
|
+
const wantsController = enabled && call.mode === 'p2p' && !!callId && (isIncoming ? call.phase === 'ringing-incoming' || call.phase === 'connecting' || call.phase === 'in-call' : call.direction === 'outgoing' && call.iceServers !== null && (call.phase === 'requesting' || call.phase === 'connecting' || call.phase === 'in-call'));
|
|
48
|
+
// The callee waits on the ring screen; everyone else starts right away.
|
|
49
|
+
const shouldStart = wantsController && !(isIncoming && call.phase === 'ringing-incoming');
|
|
50
|
+
|
|
51
|
+
// Latest config values for the controller without re-running the effect.
|
|
52
|
+
const optionsRef = useRef({
|
|
53
|
+
startWithMicOn: videoCalls?.startWithMicOn,
|
|
54
|
+
startWithCameraOn: videoCalls?.startWithCameraOn
|
|
55
|
+
});
|
|
56
|
+
optionsRef.current = {
|
|
57
|
+
startWithMicOn: videoCalls?.startWithMicOn,
|
|
58
|
+
startWithCameraOn: videoCalls?.startWithCameraOn
|
|
59
|
+
};
|
|
60
|
+
useEffect(() => {
|
|
61
|
+
if (!wantsController || !callId) return;
|
|
62
|
+
if (!isP2PAvailable()) {
|
|
63
|
+
// The WebRTC package is not in this build: nothing can carry the call.
|
|
64
|
+
// A callee also tells the caller instead of letting them ring on.
|
|
65
|
+
if (store.getState().call.direction === 'incoming') {
|
|
66
|
+
reportCallDeclined(callId);
|
|
67
|
+
}
|
|
68
|
+
dispatch(setCallError(translateCallString('call.error.sdkMissing')));
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
const snapshot = store.getState().call;
|
|
72
|
+
const peer = String(snapshot.peerXmppUsername || '').trim();
|
|
73
|
+
const role = snapshot.direction === 'incoming' ? 'callee' : 'caller';
|
|
74
|
+
if (!peer) {
|
|
75
|
+
// Without the peer's address there is nobody to signal.
|
|
76
|
+
dispatch(setCallError(translateCallString('call.error.p2pNoPeer')));
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
const controller = acquireP2PController(callId, () => {
|
|
80
|
+
const peerLocal = peer.split('@')[0];
|
|
81
|
+
return new P2PCallController({
|
|
82
|
+
callId,
|
|
83
|
+
role,
|
|
84
|
+
kind: snapshot.kind,
|
|
85
|
+
peerLocal,
|
|
86
|
+
iceServers: snapshot.iceServers || [],
|
|
87
|
+
startWithMicOn: optionsRef.current.startWithMicOn,
|
|
88
|
+
startWithCameraOn: optionsRef.current.startWithCameraOn
|
|
89
|
+
}, createNativeP2PDeps({
|
|
90
|
+
callId,
|
|
91
|
+
peerXmppUsername: peer
|
|
92
|
+
}), {
|
|
93
|
+
onNegotiated: () => {
|
|
94
|
+
if (role === 'caller' && isCurrentCall(callId) && store.getState().call.phase === 'requesting') {
|
|
95
|
+
dispatch(setCallPhase('connecting'));
|
|
96
|
+
}
|
|
97
|
+
},
|
|
98
|
+
onConnected: () => {
|
|
99
|
+
if (!isCurrentCall(callId)) return;
|
|
100
|
+
dispatch(setCallPhase('in-call'));
|
|
101
|
+
// One side is enough to start the server-side call timer.
|
|
102
|
+
if (role === 'caller') reportCallConnected(callId);
|
|
103
|
+
},
|
|
104
|
+
onRemoteEnd: reason => {
|
|
105
|
+
if (!isCurrentCall(callId)) return;
|
|
106
|
+
const notice = remoteEndNotice(reason);
|
|
107
|
+
dispatch(notice ? setCallError(localizeP2PMessage(notice)) : endCall());
|
|
108
|
+
},
|
|
109
|
+
onFailed: message => {
|
|
110
|
+
if (isCurrentCall(callId)) {
|
|
111
|
+
dispatch(setCallError(localizeP2PMessage(message)));
|
|
112
|
+
}
|
|
113
|
+
},
|
|
114
|
+
// Whatever ended it, tell the server the call is over (idempotent, so
|
|
115
|
+
// it does not matter that the peer reports it too). A callee that
|
|
116
|
+
// never accepted ends through the decline report instead.
|
|
117
|
+
onDisposed: ({
|
|
118
|
+
started
|
|
119
|
+
}) => {
|
|
120
|
+
if (started) reportCallEnded(callId);
|
|
121
|
+
}
|
|
122
|
+
}, {
|
|
123
|
+
offerResendMs: RN_OFFER_RESEND_MS
|
|
124
|
+
});
|
|
125
|
+
});
|
|
126
|
+
const unbind = bindP2PSession(controller, snapshot.kind);
|
|
127
|
+
const detach = p2pInbox.attach(callId, signal => controller.receive(signal));
|
|
128
|
+
if (shouldStart) void startP2PController(controller, snapshot.kind);
|
|
129
|
+
return () => {
|
|
130
|
+
detach();
|
|
131
|
+
unbind();
|
|
132
|
+
releaseP2PController(callId);
|
|
133
|
+
};
|
|
134
|
+
}, [wantsController, shouldStart, callId, dispatch]);
|
|
135
|
+
|
|
136
|
+
// Callee: the incoming UI is on screen, let the server (and so the caller)
|
|
137
|
+
// know the phone is ringing. Once per call.
|
|
138
|
+
const ringingReportedRef = useRef(null);
|
|
139
|
+
useEffect(() => {
|
|
140
|
+
if (enabled && call.mode === 'p2p' && isIncoming && call.phase === 'ringing-incoming' && callId && ringingReportedRef.current !== callId) {
|
|
141
|
+
ringingReportedRef.current = callId;
|
|
142
|
+
reportCallRinging(callId);
|
|
143
|
+
}
|
|
144
|
+
}, [enabled, call.mode, isIncoming, call.phase, callId]);
|
|
145
|
+
return null;
|
|
146
|
+
};
|
|
147
|
+
//# sourceMappingURL=P2PCallRunner.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["useEffect","useRef","useDispatch","useSelector","store","endCall","setCallError","setCallPhase","useChatSettingState","P2PCallController","remoteEndNotice","acquireP2PController","createNativeP2PDeps","p2pInbox","releaseP2PController","isP2PAvailable","reportCallConnected","reportCallDeclined","reportCallEnded","reportCallRinging","translateCallString","bindP2PSession","localizeP2PMessage","startP2PController","RN_OFFER_RESEND_MS","isCurrentCall","callId","current","getState","call","phase","P2PCallRunner","dispatch","state","config","videoCalls","enabled","isIncoming","direction","wantsController","mode","iceServers","shouldStart","optionsRef","startWithMicOn","startWithCameraOn","snapshot","peer","String","peerXmppUsername","trim","role","controller","peerLocal","split","kind","onNegotiated","onConnected","onRemoteEnd","reason","notice","onFailed","message","onDisposed","started","offerResendMs","unbind","detach","attach","signal","receive","ringingReportedRef"],"sourceRoot":"../../../../src","sources":["components/VideoCalls/P2PCallRunner.tsx"],"mappings":";;AAAA,SAASA,SAAS,EAAEC,MAAM,QAAQ,OAAO;AACzC,SAASC,WAAW,EAAEC,WAAW,QAAQ,aAAa;AACtD,SAAoBC,KAAK,QAAQ,iBAAiB;AAClD,SAASC,OAAO,EAAEC,YAAY,EAAEC,YAAY,QAAQ,2BAA2B;AAC/E,SAASC,mBAAmB,QAAQ,iCAAiC;AACrE,SACEC,iBAAiB,EACjBC,eAAe,QACV,mCAAmC;AAC1C,SACEC,oBAAoB,EACpBC,mBAAmB,EACnBC,QAAQ,EACRC,oBAAoB,QACf,4BAA4B;AACnC,SAASC,cAAc,QAAQ,+BAA+B;AAC9D,SACEC,mBAAmB,EACnBC,kBAAkB,EAClBC,eAAe,EACfC,iBAAiB,QACZ,6CAA6C;AACpD,SAASC,mBAAmB,QAAQ,eAAe;AACnD,SACEC,cAAc,EACdC,kBAAkB,EAClBC,kBAAkB,QACb,kBAAkB;;AAEzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,MAAMC,kBAAkB,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC;AAE1D,MAAMC,aAAa,GAAIC,MAAc,IAAc;EACjD,MAAMC,OAAO,GAAGvB,KAAK,CAACwB,QAAQ,CAAC,CAAC,CAACC,IAAI;EACrC,OAAOF,OAAO,CAACG,KAAK,KAAK,MAAM,IAAIH,OAAO,CAACD,MAAM,KAAKA,MAAM;AAC9D,CAAC;AAED,OAAO,MAAMK,aAAuB,GAAGA,CAAA,KAAM;EAC3C,MAAMC,QAAQ,GAAG9B,WAAW,CAAC,CAAC;EAC9B,MAAM2B,IAAI,GAAG1B,WAAW,CAAE8B,KAAgB,IAAKA,KAAK,CAACJ,IAAI,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IAEnE,OAAO,MAAM;MACXY,MAAM,CAAC,CAAC;MACRD,MAAM,CAAC,CAAC;MACRpD,oBAAoB,CAACY,MAAM,CAAC;IAC9B,CAAC;EACH,CAAC,EAAE,CAACa,eAAe,EAAEG,WAAW,EAAEhB,MAAM,EAAEM,QAAQ,CAAC,CAAC;;EAEpD;EACA;EACA,MAAMuC,kBAAkB,GAAGtE,MAAM,CAAgB,IAAI,CAAC;EACtDD,SAAS,CAAC,MAAM;IACd,IACEoC,OAAO,IACPP,IAAI,CAACW,IAAI,KAAK,KAAK,IACnBH,UAAU,IACVR,IAAI,CAACC,KAAK,KAAK,kBAAkB,IACjCJ,MAAM,IACN6C,kBAAkB,CAAC5C,OAAO,KAAKD,MAAM,EACrC;MACA6C,kBAAkB,CAAC5C,OAAO,GAAGD,MAAM;MACnCP,iBAAiB,CAACO,MAAM,CAAC;IAC3B;EACF,CAAC,EAAE,CAACU,OAAO,EAAEP,IAAI,CAACW,IAAI,EAAEH,UAAU,EAAER,IAAI,CAACC,KAAK,EAAEJ,MAAM,CAAC,CAAC;EAExD,OAAO,IAAI;AACb,CAAC","ignoreList":[]}
|
|
@@ -9,7 +9,9 @@ import { useChatSettingState } from '../../hooks/useChatSettingState';
|
|
|
9
9
|
import { sendCallStateSignal } from '../../networking/callTokenStanza';
|
|
10
10
|
import { useTheme } from '../../hooks/useTheme';
|
|
11
11
|
import { VideoCallSession } from './VideoCallSession';
|
|
12
|
+
import { P2PCallRunner } from './P2PCallRunner';
|
|
12
13
|
import { startCallSession } from './callSessionController';
|
|
14
|
+
import { callCanRenderSession } from './callLive';
|
|
13
15
|
import { declineActiveCall, terminateActiveCall } from './callActions';
|
|
14
16
|
import { CALL_BAR_HEIGHT, CALL_BAR_MARGIN_TOP, CALL_BAR_MARGIN_X, CALL_BAR_RADIUS, DockedCallBar } from './ActiveCallBar';
|
|
15
17
|
import { setCallMinimized, useCallUi } from './callUiStore';
|
|
@@ -142,7 +144,7 @@ const RingingCard = ({
|
|
|
142
144
|
style: [styles.ringingName, {
|
|
143
145
|
color: theme.text
|
|
144
146
|
}],
|
|
145
|
-
children: roomName || (variant === 'incoming' ? t('call.
|
|
147
|
+
children: roomName || (variant === 'incoming' ? t('call.incomingNeutral') : t('call.title'))
|
|
146
148
|
}), /*#__PURE__*/_jsxs(View, {
|
|
147
149
|
style: styles.ringingSubtitleRow,
|
|
148
150
|
children: [kind === 'audio' ? /*#__PURE__*/_jsx(AudioCallIcon, {
|
|
@@ -406,7 +408,10 @@ const VideoCallOverlayInner = () => {
|
|
|
406
408
|
const t = useT();
|
|
407
409
|
const videoCallsConfig = config?.videoCalls;
|
|
408
410
|
const enabled = videoCallsConfig?.enabled === true;
|
|
409
|
-
|
|
411
|
+
// The server's own LiveKit URL (call-token or create response) wins over
|
|
412
|
+
// the host config.
|
|
413
|
+
const livekitUrl = (call.livekitUrl || videoCallsConfig?.livekitUrl || '').trim();
|
|
414
|
+
const isP2P = call.mode === 'p2p';
|
|
410
415
|
const primaryColor = theme.primary || config?.colors?.primary || DEFAULT_PRIMARY;
|
|
411
416
|
const isOpen = enabled && call.phase !== 'idle';
|
|
412
417
|
|
|
@@ -423,7 +428,10 @@ const VideoCallOverlayInner = () => {
|
|
|
423
428
|
minimized,
|
|
424
429
|
systemRinging
|
|
425
430
|
} = useCallUi();
|
|
426
|
-
|
|
431
|
+
|
|
432
|
+
// A p2p call has no LiveKit token or URL: the media is the peer connection
|
|
433
|
+
// owned by P2PCallRunner.
|
|
434
|
+
const canRenderSession = isP2P ? callCanRenderSession(call) : callCanRenderSession(call) && !!livekitUrl;
|
|
427
435
|
const isMinimized = minimized && canRenderSession;
|
|
428
436
|
// Expanding from the header strip slides the call down from the top
|
|
429
437
|
// instead of fading it in.
|
|
@@ -436,18 +444,19 @@ const VideoCallOverlayInner = () => {
|
|
|
436
444
|
// Join the LiveKit room once the call has a token. Idempotent, and the
|
|
437
445
|
// controller tears itself down when the call slice leaves these phases.
|
|
438
446
|
useEffect(() => {
|
|
439
|
-
if (!enabled || !canRenderSession || !call.token) {
|
|
447
|
+
if (!enabled || isP2P || !canRenderSession || !call.token) {
|
|
440
448
|
return;
|
|
441
449
|
}
|
|
442
450
|
startCallSession({
|
|
443
451
|
token: call.token,
|
|
444
452
|
livekitUrl,
|
|
445
453
|
kind: call.kind,
|
|
454
|
+
isGroup: call.isGroup,
|
|
446
455
|
startWithMicOn: videoCallsConfig?.startWithMicOn,
|
|
447
456
|
startWithCameraOn: videoCallsConfig?.startWithCameraOn
|
|
448
457
|
});
|
|
449
458
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
450
|
-
}, [enabled, canRenderSession, call.token, livekitUrl, call.kind]);
|
|
459
|
+
}, [enabled, isP2P, canRenderSession, call.token, livekitUrl, call.kind, call.isGroup]);
|
|
451
460
|
|
|
452
461
|
// Give up on an unanswered outgoing dial. Unlike web (which only shows
|
|
453
462
|
useEffect(() => {
|
|
@@ -508,6 +517,9 @@ const VideoCallOverlayInner = () => {
|
|
|
508
517
|
}, [isOpen, isMinimized, hangupCurrent]);
|
|
509
518
|
const ringingHeader = useMemo(() => {
|
|
510
519
|
if (call.direction === 'incoming') {
|
|
520
|
+
if (call.isGroup) {
|
|
521
|
+
return call.kind === 'audio' ? t('call.incomingGroupAudio') : t('call.incomingGroupVideo');
|
|
522
|
+
}
|
|
511
523
|
return call.kind === 'audio' ? t('call.incomingAudio') : t('call.incomingVideo');
|
|
512
524
|
}
|
|
513
525
|
if (call.phase === 'requesting') {
|
|
@@ -520,19 +532,25 @@ const VideoCallOverlayInner = () => {
|
|
|
520
532
|
return t('call.failed');
|
|
521
533
|
}
|
|
522
534
|
return t('call.title');
|
|
523
|
-
}, [call.direction, call.phase, call.kind, t]);
|
|
535
|
+
}, [call.direction, call.phase, call.kind, call.isGroup, t]);
|
|
524
536
|
const ringingSubtitle = useMemo(() => {
|
|
537
|
+
// The card title is the room's name; make it clear it is a group ring.
|
|
538
|
+
const label = call.isGroup ? call.kind === 'audio' ? t('call.groupAudioCall') : t('call.groupVideoCall') : call.kind === 'audio' ? t('call.audioCall') : t('call.videoCall');
|
|
525
539
|
if (call.direction === 'incoming') {
|
|
526
|
-
|
|
540
|
+
// "<person> is calling in <room>" once both are known.
|
|
541
|
+
return call.isGroup && call.callerName && call.roomName ? t('call.callingIn', {
|
|
542
|
+
caller: call.callerName,
|
|
543
|
+
room: call.roomName
|
|
544
|
+
}) : label;
|
|
527
545
|
}
|
|
528
546
|
if (call.phase === 'connecting') {
|
|
529
|
-
return t('call.connectingToRoom');
|
|
547
|
+
return isP2P ? t('call.connecting') : t('call.connectingToRoom');
|
|
530
548
|
}
|
|
531
549
|
if (call.phase === 'error') {
|
|
532
550
|
return t('call.tryAgainLater');
|
|
533
551
|
}
|
|
534
|
-
return
|
|
535
|
-
}, [call.direction, call.kind, call.phase, t]);
|
|
552
|
+
return label;
|
|
553
|
+
}, [call.direction, call.kind, call.phase, call.isGroup, call.callerName, call.roomName, isP2P, t]);
|
|
536
554
|
if (!isOpen) {
|
|
537
555
|
return null;
|
|
538
556
|
}
|
|
@@ -545,6 +563,7 @@ const VideoCallOverlayInner = () => {
|
|
|
545
563
|
}
|
|
546
564
|
const renderSession = collapse => /*#__PURE__*/_jsx(VideoCallSession, {
|
|
547
565
|
kind: call.kind,
|
|
566
|
+
isGroup: call.isGroup,
|
|
548
567
|
peerName: call.roomName,
|
|
549
568
|
primaryColor: primaryColor,
|
|
550
569
|
icons: videoCallsConfig?.icons,
|
|
@@ -597,7 +616,7 @@ const VideoCallOverlayInner = () => {
|
|
|
597
616
|
variant: "error",
|
|
598
617
|
primaryColor: primaryColor,
|
|
599
618
|
theme: theme,
|
|
600
|
-
errorMessage: call.error || (!livekitUrl ? t('call.error.missingLivekitUrl') : null),
|
|
619
|
+
errorMessage: call.error || (!livekitUrl && !isP2P ? t('call.error.missingLivekitUrl') : null),
|
|
601
620
|
onDismiss: () => dispatch(resetCall())
|
|
602
621
|
}) : /*#__PURE__*/_jsx(RingingCard, {
|
|
603
622
|
title: ringingHeader,
|
|
@@ -615,9 +634,14 @@ const VideoCallOverlayInner = () => {
|
|
|
615
634
|
};
|
|
616
635
|
export const VideoCallOverlay = () => {
|
|
617
636
|
const callId = useSelector(state => state.call.callId || String(state.call.startedAt || ''));
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
637
|
+
// The runner is headless and owns the p2p controller. It sits beside the
|
|
638
|
+
// boundary, not inside it: a crash in the call UI blanks the screen, it
|
|
639
|
+
// must not tear the call down.
|
|
640
|
+
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
641
|
+
children: [/*#__PURE__*/_jsx(P2PCallRunner, {}), /*#__PURE__*/_jsx(CallErrorBoundary, {
|
|
642
|
+
resetKey: callId,
|
|
643
|
+
children: /*#__PURE__*/_jsx(VideoCallOverlayInner, {})
|
|
644
|
+
})]
|
|
621
645
|
});
|
|
622
646
|
};
|
|
623
647
|
const styles = StyleSheet.create({
|