@100mslive/react-native-room-kit 0.0.2 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/commonjs/HMSInstanceSetup.js +1 -14
- package/lib/commonjs/HMSInstanceSetup.js.map +1 -1
- package/lib/commonjs/HMSPrebuilt.js +13 -4
- package/lib/commonjs/HMSPrebuilt.js.map +1 -1
- package/lib/commonjs/HMSRoomSetup.js +38 -14
- package/lib/commonjs/HMSRoomSetup.js.map +1 -1
- package/lib/commonjs/Icons/AnswerPhone/assets/answer-phone.png +0 -0
- package/lib/commonjs/Icons/AnswerPhone/assets/answer-phone@2x.png +0 -0
- package/lib/commonjs/Icons/AnswerPhone/assets/answer-phone@3x.png +0 -0
- package/lib/commonjs/Icons/AnswerPhone/index.js +30 -0
- package/lib/commonjs/Icons/AnswerPhone/index.js.map +1 -0
- package/lib/commonjs/Icons/Bluetooth/assets/bluetooth-on.png +0 -0
- package/lib/commonjs/Icons/Bluetooth/assets/bluetooth-on@2x.png +0 -0
- package/lib/commonjs/Icons/Bluetooth/assets/bluetooth-on@3x.png +0 -0
- package/lib/commonjs/Icons/Bluetooth/index.js +30 -0
- package/lib/commonjs/Icons/Bluetooth/index.js.map +1 -0
- package/lib/commonjs/Icons/Check/assets/check.png +0 -0
- package/lib/commonjs/Icons/Check/assets/check@2x.png +0 -0
- package/lib/commonjs/Icons/Check/assets/check@3x.png +0 -0
- package/lib/commonjs/Icons/Check/index.js +30 -0
- package/lib/commonjs/Icons/Check/index.js.map +1 -0
- package/lib/commonjs/Icons/GenericLogo/assets/generic-logo.png +0 -0
- package/lib/commonjs/Icons/GenericLogo/assets/generic-logo@2x.png +0 -0
- package/lib/commonjs/Icons/GenericLogo/assets/generic-logo@3x.png +0 -0
- package/lib/commonjs/Icons/GenericLogo/index.js +30 -0
- package/lib/commonjs/Icons/GenericLogo/index.js.map +1 -0
- package/lib/commonjs/Icons/Headphones/assets/headphones.png +0 -0
- package/lib/commonjs/Icons/Headphones/assets/headphones@2x.png +0 -0
- package/lib/commonjs/Icons/Headphones/assets/headphones@3x.png +0 -0
- package/lib/commonjs/Icons/Headphones/index.js +30 -0
- package/lib/commonjs/Icons/Headphones/index.js.map +1 -0
- package/lib/commonjs/Icons/Person/assets/person.png +0 -0
- package/lib/commonjs/Icons/Person/assets/person@2x.png +0 -0
- package/lib/commonjs/Icons/Person/assets/person@3x.png +0 -0
- package/lib/commonjs/Icons/Person/index.js +30 -0
- package/lib/commonjs/Icons/Person/index.js.map +1 -0
- package/lib/commonjs/Icons/Radio/assets/radio.png +0 -0
- package/lib/commonjs/Icons/Radio/assets/radio@2x.png +0 -0
- package/lib/commonjs/Icons/Radio/assets/radio@3x.png +0 -0
- package/lib/commonjs/Icons/Radio/index.js +30 -0
- package/lib/commonjs/Icons/Radio/index.js.map +1 -0
- package/lib/commonjs/Icons/Speaker/assets/speaker-large.png +0 -0
- package/lib/commonjs/Icons/Speaker/assets/speaker-large@2x.png +0 -0
- package/lib/commonjs/Icons/Speaker/assets/speaker-large@3x.png +0 -0
- package/lib/commonjs/Icons/Speaker/index.js +7 -2
- package/lib/commonjs/Icons/Speaker/index.js.map +1 -1
- package/lib/commonjs/Icons/Wave/assets/wave.png +0 -0
- package/lib/commonjs/Icons/Wave/assets/wave@2x.png +0 -0
- package/lib/commonjs/Icons/Wave/assets/wave@3x.png +0 -0
- package/lib/commonjs/Icons/Wave/index.js +30 -0
- package/lib/commonjs/Icons/Wave/index.js.map +1 -0
- package/lib/commonjs/Icons/index.js +88 -0
- package/lib/commonjs/Icons/index.js.map +1 -1
- package/lib/commonjs/components/BackButton.js +3 -3
- package/lib/commonjs/components/BackButton.js.map +1 -1
- package/lib/commonjs/components/DisplayView.js +0 -6
- package/lib/commonjs/components/DisplayView.js.map +1 -1
- package/lib/commonjs/components/HMSHLSStreamLoading.js +56 -0
- package/lib/commonjs/components/HMSHLSStreamLoading.js.map +1 -0
- package/lib/commonjs/components/HMSLocalVideoView.js +41 -0
- package/lib/commonjs/components/HMSLocalVideoView.js.map +1 -0
- package/lib/commonjs/components/{HMSPreviewDeviceSettings.js → HMSManageAudioOutput.js} +97 -161
- package/lib/commonjs/components/HMSManageAudioOutput.js.map +1 -0
- package/lib/commonjs/components/HMSManageLeave.js +7 -60
- package/lib/commonjs/components/HMSManageLeave.js.map +1 -1
- package/lib/commonjs/components/HMSMeetingEnded.js +36 -0
- package/lib/commonjs/components/HMSMeetingEnded.js.map +1 -0
- package/lib/commonjs/components/HMSPreviewEditName.js +7 -4
- package/lib/commonjs/components/HMSPreviewEditName.js.map +1 -1
- package/lib/commonjs/components/HMSPreviewHLSLiveIndicator.js +64 -0
- package/lib/commonjs/components/HMSPreviewHLSLiveIndicator.js.map +1 -0
- package/lib/commonjs/components/HMSPreviewJoinButton.js +25 -6
- package/lib/commonjs/components/HMSPreviewJoinButton.js.map +1 -1
- package/lib/commonjs/components/HMSPreviewNetworkQuality.js +43 -0
- package/lib/commonjs/components/HMSPreviewNetworkQuality.js.map +1 -0
- package/lib/commonjs/components/HMSPreviewPeersList.js +4 -50
- package/lib/commonjs/components/HMSPreviewPeersList.js.map +1 -1
- package/lib/commonjs/components/HMSPreviewSubtitle.js +26 -3
- package/lib/commonjs/components/HMSPreviewSubtitle.js.map +1 -1
- package/lib/commonjs/components/HMSPreviewTile.js +11 -77
- package/lib/commonjs/components/HMSPreviewTile.js.map +1 -1
- package/lib/commonjs/components/HMSPreviewTitle.js +0 -1
- package/lib/commonjs/components/HMSPreviewTitle.js.map +1 -1
- package/lib/commonjs/components/HMSRoomOptions.js +2 -3
- package/lib/commonjs/components/HMSRoomOptions.js.map +1 -1
- package/lib/commonjs/components/HMSShowNetworkQuality.js +0 -2
- package/lib/commonjs/components/HMSShowNetworkQuality.js.map +1 -1
- package/lib/commonjs/components/Meeting.js +7 -0
- package/lib/commonjs/components/Meeting.js.map +1 -1
- package/lib/commonjs/components/MenuModal/Menu.js +1 -2
- package/lib/commonjs/components/MenuModal/Menu.js.map +1 -1
- package/lib/commonjs/components/Modals.js +39 -299
- package/lib/commonjs/components/Modals.js.map +1 -1
- package/lib/commonjs/components/Participants/ParticipantsList.js +1 -20
- package/lib/commonjs/components/Participants/ParticipantsList.js.map +1 -1
- package/lib/commonjs/components/PeerSettingsModalContent.js +2 -13
- package/lib/commonjs/components/PeerSettingsModalContent.js.map +1 -1
- package/lib/commonjs/components/Preview.js +87 -28
- package/lib/commonjs/components/Preview.js.map +1 -1
- package/lib/commonjs/components/RoomSettingsModalContent.js +2 -101
- package/lib/commonjs/components/RoomSettingsModalContent.js.map +1 -1
- package/lib/commonjs/components/index.js +0 -11
- package/lib/commonjs/components/index.js.map +1 -1
- package/lib/commonjs/hooks/useHmsInstance.js +0 -1
- package/lib/commonjs/hooks/useHmsInstance.js.map +1 -1
- package/lib/commonjs/hooks-util-selectors.js +8 -1
- package/lib/commonjs/hooks-util-selectors.js.map +1 -1
- package/lib/commonjs/hooks-util.js +140 -82
- package/lib/commonjs/hooks-util.js.map +1 -1
- package/lib/commonjs/redux/actionTypes.js +7 -1
- package/lib/commonjs/redux/actionTypes.js.map +1 -1
- package/lib/commonjs/redux/actions/index.js +25 -1
- package/lib/commonjs/redux/actions/index.js.map +1 -1
- package/lib/commonjs/redux/reducers/appState.js +14 -1
- package/lib/commonjs/redux/reducers/appState.js.map +1 -1
- package/lib/commonjs/redux/reducers/hmsStates.js +12 -1
- package/lib/commonjs/redux/reducers/hmsStates.js.map +1 -1
- package/lib/commonjs/utils/theme.js +6 -1
- package/lib/commonjs/utils/theme.js.map +1 -1
- package/lib/commonjs/utils/types.js +0 -1
- package/lib/commonjs/utils/types.js.map +1 -1
- package/lib/commonjs/utils.js +2 -2
- package/lib/commonjs/utils.js.map +1 -1
- package/lib/module/HMSInstanceSetup.js +1 -14
- package/lib/module/HMSInstanceSetup.js.map +1 -1
- package/lib/module/HMSPrebuilt.js +13 -3
- package/lib/module/HMSPrebuilt.js.map +1 -1
- package/lib/module/HMSRoomSetup.js +43 -19
- package/lib/module/HMSRoomSetup.js.map +1 -1
- package/lib/module/Icons/AnswerPhone/assets/answer-phone.png +0 -0
- package/lib/module/Icons/AnswerPhone/assets/answer-phone@2x.png +0 -0
- package/lib/module/Icons/AnswerPhone/assets/answer-phone@3x.png +0 -0
- package/lib/module/Icons/AnswerPhone/index.js +22 -0
- package/lib/module/Icons/AnswerPhone/index.js.map +1 -0
- package/lib/module/Icons/Bluetooth/assets/bluetooth-on.png +0 -0
- package/lib/module/Icons/Bluetooth/assets/bluetooth-on@2x.png +0 -0
- package/lib/module/Icons/Bluetooth/assets/bluetooth-on@3x.png +0 -0
- package/lib/module/Icons/Bluetooth/index.js +22 -0
- package/lib/module/Icons/Bluetooth/index.js.map +1 -0
- package/lib/module/Icons/Check/assets/check.png +0 -0
- package/lib/module/Icons/Check/assets/check@2x.png +0 -0
- package/lib/module/Icons/Check/assets/check@3x.png +0 -0
- package/lib/module/Icons/Check/index.js +22 -0
- package/lib/module/Icons/Check/index.js.map +1 -0
- package/lib/module/Icons/GenericLogo/assets/generic-logo.png +0 -0
- package/lib/module/Icons/GenericLogo/assets/generic-logo@2x.png +0 -0
- package/lib/module/Icons/GenericLogo/assets/generic-logo@3x.png +0 -0
- package/lib/module/Icons/GenericLogo/index.js +22 -0
- package/lib/module/Icons/GenericLogo/index.js.map +1 -0
- package/lib/module/Icons/Headphones/assets/headphones.png +0 -0
- package/lib/module/Icons/Headphones/assets/headphones@2x.png +0 -0
- package/lib/module/Icons/Headphones/assets/headphones@3x.png +0 -0
- package/lib/module/Icons/Headphones/index.js +22 -0
- package/lib/module/Icons/Headphones/index.js.map +1 -0
- package/lib/module/Icons/Person/assets/person.png +0 -0
- package/lib/module/Icons/Person/assets/person@2x.png +0 -0
- package/lib/module/Icons/Person/assets/person@3x.png +0 -0
- package/lib/module/Icons/Person/index.js +22 -0
- package/lib/module/Icons/Person/index.js.map +1 -0
- package/lib/module/Icons/Radio/assets/radio.png +0 -0
- package/lib/module/Icons/Radio/assets/radio@2x.png +0 -0
- package/lib/module/Icons/Radio/assets/radio@3x.png +0 -0
- package/lib/module/Icons/Radio/index.js +22 -0
- package/lib/module/Icons/Radio/index.js.map +1 -0
- package/lib/module/Icons/Speaker/assets/speaker-large.png +0 -0
- package/lib/module/Icons/Speaker/assets/speaker-large@2x.png +0 -0
- package/lib/module/Icons/Speaker/assets/speaker-large@3x.png +0 -0
- package/lib/module/Icons/Speaker/index.js +7 -2
- package/lib/module/Icons/Speaker/index.js.map +1 -1
- package/lib/module/Icons/Wave/assets/wave.png +0 -0
- package/lib/module/Icons/Wave/assets/wave@2x.png +0 -0
- package/lib/module/Icons/Wave/assets/wave@3x.png +0 -0
- package/lib/module/Icons/Wave/index.js +22 -0
- package/lib/module/Icons/Wave/index.js.map +1 -0
- package/lib/module/Icons/index.js +8 -0
- package/lib/module/Icons/index.js.map +1 -1
- package/lib/module/components/BackButton.js +4 -4
- package/lib/module/components/BackButton.js.map +1 -1
- package/lib/module/components/DisplayView.js +1 -7
- package/lib/module/components/DisplayView.js.map +1 -1
- package/lib/module/components/HMSHLSStreamLoading.js +47 -0
- package/lib/module/components/HMSHLSStreamLoading.js.map +1 -0
- package/lib/module/components/HMSLocalVideoView.js +32 -0
- package/lib/module/components/HMSLocalVideoView.js.map +1 -0
- package/lib/module/components/HMSManageAudioOutput.js +232 -0
- package/lib/module/components/HMSManageAudioOutput.js.map +1 -0
- package/lib/module/components/HMSManageLeave.js +9 -62
- package/lib/module/components/HMSManageLeave.js.map +1 -1
- package/lib/module/components/HMSMeetingEnded.js +27 -0
- package/lib/module/components/HMSMeetingEnded.js.map +1 -0
- package/lib/module/components/HMSPreviewEditName.js +8 -5
- package/lib/module/components/HMSPreviewEditName.js.map +1 -1
- package/lib/module/components/HMSPreviewHLSLiveIndicator.js +55 -0
- package/lib/module/components/HMSPreviewHLSLiveIndicator.js.map +1 -0
- package/lib/module/components/HMSPreviewJoinButton.js +25 -6
- package/lib/module/components/HMSPreviewJoinButton.js.map +1 -1
- package/lib/module/components/HMSPreviewNetworkQuality.js +34 -0
- package/lib/module/components/HMSPreviewNetworkQuality.js.map +1 -0
- package/lib/module/components/HMSPreviewPeersList.js +4 -50
- package/lib/module/components/HMSPreviewPeersList.js.map +1 -1
- package/lib/module/components/HMSPreviewSubtitle.js +26 -3
- package/lib/module/components/HMSPreviewSubtitle.js.map +1 -1
- package/lib/module/components/HMSPreviewTile.js +12 -78
- package/lib/module/components/HMSPreviewTile.js.map +1 -1
- package/lib/module/components/HMSPreviewTitle.js +0 -1
- package/lib/module/components/HMSPreviewTitle.js.map +1 -1
- package/lib/module/components/HMSRoomOptions.js +2 -3
- package/lib/module/components/HMSRoomOptions.js.map +1 -1
- package/lib/module/components/HMSShowNetworkQuality.js +0 -2
- package/lib/module/components/HMSShowNetworkQuality.js.map +1 -1
- package/lib/module/components/Meeting.js +7 -0
- package/lib/module/components/Meeting.js.map +1 -1
- package/lib/module/components/MenuModal/Menu.js +1 -2
- package/lib/module/components/MenuModal/Menu.js.map +1 -1
- package/lib/module/components/Modals.js +40 -298
- package/lib/module/components/Modals.js.map +1 -1
- package/lib/module/components/Participants/ParticipantsList.js +1 -20
- package/lib/module/components/Participants/ParticipantsList.js.map +1 -1
- package/lib/module/components/PeerSettingsModalContent.js +2 -13
- package/lib/module/components/PeerSettingsModalContent.js.map +1 -1
- package/lib/module/components/Preview.js +88 -30
- package/lib/module/components/Preview.js.map +1 -1
- package/lib/module/components/RoomSettingsModalContent.js +3 -100
- package/lib/module/components/RoomSettingsModalContent.js.map +1 -1
- package/lib/module/components/index.js +0 -1
- package/lib/module/components/index.js.map +1 -1
- package/lib/module/hooks/useHmsInstance.js +0 -1
- package/lib/module/hooks/useHmsInstance.js.map +1 -1
- package/lib/module/hooks-util-selectors.js +6 -0
- package/lib/module/hooks-util-selectors.js.map +1 -1
- package/lib/module/hooks-util.js +142 -86
- package/lib/module/hooks-util.js.map +1 -1
- package/lib/module/redux/actionTypes.js +7 -1
- package/lib/module/redux/actionTypes.js.map +1 -1
- package/lib/module/redux/actions/index.js +20 -0
- package/lib/module/redux/actions/index.js.map +1 -1
- package/lib/module/redux/reducers/appState.js +14 -1
- package/lib/module/redux/reducers/appState.js.map +1 -1
- package/lib/module/redux/reducers/hmsStates.js +12 -1
- package/lib/module/redux/reducers/hmsStates.js.map +1 -1
- package/lib/module/utils/theme.js +6 -1
- package/lib/module/utils/theme.js.map +1 -1
- package/lib/module/utils/types.js +0 -1
- package/lib/module/utils/types.js.map +1 -1
- package/lib/module/utils.js +2 -2
- package/lib/module/utils.js.map +1 -1
- package/lib/typescript/HMSInstanceSetup.d.ts.map +1 -1
- package/lib/typescript/HMSPrebuilt.d.ts +2 -3
- package/lib/typescript/HMSPrebuilt.d.ts.map +1 -1
- package/lib/typescript/HMSRoomSetup.d.ts.map +1 -1
- package/lib/typescript/Icons/AnswerPhone/index.d.ts +7 -0
- package/lib/typescript/Icons/AnswerPhone/index.d.ts.map +1 -0
- package/lib/typescript/Icons/Bluetooth/index.d.ts +7 -0
- package/lib/typescript/Icons/Bluetooth/index.d.ts.map +1 -0
- package/lib/typescript/Icons/Check/index.d.ts +7 -0
- package/lib/typescript/Icons/Check/index.d.ts.map +1 -0
- package/lib/typescript/Icons/GenericLogo/index.d.ts +7 -0
- package/lib/typescript/Icons/GenericLogo/index.d.ts.map +1 -0
- package/lib/typescript/Icons/Headphones/index.d.ts +7 -0
- package/lib/typescript/Icons/Headphones/index.d.ts.map +1 -0
- package/lib/typescript/Icons/Person/index.d.ts +7 -0
- package/lib/typescript/Icons/Person/index.d.ts.map +1 -0
- package/lib/typescript/Icons/Radio/index.d.ts +7 -0
- package/lib/typescript/Icons/Radio/index.d.ts.map +1 -0
- package/lib/typescript/Icons/Speaker/index.d.ts +1 -0
- package/lib/typescript/Icons/Speaker/index.d.ts.map +1 -1
- package/lib/typescript/Icons/Wave/index.d.ts +7 -0
- package/lib/typescript/Icons/Wave/index.d.ts.map +1 -0
- package/lib/typescript/Icons/index.d.ts +8 -0
- package/lib/typescript/Icons/index.d.ts.map +1 -1
- package/lib/typescript/components/CustomInput.d.ts +1 -1
- package/lib/typescript/components/DisplayView.d.ts.map +1 -1
- package/lib/typescript/components/HMSHLSStreamLoading.d.ts +3 -0
- package/lib/typescript/components/HMSHLSStreamLoading.d.ts.map +1 -0
- package/lib/typescript/components/HMSLocalVideoView.d.ts +3 -0
- package/lib/typescript/components/HMSLocalVideoView.d.ts.map +1 -0
- package/lib/typescript/components/HMSManageAudioOutput.d.ts +3 -0
- package/lib/typescript/components/HMSManageAudioOutput.d.ts.map +1 -0
- package/lib/typescript/components/HMSManageLeave.d.ts.map +1 -1
- package/lib/typescript/components/HMSMeetingEnded.d.ts +3 -0
- package/lib/typescript/components/HMSMeetingEnded.d.ts.map +1 -0
- package/lib/typescript/components/HMSPreviewHLSLiveIndicator.d.ts +3 -0
- package/lib/typescript/components/HMSPreviewHLSLiveIndicator.d.ts.map +1 -0
- package/lib/typescript/components/HMSPreviewJoinButton.d.ts.map +1 -1
- package/lib/typescript/components/HMSPreviewNetworkQuality.d.ts +3 -0
- package/lib/typescript/components/HMSPreviewNetworkQuality.d.ts.map +1 -0
- package/lib/typescript/components/HMSPreviewPeersList.d.ts.map +1 -1
- package/lib/typescript/components/HMSPreviewSubtitle.d.ts.map +1 -1
- package/lib/typescript/components/HMSPreviewTile.d.ts.map +1 -1
- package/lib/typescript/components/HMSRoomOptions.d.ts.map +1 -1
- package/lib/typescript/components/HMSShowNetworkQuality.d.ts.map +1 -1
- package/lib/typescript/components/Meeting.d.ts.map +1 -1
- package/lib/typescript/components/MenuModal/Menu.d.ts.map +1 -1
- package/lib/typescript/components/Modals.d.ts +1 -9
- package/lib/typescript/components/Modals.d.ts.map +1 -1
- package/lib/typescript/components/Participants/ParticipantsList.d.ts.map +1 -1
- package/lib/typescript/components/PeerSettingsModalContent.d.ts.map +1 -1
- package/lib/typescript/components/Preview.d.ts.map +1 -1
- package/lib/typescript/components/RoomSettingsModalContent.d.ts.map +1 -1
- package/lib/typescript/components/index.d.ts +0 -1
- package/lib/typescript/components/index.d.ts.map +1 -1
- package/lib/typescript/hooks-util-selectors.d.ts +2 -0
- package/lib/typescript/hooks-util-selectors.d.ts.map +1 -1
- package/lib/typescript/hooks-util.d.ts +9 -2
- package/lib/typescript/hooks-util.d.ts.map +1 -1
- package/lib/typescript/redux/actionTypes.d.ts +5 -1
- package/lib/typescript/redux/actionTypes.d.ts.map +1 -1
- package/lib/typescript/redux/actions/index.d.ts +24 -3
- package/lib/typescript/redux/actions/index.d.ts.map +1 -1
- package/lib/typescript/redux/index.d.ts +4 -1
- package/lib/typescript/redux/index.d.ts.map +1 -1
- package/lib/typescript/redux/reducers/appState.d.ts +3 -0
- package/lib/typescript/redux/reducers/appState.d.ts.map +1 -1
- package/lib/typescript/redux/reducers/hmsStates.d.ts +11 -2
- package/lib/typescript/redux/reducers/hmsStates.d.ts.map +1 -1
- package/lib/typescript/redux/reducers/index.d.ts +4 -1
- package/lib/typescript/redux/reducers/index.d.ts.map +1 -1
- package/lib/typescript/redux/reducers/userState.d.ts +2 -2
- package/lib/typescript/redux/reducers/userState.d.ts.map +1 -1
- package/lib/typescript/utils/theme.d.ts +5 -0
- package/lib/typescript/utils/theme.d.ts.map +1 -1
- package/lib/typescript/utils/types.d.ts +3 -4
- package/lib/typescript/utils/types.d.ts.map +1 -1
- package/package.json +11 -17
- package/src/HMSInstanceSetup.tsx +4 -31
- package/src/HMSPrebuilt.tsx +24 -6
- package/src/HMSRoomSetup.tsx +55 -17
- package/src/Icons/AnswerPhone/assets/answer-phone.png +0 -0
- package/src/Icons/AnswerPhone/assets/answer-phone@2x.png +0 -0
- package/src/Icons/AnswerPhone/assets/answer-phone@3x.png +0 -0
- package/src/Icons/AnswerPhone/index.tsx +27 -0
- package/src/Icons/Bluetooth/assets/bluetooth-on.png +0 -0
- package/src/Icons/Bluetooth/assets/bluetooth-on@2x.png +0 -0
- package/src/Icons/Bluetooth/assets/bluetooth-on@3x.png +0 -0
- package/src/Icons/Bluetooth/index.tsx +27 -0
- package/src/Icons/Check/assets/check.png +0 -0
- package/src/Icons/Check/assets/check@2x.png +0 -0
- package/src/Icons/Check/assets/check@3x.png +0 -0
- package/src/Icons/Check/index.tsx +27 -0
- package/src/Icons/GenericLogo/assets/generic-logo.png +0 -0
- package/src/Icons/GenericLogo/assets/generic-logo@2x.png +0 -0
- package/src/Icons/GenericLogo/assets/generic-logo@3x.png +0 -0
- package/src/Icons/GenericLogo/index.tsx +27 -0
- package/src/Icons/Headphones/assets/headphones.png +0 -0
- package/src/Icons/Headphones/assets/headphones@2x.png +0 -0
- package/src/Icons/Headphones/assets/headphones@3x.png +0 -0
- package/src/Icons/Headphones/index.tsx +27 -0
- package/src/Icons/Person/assets/person.png +0 -0
- package/src/Icons/Person/assets/person@2x.png +0 -0
- package/src/Icons/Person/assets/person@3x.png +0 -0
- package/src/Icons/Person/index.tsx +27 -0
- package/src/Icons/Radio/assets/radio.png +0 -0
- package/src/Icons/Radio/assets/radio@2x.png +0 -0
- package/src/Icons/Radio/assets/radio@3x.png +0 -0
- package/src/Icons/Radio/index.tsx +27 -0
- package/src/Icons/Speaker/assets/speaker-large.png +0 -0
- package/src/Icons/Speaker/assets/speaker-large@2x.png +0 -0
- package/src/Icons/Speaker/assets/speaker-large@3x.png +0 -0
- package/src/Icons/Speaker/index.tsx +10 -2
- package/src/Icons/Wave/assets/wave.png +0 -0
- package/src/Icons/Wave/assets/wave@2x.png +0 -0
- package/src/Icons/Wave/assets/wave@3x.png +0 -0
- package/src/Icons/Wave/index.tsx +24 -0
- package/src/Icons/index.ts +8 -0
- package/src/components/BackButton.tsx +4 -4
- package/src/components/DisplayView.tsx +0 -10
- package/src/components/HMSHLSStreamLoading.tsx +57 -0
- package/src/components/HMSLocalVideoView.tsx +42 -0
- package/src/components/HMSManageAudioOutput.tsx +311 -0
- package/src/components/HMSManageLeave.tsx +6 -77
- package/src/components/HMSMeetingEnded.tsx +29 -0
- package/src/components/HMSPreviewEditName.tsx +6 -5
- package/src/components/HMSPreviewHLSLiveIndicator.tsx +58 -0
- package/src/components/HMSPreviewJoinButton.tsx +44 -4
- package/src/components/HMSPreviewNetworkQuality.tsx +40 -0
- package/src/components/HMSPreviewPeersList.tsx +12 -72
- package/src/components/HMSPreviewSubtitle.tsx +27 -3
- package/src/components/HMSPreviewTile.tsx +13 -91
- package/src/components/HMSPreviewTitle.tsx +0 -1
- package/src/components/HMSRoomOptions.tsx +2 -8
- package/src/components/HMSShowNetworkQuality.tsx +0 -1
- package/src/components/Meeting.tsx +11 -0
- package/src/components/MenuModal/Menu.tsx +1 -1
- package/src/components/Modals.tsx +4 -299
- package/src/components/Participants/ParticipantsList.tsx +0 -24
- package/src/components/PeerSettingsModalContent.tsx +9 -23
- package/src/components/Preview.tsx +131 -48
- package/src/components/RoomSettingsModalContent.tsx +1 -138
- package/src/components/index.ts +0 -1
- package/src/hooks/useHmsInstance.ts +0 -1
- package/src/hooks-util-selectors.tsx +10 -0
- package/src/hooks-util.ts +168 -89
- package/src/redux/actionTypes.ts +8 -0
- package/src/redux/actions/index.ts +23 -2
- package/src/redux/reducers/appState.ts +9 -0
- package/src/redux/reducers/hmsStates.ts +28 -1
- package/src/redux/reducers/userState.ts +2 -2
- package/src/utils/theme.ts +6 -1
- package/src/utils/types.ts +3 -4
- package/src/utils.ts +2 -2
- package/lib/commonjs/components/HMSPreviewDeviceSettings.js.map +0 -1
- package/lib/commonjs/components/ZoomableView.js +0 -84
- package/lib/commonjs/components/ZoomableView.js.map +0 -1
- package/lib/module/components/HMSPreviewDeviceSettings.js +0 -296
- package/lib/module/components/HMSPreviewDeviceSettings.js.map +0 -1
- package/lib/module/components/ZoomableView.js +0 -76
- package/lib/module/components/ZoomableView.js.map +0 -1
- package/lib/typescript/components/HMSPreviewDeviceSettings.d.ts +0 -3
- package/lib/typescript/components/HMSPreviewDeviceSettings.d.ts.map +0 -1
- package/lib/typescript/components/ZoomableView.d.ts +0 -6
- package/lib/typescript/components/ZoomableView.d.ts.map +0 -1
- package/src/components/HMSPreviewDeviceSettings.tsx +0 -387
- package/src/components/ZoomableView.tsx +0 -91
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React
|
|
1
|
+
import React from 'react';
|
|
2
2
|
import {
|
|
3
3
|
View,
|
|
4
4
|
StyleSheet,
|
|
@@ -11,7 +11,6 @@ import {
|
|
|
11
11
|
InteractionManager,
|
|
12
12
|
} from 'react-native';
|
|
13
13
|
import {
|
|
14
|
-
HMSAudioFilePlayerNode,
|
|
15
14
|
HMSAudioMixingMode,
|
|
16
15
|
HMSUpdateListenerActions,
|
|
17
16
|
} from '@100mslive/react-native-hms';
|
|
@@ -21,7 +20,6 @@ import MaterialCommunityIcons from 'react-native-vector-icons/MaterialCommunityI
|
|
|
21
20
|
import Ionicons from 'react-native-vector-icons/Ionicons';
|
|
22
21
|
import MaterialIcons from 'react-native-vector-icons/MaterialIcons';
|
|
23
22
|
import EntypoIcons from 'react-native-vector-icons/Entypo';
|
|
24
|
-
import DocumentPicker from 'react-native-document-picker';
|
|
25
23
|
import { openSettings, requestNotifications } from 'react-native-permissions';
|
|
26
24
|
|
|
27
25
|
import { COLORS } from '../utils/theme';
|
|
@@ -34,7 +32,6 @@ import {
|
|
|
34
32
|
} from '../redux/actions';
|
|
35
33
|
import { ModalTypes, PipModes } from '../utils/types';
|
|
36
34
|
import { parseMetadata } from '../utils/functions';
|
|
37
|
-
import { getJoinConfig } from '../utils';
|
|
38
35
|
import { HMSShareScreen } from './HMSShareScreen';
|
|
39
36
|
import { ScreenShareIcon } from '../Icons';
|
|
40
37
|
|
|
@@ -63,11 +60,6 @@ export const RoomSettingsModalContent: React.FC<
|
|
|
63
60
|
setAudioDeviceListenerAdded,
|
|
64
61
|
setMuteAllTracksAudio,
|
|
65
62
|
}) => {
|
|
66
|
-
// REFS
|
|
67
|
-
const audioFilePlayerNodeRef = useRef(
|
|
68
|
-
new HMSAudioFilePlayerNode('audio_file_player_node')
|
|
69
|
-
);
|
|
70
|
-
|
|
71
63
|
// REDUX STATES & DISPATCH
|
|
72
64
|
const dispatch = useDispatch();
|
|
73
65
|
const hmsInstance = useSelector((state: RootState) => state.user.hmsInstance);
|
|
@@ -308,73 +300,6 @@ export const RoomSettingsModalContent: React.FC<
|
|
|
308
300
|
.catch((e) => console.log('Start Audioshare Error: ', e));
|
|
309
301
|
}
|
|
310
302
|
};
|
|
311
|
-
|
|
312
|
-
// iOS Audioshare
|
|
313
|
-
const setAudioShareVolume = () =>
|
|
314
|
-
setModalVisible(ModalTypes.SET_AUDIO_SHARE_VOLUME, true);
|
|
315
|
-
|
|
316
|
-
// iOS Audioshare
|
|
317
|
-
const playAudioShare = () => {
|
|
318
|
-
closeRoomSettingsModal();
|
|
319
|
-
setTimeout(() => {
|
|
320
|
-
DocumentPicker.pickSingle()
|
|
321
|
-
.then((result) => {
|
|
322
|
-
console.log('Document Picker Success: ', result);
|
|
323
|
-
audioFilePlayerNodeRef.current
|
|
324
|
-
.play(result?.uri, false, false)
|
|
325
|
-
.then((d) => {
|
|
326
|
-
console.log('Start Audioshare Success: ', d);
|
|
327
|
-
})
|
|
328
|
-
.catch((e) => console.log('Start Audioshare Error: ', e));
|
|
329
|
-
})
|
|
330
|
-
.catch((e) => console.log('Document Picker Error: ', e));
|
|
331
|
-
}, 500);
|
|
332
|
-
};
|
|
333
|
-
|
|
334
|
-
// iOS Audioshare
|
|
335
|
-
const stopAudioShare = () => {
|
|
336
|
-
closeRoomSettingsModal();
|
|
337
|
-
audioFilePlayerNodeRef.current.stop();
|
|
338
|
-
};
|
|
339
|
-
|
|
340
|
-
// iOS Audioshare
|
|
341
|
-
const pauseAudioShare = () => {
|
|
342
|
-
closeRoomSettingsModal();
|
|
343
|
-
audioFilePlayerNodeRef.current.pause();
|
|
344
|
-
};
|
|
345
|
-
|
|
346
|
-
// iOS Audioshare
|
|
347
|
-
const resumeAudioShare = () => {
|
|
348
|
-
closeRoomSettingsModal();
|
|
349
|
-
audioFilePlayerNodeRef.current.resume();
|
|
350
|
-
};
|
|
351
|
-
|
|
352
|
-
// iOS Audioshare
|
|
353
|
-
const isAudioSharePlaying = () => {
|
|
354
|
-
closeRoomSettingsModal();
|
|
355
|
-
audioFilePlayerNodeRef.current
|
|
356
|
-
.isPlaying()
|
|
357
|
-
.then((d) => console.log('Audioshare isPlaying: ', d))
|
|
358
|
-
.catch((e) => console.log('Audioshare isPlaying: ', e));
|
|
359
|
-
};
|
|
360
|
-
|
|
361
|
-
// iOS Audioshare
|
|
362
|
-
const getAudioShareDuration = () => {
|
|
363
|
-
closeRoomSettingsModal();
|
|
364
|
-
audioFilePlayerNodeRef.current
|
|
365
|
-
.duration()
|
|
366
|
-
.then((d) => console.log('Audioshare duration: ', d))
|
|
367
|
-
.catch((e) => console.log('Audioshare duration: ', e));
|
|
368
|
-
};
|
|
369
|
-
|
|
370
|
-
// iOS Audioshare
|
|
371
|
-
const getAudioShareCurrentDuration = () => {
|
|
372
|
-
closeRoomSettingsModal();
|
|
373
|
-
audioFilePlayerNodeRef.current
|
|
374
|
-
.currentDuration()
|
|
375
|
-
.then((d) => console.log('Audioshare currentDuration: ', d))
|
|
376
|
-
.catch((e) => console.log('Audioshare currentDuration: ', e));
|
|
377
|
-
};
|
|
378
303
|
//#endregion
|
|
379
304
|
|
|
380
305
|
return (
|
|
@@ -582,68 +507,6 @@ export const RoomSettingsModalContent: React.FC<
|
|
|
582
507
|
/>
|
|
583
508
|
</>
|
|
584
509
|
) : null}
|
|
585
|
-
|
|
586
|
-
{Platform.OS === 'ios' &&
|
|
587
|
-
getJoinConfig().audioMixer &&
|
|
588
|
-
localPeerRole?.publishSettings?.allowed?.includes('audio') ? (
|
|
589
|
-
<>
|
|
590
|
-
<SettingItem
|
|
591
|
-
onPress={playAudioShare}
|
|
592
|
-
text="Play Audio Share"
|
|
593
|
-
IconType={Ionicons}
|
|
594
|
-
iconName="play-outline"
|
|
595
|
-
/>
|
|
596
|
-
|
|
597
|
-
<SettingItem
|
|
598
|
-
onPress={stopAudioShare}
|
|
599
|
-
text="Stop Audio Share"
|
|
600
|
-
IconType={Ionicons}
|
|
601
|
-
iconName="stop-outline"
|
|
602
|
-
/>
|
|
603
|
-
|
|
604
|
-
<SettingItem
|
|
605
|
-
onPress={setAudioShareVolume}
|
|
606
|
-
text="Set Audio Share Volume"
|
|
607
|
-
IconType={Ionicons}
|
|
608
|
-
iconName="volume-high-outline"
|
|
609
|
-
/>
|
|
610
|
-
|
|
611
|
-
<SettingItem
|
|
612
|
-
onPress={pauseAudioShare}
|
|
613
|
-
text="Pause Audio Share"
|
|
614
|
-
IconType={Ionicons}
|
|
615
|
-
iconName="pause-outline"
|
|
616
|
-
/>
|
|
617
|
-
|
|
618
|
-
<SettingItem
|
|
619
|
-
onPress={resumeAudioShare}
|
|
620
|
-
text="Resume Audio Share"
|
|
621
|
-
IconType={Ionicons}
|
|
622
|
-
iconName="play-skip-forward-outline"
|
|
623
|
-
/>
|
|
624
|
-
|
|
625
|
-
<SettingItem
|
|
626
|
-
onPress={isAudioSharePlaying}
|
|
627
|
-
text="Is Audio Share Playing"
|
|
628
|
-
IconType={MaterialCommunityIcons}
|
|
629
|
-
iconName="file-question-outline"
|
|
630
|
-
/>
|
|
631
|
-
|
|
632
|
-
<SettingItem
|
|
633
|
-
onPress={getAudioShareDuration}
|
|
634
|
-
text="Audio Share Duration"
|
|
635
|
-
IconType={Ionicons}
|
|
636
|
-
iconName="timer-outline"
|
|
637
|
-
/>
|
|
638
|
-
|
|
639
|
-
<SettingItem
|
|
640
|
-
onPress={getAudioShareCurrentDuration}
|
|
641
|
-
text="Audio Share Current Duration"
|
|
642
|
-
IconType={Ionicons}
|
|
643
|
-
iconName="timer-outline"
|
|
644
|
-
/>
|
|
645
|
-
</>
|
|
646
|
-
) : null}
|
|
647
510
|
</>
|
|
648
511
|
) : null}
|
|
649
512
|
</ScrollView>
|
package/src/components/index.ts
CHANGED
|
@@ -12,7 +12,6 @@
|
|
|
12
12
|
// HMSVideoTrackSettings,
|
|
13
13
|
// } from '@100mslive/react-native-hms';
|
|
14
14
|
// import { useEffect, useState } from 'react';
|
|
15
|
-
// import { getModel } from 'react-native-device-info';
|
|
16
15
|
|
|
17
16
|
// export const useHmsInstance = () => {
|
|
18
17
|
// const [hmsInstance, setHmsInstance] = useState(null);
|
|
@@ -1,4 +1,14 @@
|
|
|
1
1
|
import type { HMSPeer } from '@100mslive/react-native-hms';
|
|
2
2
|
|
|
3
|
+
import type { RootState } from './redux';
|
|
4
|
+
|
|
3
5
|
export const selectIsHLSViewer = (peer: HMSPeer | null | undefined) =>
|
|
4
6
|
peer?.role?.name?.includes('hls') ?? false;
|
|
7
|
+
|
|
8
|
+
export const selectShouldGoLive = (state: RootState) => {
|
|
9
|
+
const isHLSStreaming = state.hmsStates.room?.hlsStreamingState.running;
|
|
10
|
+
const canStartHLSStreaming =
|
|
11
|
+
state.hmsStates.localPeer?.role?.permissions?.hlsStreaming;
|
|
12
|
+
|
|
13
|
+
return canStartHLSStreaming && !isHLSStreaming;
|
|
14
|
+
};
|
package/src/hooks-util.ts
CHANGED
|
@@ -23,18 +23,29 @@ import type {
|
|
|
23
23
|
HMSSessionStoreValue,
|
|
24
24
|
} from '@100mslive/react-native-hms';
|
|
25
25
|
import Toast from 'react-native-simple-toast';
|
|
26
|
-
import {
|
|
26
|
+
import {
|
|
27
|
+
useRef,
|
|
28
|
+
useCallback,
|
|
29
|
+
useEffect,
|
|
30
|
+
useState,
|
|
31
|
+
useMemo,
|
|
32
|
+
useContext,
|
|
33
|
+
} from 'react';
|
|
27
34
|
|
|
28
35
|
import { ModalTypes, PipModes } from './utils/types';
|
|
29
36
|
import type { PeerTrackNode } from './utils/types';
|
|
30
37
|
import { createPeerTrackNode, parseMetadata } from './utils/functions';
|
|
31
|
-
import { useDispatch, useSelector, useStore } from 'react-redux';
|
|
38
|
+
import { batch, useDispatch, useSelector, useStore } from 'react-redux';
|
|
32
39
|
import type { RootState } from './redux';
|
|
33
40
|
import {
|
|
34
41
|
addMessage,
|
|
35
42
|
addPinnedMessage,
|
|
43
|
+
addToPreviewPeersList,
|
|
44
|
+
changeMeetingState,
|
|
36
45
|
changePipModeStatus,
|
|
46
|
+
changeStartingHLSStream,
|
|
37
47
|
clearStore,
|
|
48
|
+
removeFromPreviewPeersList,
|
|
38
49
|
saveUserData,
|
|
39
50
|
setHMSLocalPeerState,
|
|
40
51
|
setHMSRoleState,
|
|
@@ -59,7 +70,7 @@ import {
|
|
|
59
70
|
LayoutAnimation,
|
|
60
71
|
Platform,
|
|
61
72
|
} from 'react-native';
|
|
62
|
-
import {
|
|
73
|
+
import { NavigationContext } from '@react-navigation/native';
|
|
63
74
|
import {
|
|
64
75
|
useIsLandscapeOrientation,
|
|
65
76
|
useIsPortraitOrientation,
|
|
@@ -68,27 +79,24 @@ import {
|
|
|
68
79
|
useSafeAreaFrame,
|
|
69
80
|
useSafeAreaInsets,
|
|
70
81
|
} from 'react-native-safe-area-context';
|
|
71
|
-
import { selectIsHLSViewer } from './hooks-util-selectors';
|
|
82
|
+
import { selectIsHLSViewer, selectShouldGoLive } from './hooks-util-selectors';
|
|
72
83
|
|
|
73
84
|
export const useHMSListeners = (
|
|
74
|
-
setPeerTrackNodes: React.Dispatch<React.SetStateAction<PeerTrackNode[]
|
|
75
|
-
setMeetingState: React.Dispatch<React.SetStateAction<MeetingState>>
|
|
85
|
+
setPeerTrackNodes: React.Dispatch<React.SetStateAction<PeerTrackNode[]>>
|
|
76
86
|
) => {
|
|
77
87
|
const hmsInstance = useHMSInstance();
|
|
78
88
|
const updateLocalPeer = useUpdateHMSLocalPeer(hmsInstance);
|
|
79
89
|
|
|
80
|
-
useHMSRoomUpdate(hmsInstance
|
|
90
|
+
useHMSRoomUpdate(hmsInstance);
|
|
81
91
|
|
|
82
92
|
useHMSPeersUpdate(hmsInstance, updateLocalPeer, setPeerTrackNodes);
|
|
83
93
|
|
|
84
94
|
useHMSTrackUpdate(hmsInstance, updateLocalPeer, setPeerTrackNodes);
|
|
85
95
|
};
|
|
86
96
|
|
|
87
|
-
const useHMSRoomUpdate = (
|
|
88
|
-
hmsInstance: HMSSDK,
|
|
89
|
-
setMeetingState: React.Dispatch<React.SetStateAction<MeetingState>>
|
|
90
|
-
) => {
|
|
97
|
+
const useHMSRoomUpdate = (hmsInstance: HMSSDK) => {
|
|
91
98
|
const dispatch = useDispatch();
|
|
99
|
+
const reduxStore = useStore();
|
|
92
100
|
|
|
93
101
|
useEffect(() => {
|
|
94
102
|
const roomUpdateHandler = (data: {
|
|
@@ -104,12 +112,14 @@ const useHMSRoomUpdate = (
|
|
|
104
112
|
* before ON_JOIN, if ON_ROOM comes then we can show Meeting screen to user, instead of Loader or Preview
|
|
105
113
|
*/
|
|
106
114
|
if (room.localPeer.role?.name?.includes('hls-') ?? false) {
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
115
|
+
const meetingState = (reduxStore.getState() as RootState).app
|
|
116
|
+
.meetingState;
|
|
117
|
+
|
|
118
|
+
batch(() => {
|
|
119
|
+
dispatch(setHMSLocalPeerState(room.localPeer));
|
|
120
|
+
if (meetingState !== MeetingState.IN_MEETING) {
|
|
121
|
+
dispatch(changeMeetingState(MeetingState.IN_MEETING));
|
|
111
122
|
}
|
|
112
|
-
return prevMeetingScreen;
|
|
113
123
|
});
|
|
114
124
|
}
|
|
115
125
|
|
|
@@ -135,6 +145,8 @@ const useHMSRoomUpdate = (
|
|
|
135
145
|
Toast.TOP
|
|
136
146
|
);
|
|
137
147
|
} else if (type === HMSRoomUpdate.HLS_STREAMING_STATE_UPDATED) {
|
|
148
|
+
dispatch(changeStartingHLSStream(false));
|
|
149
|
+
|
|
138
150
|
let streaming = room?.hlsStreamingState?.running;
|
|
139
151
|
|
|
140
152
|
Toast.showWithGravity(
|
|
@@ -208,64 +220,23 @@ const useHMSPeersUpdate = (
|
|
|
208
220
|
updateLocalPeer: () => void,
|
|
209
221
|
setPeerTrackNodes: React.Dispatch<React.SetStateAction<PeerTrackNode[]>>
|
|
210
222
|
) => {
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
// }
|
|
216
|
-
// if (type === HMSPeerUpdate.PEER_LEFT) {
|
|
217
|
-
// setPeerTrackNodes((prevPeerTrackNodes) =>
|
|
218
|
-
// removePeerTrackNodes(prevPeerTrackNodes, peer)
|
|
219
|
-
// );
|
|
220
|
-
// return;
|
|
221
|
-
// }
|
|
222
|
-
// if (peer.isLocal) {
|
|
223
|
-
// setPeerTrackNodes((prevPeerTrackNodes) => {
|
|
224
|
-
// if (peerTrackNodeExistForPeer(prevPeerTrackNodes, peer)) {
|
|
225
|
-
// return replacePeerTrackNodes(prevPeerTrackNodes, peer);
|
|
226
|
-
// }
|
|
227
|
-
// return prevPeerTrackNodes;
|
|
228
|
-
// });
|
|
229
|
-
|
|
230
|
-
// // - TODO: update local localPeer state
|
|
231
|
-
// // - Pass this updated data to Meeting component -> DisplayView component
|
|
232
|
-
// updateLocalPeer();
|
|
233
|
-
// return;
|
|
234
|
-
// }
|
|
235
|
-
// if (type === HMSPeerUpdate.ROLE_CHANGED) {
|
|
236
|
-
// if (
|
|
237
|
-
// peer.role?.publishSettings?.allowed === undefined ||
|
|
238
|
-
// (peer.role?.publishSettings?.allowed &&
|
|
239
|
-
// peer.role?.publishSettings?.allowed.length < 1)
|
|
240
|
-
// ) {
|
|
241
|
-
// setPeerTrackNodes((prevPeerTrackNodes) => {
|
|
242
|
-
// if (peerTrackNodeExistForPeer(prevPeerTrackNodes, peer)) {
|
|
243
|
-
// return removePeerTrackNodes(prevPeerTrackNodes, peer);
|
|
244
|
-
// }
|
|
245
|
-
// return prevPeerTrackNodes;
|
|
246
|
-
// });
|
|
247
|
-
// }
|
|
248
|
-
// return;
|
|
249
|
-
// }
|
|
250
|
-
// if (
|
|
251
|
-
// type === HMSPeerUpdate.METADATA_CHANGED ||
|
|
252
|
-
// type === HMSPeerUpdate.NAME_CHANGED ||
|
|
253
|
-
// type === HMSPeerUpdate.NETWORK_QUALITY_UPDATED
|
|
254
|
-
// ) {
|
|
255
|
-
// setPeerTrackNodes((prevPeerTrackNodes) => {
|
|
256
|
-
// if (peerTrackNodeExistForPeer(prevPeerTrackNodes, peer)) {
|
|
257
|
-
// return replacePeerTrackNodes(prevPeerTrackNodes, peer);
|
|
258
|
-
// }
|
|
259
|
-
// return prevPeerTrackNodes;
|
|
260
|
-
// });
|
|
261
|
-
// return;
|
|
262
|
-
// }
|
|
263
|
-
// },
|
|
264
|
-
// [hmsInstance]
|
|
265
|
-
// );
|
|
223
|
+
const dispatch = useDispatch();
|
|
224
|
+
const inMeeting = useSelector(
|
|
225
|
+
(state: RootState) => state.app.meetingState === MeetingState.IN_MEETING
|
|
226
|
+
);
|
|
266
227
|
|
|
267
228
|
useEffect(() => {
|
|
268
229
|
const peerUpdateHandler = ({ peer, type }: PeerUpdate) => {
|
|
230
|
+
// Handle State from Preview screen
|
|
231
|
+
if (!inMeeting) {
|
|
232
|
+
if (type === HMSPeerUpdate.PEER_JOINED) {
|
|
233
|
+
dispatch(addToPreviewPeersList(peer));
|
|
234
|
+
} else if (type === HMSPeerUpdate.PEER_LEFT) {
|
|
235
|
+
dispatch(removeFromPreviewPeersList(peer));
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
// Handle State for Meeting screen
|
|
269
240
|
if (type === HMSPeerUpdate.PEER_JOINED) {
|
|
270
241
|
return;
|
|
271
242
|
}
|
|
@@ -326,7 +297,7 @@ const useHMSPeersUpdate = (
|
|
|
326
297
|
return () => {
|
|
327
298
|
hmsInstance.removeEventListener(HMSUpdateListenerActions.ON_PEER_UPDATE);
|
|
328
299
|
};
|
|
329
|
-
}, [hmsInstance]);
|
|
300
|
+
}, [inMeeting, hmsInstance]); // TODO: When `inMeeting` becomes true Peer Update is resubscribed, we might lose some events during that time
|
|
330
301
|
};
|
|
331
302
|
|
|
332
303
|
type TrackUpdate = {
|
|
@@ -773,7 +744,7 @@ export const useHMSPIPRoomLeave = () => {
|
|
|
773
744
|
const hmsInstance = useHMSInstance();
|
|
774
745
|
const dispatch = useDispatch();
|
|
775
746
|
// TODO: What if this is undefined?
|
|
776
|
-
const navigation =
|
|
747
|
+
const navigation = useContext(NavigationContext);
|
|
777
748
|
|
|
778
749
|
useEffect(() => {
|
|
779
750
|
const pipRoomLeaveHandler = () => {
|
|
@@ -801,13 +772,15 @@ export const useHMSPIPRoomLeave = () => {
|
|
|
801
772
|
// dispatch(clearPeerData());
|
|
802
773
|
// dispatch(clearHmsReference());
|
|
803
774
|
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
775
|
+
if (navigation && navigation.canGoBack()) {
|
|
776
|
+
navigation.goBack();
|
|
777
|
+
dispatch(clearStore());
|
|
778
|
+
} else {
|
|
779
|
+
// TODO: call onLeave Callback if provided
|
|
780
|
+
// Otherwise default action is to show "Meeting Ended" screen
|
|
781
|
+
dispatch(clearStore()); // TODO: We need different clearStore for MeetingEnded
|
|
782
|
+
dispatch(changeMeetingState(MeetingState.MEETING_ENDED));
|
|
783
|
+
}
|
|
811
784
|
})
|
|
812
785
|
.catch((e) => {
|
|
813
786
|
console.log(`Destroy HMS instance Error: ${e}`);
|
|
@@ -834,7 +807,7 @@ export const useHMSRemovedFromRoomUpdate = () => {
|
|
|
834
807
|
const hmsInstance = useHMSInstance();
|
|
835
808
|
const dispatch = useDispatch();
|
|
836
809
|
// TODO: What if this is undefined?
|
|
837
|
-
const navigation =
|
|
810
|
+
const navigation = useContext(NavigationContext);
|
|
838
811
|
|
|
839
812
|
useEffect(() => {
|
|
840
813
|
const removedFromRoomHandler = () => {
|
|
@@ -862,13 +835,15 @@ export const useHMSRemovedFromRoomUpdate = () => {
|
|
|
862
835
|
// dispatch(clearPeerData());
|
|
863
836
|
// dispatch(clearHmsReference());
|
|
864
837
|
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
838
|
+
if (navigation && navigation.canGoBack()) {
|
|
839
|
+
navigation.goBack();
|
|
840
|
+
dispatch(clearStore());
|
|
841
|
+
} else {
|
|
842
|
+
// TODO: call onLeave Callback if provided
|
|
843
|
+
// Otherwise default action is to show "Meeting Ended" screen
|
|
844
|
+
dispatch(clearStore()); // TODO: We need different clearStore for MeetingEnded
|
|
845
|
+
dispatch(changeMeetingState(MeetingState.MEETING_ENDED));
|
|
846
|
+
}
|
|
872
847
|
})
|
|
873
848
|
.catch((e) => {
|
|
874
849
|
console.log(`Destroy HMS instance Error: ${e}`);
|
|
@@ -1050,7 +1025,18 @@ export const useHMSConfig = () => {
|
|
|
1050
1025
|
return hmsConfig;
|
|
1051
1026
|
}, [hmsInstance]);
|
|
1052
1027
|
|
|
1053
|
-
|
|
1028
|
+
const updateConfig = useCallback((data: Partial<HMSConfig>) => {
|
|
1029
|
+
if (!hmsConfig) {
|
|
1030
|
+
throw new Error('No HMSConfig is available to update!');
|
|
1031
|
+
}
|
|
1032
|
+
|
|
1033
|
+
Object.entries(data).forEach(([key, value]) => {
|
|
1034
|
+
// @ts-ignore
|
|
1035
|
+
hmsConfig[key] = value;
|
|
1036
|
+
});
|
|
1037
|
+
}, []);
|
|
1038
|
+
|
|
1039
|
+
return { clearConfig, updateConfig, getConfig };
|
|
1054
1040
|
};
|
|
1055
1041
|
|
|
1056
1042
|
export const useSafeDimensions = () => {
|
|
@@ -1186,3 +1172,96 @@ export const useFilteredParticipants = () => {
|
|
|
1186
1172
|
setSearchText: setParticipantsSearchInput,
|
|
1187
1173
|
};
|
|
1188
1174
|
};
|
|
1175
|
+
|
|
1176
|
+
export const useShouldGoLive = () => {
|
|
1177
|
+
const shouldGoLive = useSelector(selectShouldGoLive);
|
|
1178
|
+
|
|
1179
|
+
return shouldGoLive;
|
|
1180
|
+
};
|
|
1181
|
+
|
|
1182
|
+
export const useLeaveMethods = () => {
|
|
1183
|
+
const navigation = useContext(NavigationContext);
|
|
1184
|
+
const hmsInstance = useHMSInstance();
|
|
1185
|
+
const dispatch = useDispatch();
|
|
1186
|
+
|
|
1187
|
+
const destroy = useCallback(async () => {
|
|
1188
|
+
try {
|
|
1189
|
+
const s = await hmsInstance.destroy();
|
|
1190
|
+
console.log('Destroy Success: ', s);
|
|
1191
|
+
// TODOS:
|
|
1192
|
+
// - If show `Meeting_Ended` is true, show Meeting screen by setting state to MEETING_ENDED
|
|
1193
|
+
// - Reset Redux States
|
|
1194
|
+
// - HMSInstance will not be available now
|
|
1195
|
+
// - When your presses "Re Join" Action button, restart process from root component
|
|
1196
|
+
// - When your presses "Done" Action button
|
|
1197
|
+
// - If we have callback fn, call it
|
|
1198
|
+
// - Otherwise try our best to navigate away from current screen
|
|
1199
|
+
//
|
|
1200
|
+
// - No screen to show
|
|
1201
|
+
// - No need to reset redux state?
|
|
1202
|
+
// - HMSInstance will be available till this point
|
|
1203
|
+
// - If we have callback fn, call it
|
|
1204
|
+
// - Otherwise try our best to navigate away from current screen
|
|
1205
|
+
// - When we are navigated away from screen, HMSInstance will be not available
|
|
1206
|
+
|
|
1207
|
+
// dispatch(clearMessageData());
|
|
1208
|
+
// dispatch(clearPeerData());
|
|
1209
|
+
// dispatch(clearHmsReference());
|
|
1210
|
+
|
|
1211
|
+
if (navigation && navigation.canGoBack()) {
|
|
1212
|
+
navigation.goBack();
|
|
1213
|
+
dispatch(clearStore());
|
|
1214
|
+
} else {
|
|
1215
|
+
// TODO: call onLeave Callback if provided
|
|
1216
|
+
// Otherwise default action is to show "Meeting Ended" screen
|
|
1217
|
+
dispatch(clearStore()); // TODO: We need different clearStore for MeetingEnded
|
|
1218
|
+
dispatch(changeMeetingState(MeetingState.MEETING_ENDED));
|
|
1219
|
+
}
|
|
1220
|
+
} catch (e) {
|
|
1221
|
+
console.log(`Destroy HMS instance Error: ${e}`);
|
|
1222
|
+
Toast.showWithGravity(
|
|
1223
|
+
`Destroy HMS instance Error: ${e}`,
|
|
1224
|
+
Toast.LONG,
|
|
1225
|
+
Toast.TOP
|
|
1226
|
+
);
|
|
1227
|
+
return Promise.reject(e);
|
|
1228
|
+
}
|
|
1229
|
+
}, [hmsInstance]);
|
|
1230
|
+
|
|
1231
|
+
const leave = useCallback(async () => {
|
|
1232
|
+
try {
|
|
1233
|
+
const d = await hmsInstance.leave();
|
|
1234
|
+
console.log('Leave Success: ', d);
|
|
1235
|
+
await destroy();
|
|
1236
|
+
} catch (e) {
|
|
1237
|
+
console.log(`Leave Room Error: ${e}`);
|
|
1238
|
+
Toast.showWithGravity(`Leave Room Error: ${e}`, Toast.LONG, Toast.TOP);
|
|
1239
|
+
}
|
|
1240
|
+
}, [destroy, hmsInstance]);
|
|
1241
|
+
|
|
1242
|
+
const goToPreview = useCallback(async () => {
|
|
1243
|
+
try {
|
|
1244
|
+
await hmsInstance.leave();
|
|
1245
|
+
await hmsInstance.destroy();
|
|
1246
|
+
dispatch(clearStore());
|
|
1247
|
+
} catch (error) {
|
|
1248
|
+
Toast.showWithGravity(
|
|
1249
|
+
`Unable to go to Preview: ${error}`,
|
|
1250
|
+
Toast.LONG,
|
|
1251
|
+
Toast.TOP
|
|
1252
|
+
);
|
|
1253
|
+
}
|
|
1254
|
+
}, [hmsInstance]);
|
|
1255
|
+
|
|
1256
|
+
const endRoom = useCallback(async () => {
|
|
1257
|
+
try {
|
|
1258
|
+
const d = await hmsInstance.endRoom('Host ended the room');
|
|
1259
|
+
console.log('EndRoom Success: ', d);
|
|
1260
|
+
await destroy();
|
|
1261
|
+
} catch (e) {
|
|
1262
|
+
console.log('EndRoom Error: ', e);
|
|
1263
|
+
}
|
|
1264
|
+
}, [destroy, hmsInstance]);
|
|
1265
|
+
|
|
1266
|
+
return { destroy, leave, endRoom, goToPreview };
|
|
1267
|
+
};
|
package/src/redux/actionTypes.ts
CHANGED
|
@@ -48,6 +48,10 @@ const SET_MODAL_TYPE = 'SET_MODAL_TYPE';
|
|
|
48
48
|
|
|
49
49
|
const SET_PEER_TO_UPDATE = 'SET_PEER_TO_UPDATE';
|
|
50
50
|
|
|
51
|
+
const SET_MEETING_STATE = 'SET_MEETING_STATE';
|
|
52
|
+
|
|
53
|
+
const SET_STARTING_HLS_STREAM = 'SET_STARTING_HLS_STREAM';
|
|
54
|
+
|
|
51
55
|
export default {
|
|
52
56
|
ADD_PINNED_MESSAGE,
|
|
53
57
|
ADD_MESSAGE,
|
|
@@ -69,6 +73,8 @@ export default {
|
|
|
69
73
|
SET_RTC_STATS,
|
|
70
74
|
SET_MODAL_TYPE,
|
|
71
75
|
SET_PEER_TO_UPDATE,
|
|
76
|
+
SET_MEETING_STATE,
|
|
77
|
+
SET_STARTING_HLS_STREAM,
|
|
72
78
|
};
|
|
73
79
|
|
|
74
80
|
export enum HmsStateActionTypes {
|
|
@@ -82,4 +88,6 @@ export enum HmsStateActionTypes {
|
|
|
82
88
|
SET_IS_LOCAL_SCREEN_SHARED_STATE = 'SET_IS_LOCAL_SCREEN_SHARED_STATE',
|
|
83
89
|
SET_ROOM_LOCALLY_MUTED = 'SET_ROOM_LOCALLY_MUTED',
|
|
84
90
|
SET_USER_NAME = 'SET_USER_NAME',
|
|
91
|
+
ADD_TO_PREVIEW_PEERS_LIST = 'ADD_TO_PREVIEW_PEERS_LIST',
|
|
92
|
+
REMOVE_FROM_PREVIEW_PEERS_LIST = 'REMOVE_FROM_PREVIEW_PEERS_LIST',
|
|
85
93
|
}
|
|
@@ -11,12 +11,13 @@ import type {
|
|
|
11
11
|
HMSSessionStore,
|
|
12
12
|
} from '@100mslive/react-native-hms';
|
|
13
13
|
import type {
|
|
14
|
-
|
|
14
|
+
HMSIOSScreenShareConfig,
|
|
15
15
|
ModalTypes,
|
|
16
16
|
PeerTrackNode,
|
|
17
17
|
PipModes,
|
|
18
18
|
} from '../../utils/types';
|
|
19
19
|
import actionTypes, { HmsStateActionTypes } from '../actionTypes';
|
|
20
|
+
import { MeetingState } from '../../types';
|
|
20
21
|
|
|
21
22
|
export const setPrebuiltData = (data: {
|
|
22
23
|
roomCode: string;
|
|
@@ -28,7 +29,7 @@ export const setPrebuiltData = (data: {
|
|
|
28
29
|
init: string;
|
|
29
30
|
token: string;
|
|
30
31
|
};
|
|
31
|
-
ios?:
|
|
32
|
+
ios?: HMSIOSScreenShareConfig;
|
|
32
33
|
};
|
|
33
34
|
}) => ({
|
|
34
35
|
type: HmsStateActionTypes.SET_PREBUILT_DATA,
|
|
@@ -194,3 +195,23 @@ export const setPeerToUpdate = (peerToUpdate: HMSPeer) => ({
|
|
|
194
195
|
type: actionTypes.SET_PEER_TO_UPDATE,
|
|
195
196
|
payload: { peerToUpdate },
|
|
196
197
|
});
|
|
198
|
+
|
|
199
|
+
export const addToPreviewPeersList = (peer: HMSPeer) => ({
|
|
200
|
+
type: HmsStateActionTypes.ADD_TO_PREVIEW_PEERS_LIST,
|
|
201
|
+
peer,
|
|
202
|
+
});
|
|
203
|
+
|
|
204
|
+
export const removeFromPreviewPeersList = (peer: HMSPeer) => ({
|
|
205
|
+
type: HmsStateActionTypes.REMOVE_FROM_PREVIEW_PEERS_LIST,
|
|
206
|
+
peerId: peer.peerID,
|
|
207
|
+
});
|
|
208
|
+
|
|
209
|
+
export const changeMeetingState = (meetingState: MeetingState) => ({
|
|
210
|
+
type: actionTypes.SET_MEETING_STATE,
|
|
211
|
+
payload: { meetingState },
|
|
212
|
+
});
|
|
213
|
+
|
|
214
|
+
export const changeStartingHLSStream = (startingHLSStream: boolean) => ({
|
|
215
|
+
type: actionTypes.SET_STARTING_HLS_STREAM,
|
|
216
|
+
payload: { startingHLSStream },
|
|
217
|
+
});
|
|
@@ -9,6 +9,7 @@ import {
|
|
|
9
9
|
HMSRemoteAudioStats,
|
|
10
10
|
HMSRemoteVideoStats,
|
|
11
11
|
} from '@100mslive/react-native-hms';
|
|
12
|
+
import { MeetingState } from '../../types';
|
|
12
13
|
|
|
13
14
|
type ActionType = {
|
|
14
15
|
payload: { [key: string]: any };
|
|
@@ -37,6 +38,8 @@ type IntialStateType = {
|
|
|
37
38
|
};
|
|
38
39
|
modalType: ModalTypes;
|
|
39
40
|
peerToUpdate: HMSPeer | null;
|
|
41
|
+
meetingState: MeetingState;
|
|
42
|
+
startingHLSStream: boolean;
|
|
40
43
|
};
|
|
41
44
|
|
|
42
45
|
const INITIAL_STATE: IntialStateType = {
|
|
@@ -54,6 +57,8 @@ const INITIAL_STATE: IntialStateType = {
|
|
|
54
57
|
},
|
|
55
58
|
modalType: ModalTypes.DEFAULT,
|
|
56
59
|
peerToUpdate: null,
|
|
60
|
+
meetingState: MeetingState.NOT_JOINED,
|
|
61
|
+
startingHLSStream: false,
|
|
57
62
|
};
|
|
58
63
|
|
|
59
64
|
const appReducer = (
|
|
@@ -133,6 +138,10 @@ const appReducer = (
|
|
|
133
138
|
[action.payload.trackId]: action.payload.stats,
|
|
134
139
|
},
|
|
135
140
|
};
|
|
141
|
+
case ActionTypes.SET_MEETING_STATE:
|
|
142
|
+
return { ...state, meetingState: action.payload.meetingState };
|
|
143
|
+
case ActionTypes.SET_STARTING_HLS_STREAM:
|
|
144
|
+
return { ...state, startingHLSStream: action.payload.startingHLSStream };
|
|
136
145
|
case HmsStateActionTypes.CLEAR_STATES:
|
|
137
146
|
return INITIAL_STATE;
|
|
138
147
|
default:
|