agora-appbuilder-core 2.3.0-beta.9 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Readme.md +11 -6
- package/package.json +1 -1
- package/template/Gulpfile.js +121 -83
- package/template/_gitignore +2 -2
- package/template/_package-lock.json +12959 -13248
- package/template/agora-rn-uikit/src/AgoraUIKit.tsx +2 -2
- package/template/agora-rn-uikit/src/Contexts/PropsContext.tsx +2 -0
- package/template/agora-rn-uikit/src/Contexts/RtcContext.tsx +3 -3
- package/template/agora-rn-uikit/src/Controls/BtnTemplate.tsx +4 -5
- package/template/agora-rn-uikit/src/Controls/ImageIcon.tsx +3 -1
- package/template/agora-rn-uikit/src/Controls/LocalControls.tsx +2 -2
- package/template/agora-rn-uikit/src/Reducer/LocalMuteAudio.ts +1 -1
- package/template/agora-rn-uikit/src/Reducer/LocalMuteVideo.ts +1 -1
- package/template/agora-rn-uikit/src/Reducer/RemoteAudioStateChanged.ts +1 -1
- package/template/agora-rn-uikit/src/Reducer/RemoteVideoStateChanged.ts +1 -1
- package/template/agora-rn-uikit/src/Reducer/UpdateDualStreamMode.ts +4 -4
- package/template/agora-rn-uikit/src/Reducer/UserJoined.ts +7 -5
- package/template/agora-rn-uikit/src/Reducer/UserMuteRemoteAudio.ts +1 -1
- package/template/agora-rn-uikit/src/Reducer/UserMuteRemoteVideo.ts +1 -1
- package/template/agora-rn-uikit/src/Reducer/UserOffline.ts +2 -2
- package/template/agora-rn-uikit/src/Rtc/Create.tsx +88 -43
- package/template/agora-rn-uikit/src/Rtc/Join.tsx +13 -4
- package/template/agora-rn-uikit/src/RtcConfigure.tsx +36 -19
- package/template/agora-rn-uikit/src/Utils/permission.ts +17 -6
- package/template/babel.config.js +9 -9
- package/template/bridge/rtc/webNg/RtcEngine.ts +51 -26
- package/template/customization-api/action-library.ts +22 -0
- package/template/{fpe-api/context.ts → customization-api/app-state.ts} +16 -14
- package/template/customization-api/customEvents.ts +9 -0
- package/template/{fpe-api/install.ts → customization-api/customize.ts} +27 -26
- package/template/{fpe-api → customization-api}/index.ts +11 -6
- package/template/{fpe-api/components.ts → customization-api/sub-components.ts} +22 -3
- package/template/{fpe-api → customization-api}/typeDefinition.ts +13 -14
- package/template/customization-api/utils.ts +30 -0
- package/template/{fpe-implementation → customization-implementation}/createHook.ts +0 -0
- package/template/{fpe-implementation/dummyFpe.ts → customization-implementation/dummyConfig.ts} +4 -4
- package/template/customization-implementation/index.ts +4 -0
- package/template/{fpe-api/useFpe.tsx → customization-implementation/useCustomization.tsx} +12 -12
- package/template/{fpe.config.js → customization.config.js} +11 -11
- package/template/electron/main/index.js +42 -35
- package/template/esbuild.rsdk.go +8 -17
- package/template/global.d.ts +4 -3
- package/template/index.rsdk.tsx +13 -5
- package/template/index.wsdk.tsx +21 -5
- package/template/package.json +3 -0
- package/template/react-native-toast-message/src/index.js +3 -7
- package/template/react-native-toast-message/src/{index.wsdk.js → index.sdk.tsx} +1 -1
- package/template/react-native-toast-message/src/styles.sdk.ts +17 -0
- package/template/src/App.tsx +8 -4
- package/template/src/AppWrapper.tsx +8 -6
- package/template/src/SDKAppWrapper.tsx +28 -21
- package/template/src/app-state/useLocalUserInfo.ts +8 -0
- package/template/src/app-state/useMessages.ts +52 -0
- package/template/src/atoms/PrimaryButton.tsx +2 -2
- package/template/src/atoms/SecondaryButton.tsx +12 -4
- package/template/src/atoms/TextInput.tsx +2 -2
- package/template/src/components/Chat.tsx +22 -11
- package/template/src/components/ChatContext.ts +10 -27
- package/template/src/components/Controls.native.tsx +13 -7
- package/template/src/components/Controls.tsx +15 -24
- package/template/src/components/DeviceConfigure.tsx +4 -3
- package/template/src/components/EventsConfigure.tsx +54 -0
- package/template/src/components/GridVideo.tsx +5 -6
- package/template/src/components/HostControlView.tsx +13 -19
- package/template/src/components/Navbar.tsx +54 -41
- package/template/src/components/NetworkQualityContext.tsx +4 -3
- package/template/src/components/ParticipantsView.tsx +7 -7
- package/template/src/components/PinnedVideo.tsx +3 -4
- package/template/src/components/Precall.native.tsx +3 -3
- package/template/src/components/Precall.tsx +14 -10
- package/template/src/components/RTMConfigure.tsx +61 -219
- package/template/src/components/SettingsView.tsx +6 -3
- package/template/src/components/Share.tsx +24 -18
- package/template/src/components/chat-messages/useChatMessages.tsx +397 -80
- package/template/src/components/chat-notification/useChatNotification.tsx +2 -2
- package/template/src/components/chat-ui/useChatUIControl.tsx +1 -1
- package/template/src/components/common/Logo.tsx +3 -2
- package/template/src/components/contexts/LiveStreamDataContext.tsx +3 -3
- package/template/src/components/contexts/ScreenShareContext.tsx +3 -1
- package/template/src/components/contexts/VideoMeetingDataContext.tsx +85 -0
- package/template/src/components/contexts/WhiteboardContext.tsx +8 -8
- package/template/src/components/livestream/LiveStreamContext.tsx +88 -74
- package/template/src/components/meeting-info/useMeetingInfo.tsx +23 -19
- package/template/src/components/meeting-info/useSetMeetingInfo.tsx +1 -1
- package/template/src/components/participants/AllAudienceParticipants.tsx +2 -2
- package/template/src/components/participants/AllHostParticipants.tsx +4 -4
- package/template/src/components/participants/MeParticipant.tsx +5 -3
- package/template/src/components/participants/ParticipantName.tsx +2 -2
- package/template/src/components/participants/RemoteParticipants.tsx +9 -7
- package/template/src/components/precall/LocalMute.native.tsx +14 -10
- package/template/src/components/precall/LocalMute.tsx +7 -5
- package/template/src/components/precall/VideoPreview.native.tsx +6 -6
- package/template/src/components/precall/VideoPreview.tsx +3 -3
- package/template/src/components/precall/joinCallBtn.tsx +3 -3
- package/template/src/components/precall/meetingTitle.tsx +3 -1
- package/template/src/components/precall/selectDevice.tsx +2 -2
- package/template/src/components/precall/usePreCall.tsx +1 -1
- package/template/src/components/styles.ts +3 -3
- package/template/src/components/useShareLink.tsx +69 -29
- package/template/src/components/useUserPreference.tsx +16 -15
- package/template/src/components/useWakeLock.tsx +3 -3
- package/template/src/language/i18nTypes.ts +1 -1
- package/template/src/language/index.ts +2 -2
- package/template/src/language/useLanguage.tsx +2 -3
- package/template/src/pages/Authenticate.tsx +3 -2
- package/template/src/pages/Create.tsx +18 -20
- package/template/src/pages/Join.tsx +6 -7
- package/template/src/pages/VideoCall.tsx +74 -66
- package/template/src/pages/create/useCreate.tsx +1 -1
- package/template/src/pages/video-call/CustomUserContextHolder.tsx +14 -6
- package/template/src/pages/video-call/DefaultLayouts.ts +8 -8
- package/template/src/pages/video-call/{NameWithMicStatus.tsx → NameWithMicIcon.tsx} +8 -1
- package/template/src/pages/video-call/RenderComponent.tsx +7 -10
- package/template/src/pages/video-call/VideoCallScreen.tsx +31 -22
- package/template/src/pages/video-call/VideoComponent.tsx +13 -15
- package/template/src/pages/video-call/VideoRenderer.tsx +6 -6
- package/template/src/pages/video-call/useLayoutsData.ts +23 -0
- package/template/src/rtm/RTMEngine.ts +13 -0
- package/template/src/rtm-events/EventUtils.ts +20 -20
- package/template/src/rtm-events/EventsQueue.ts +9 -3
- package/template/src/rtm-events/constants.ts +5 -0
- package/template/src/rtm-events/index.tsx +1 -3
- package/template/src/{custom-events/CustomEvents.ts → rtm-events-api/Events.ts} +67 -61
- package/template/src/rtm-events-api/index.tsx +6 -0
- package/template/src/rtm-events-api/types.ts +22 -0
- package/template/src/subComponents/ChatBubble.tsx +24 -8
- package/template/src/subComponents/ChatContainer.tsx +24 -15
- package/template/src/subComponents/ChatInput.tsx +56 -42
- package/template/src/subComponents/LanguageSelector.tsx +2 -2
- package/template/src/subComponents/LayoutIconDropdown.native.tsx +5 -5
- package/template/src/subComponents/LayoutIconDropdown.tsx +7 -7
- package/template/src/subComponents/LocalAudioMute.tsx +3 -4
- package/template/src/subComponents/LocalEndCall.tsx +3 -6
- package/template/src/subComponents/LocalSwitchCamera.tsx +3 -4
- package/template/src/subComponents/LocalVideoMute.tsx +3 -3
- package/template/src/subComponents/NetworkQualityPill.tsx +8 -9
- package/template/src/subComponents/OpenInNativeButton.tsx +2 -3
- package/template/src/subComponents/RemoteAudioMute.tsx +5 -11
- package/template/src/subComponents/RemoteEndCall.tsx +3 -10
- package/template/src/subComponents/RemoteVideoMute.tsx +3 -10
- package/template/src/subComponents/SelectDevice.tsx +1 -1
- package/template/src/subComponents/SelectOAuth.tsx +3 -2
- package/template/src/subComponents/SidePanelButtons.ts +6 -5
- package/template/src/subComponents/TextWithTooltip.tsx +6 -2
- package/template/src/subComponents/{toastConfig.tsx → ToastConfig.tsx} +2 -2
- package/template/src/subComponents/chat/ChatParticipants.tsx +6 -5
- package/template/src/subComponents/livestream/CurrentLiveStreamRequestsView.tsx +2 -2
- package/template/src/subComponents/livestream/controls/RemoteLiveStreamApprovedRequestRecall.tsx +4 -3
- package/template/src/subComponents/livestream/controls/RemoteLiveStreamRequestApprove.tsx +2 -2
- package/template/src/subComponents/livestream/controls/RemoteLiveStreamRequestReject.tsx +2 -4
- package/template/src/subComponents/livestream/index.ts +2 -2
- package/template/src/subComponents/recording/useRecording.tsx +44 -23
- package/template/src/subComponents/recording/useRecordingLayoutQuery.tsx +11 -5
- package/template/src/subComponents/screenshare/ScreenshareConfigure.native.tsx +46 -34
- package/template/src/subComponents/screenshare/ScreenshareConfigure.tsx +97 -38
- package/template/src/subComponents/screenshare/useScreenshare.tsx +1 -1
- package/template/src/utils/SdkEvents.ts +9 -46
- package/template/src/utils/common.tsx +25 -9
- package/template/src/utils/getUniqueID.ts +5 -0
- package/template/src/utils/isMobileOrTablet.native.ts +2 -2
- package/template/src/utils/isMobileOrTablet.ts +21 -8
- package/template/src/utils/useButtonTemplate.tsx +1 -1
- package/template/src/utils/useCreateMeeting.ts +21 -10
- package/template/src/utils/useGetMeetingPhrase.ts +11 -8
- package/template/src/utils/{IsAttendeeUser.ts → useIsAttendee.ts} +3 -1
- package/template/src/utils/{isAudioEnabled.ts → useIsAudioEnabled.ts} +4 -4
- package/template/src/utils/{isHostUser.ts → useIsHost.ts} +13 -16
- package/template/src/utils/{isPSTNUser.ts → useIsPSTN.ts} +2 -2
- package/template/src/utils/{isScreenShareUser.ts → useIsScreenShare.ts} +0 -0
- package/template/src/utils/{isVideoEnabled.ts → useIsVideoEnabled.ts} +5 -6
- package/template/src/utils/useJoinMeeting.ts +8 -6
- package/template/src/utils/useLayout.tsx +5 -5
- package/template/src/utils/useMutePSTN.ts +5 -3
- package/template/src/utils/useMuteToggleLocal.ts +3 -4
- package/template/src/utils/useRemoteEndCall.ts +11 -10
- package/template/src/utils/useRemoteMute.ts +42 -20
- package/template/src/utils/useSidePanel.tsx +1 -1
- package/template/src/utils/useString.ts +2 -2
- package/template/src/utils/useUserName.ts +11 -0
- package/template/tsconfig_fpeApi.json +8 -9
- package/template/tsconfig_rsdk_index.json +8 -9
- package/template/tsconfig_wsdk_index.json +8 -9
- package/template/webpack.commons.js +9 -9
- package/template/webpack.rsdk.config.js +4 -2
- package/template/webpack.ts.config.js +6 -6
- package/template/webpack.wsdk.config.js +2 -1
- package/template/fpe-api/fpeEvents.ts +0 -9
- package/template/fpe-api/utils.ts +0 -61
- package/template/fpe-implementation/index.ts +0 -1
- package/template/fpe-todo.txt +0 -14
- package/template/src/components/RTMEvents.tsx +0 -84
- package/template/src/custom-events/index.tsx +0 -4
- package/template/src/custom-events/types.ts +0 -51
- package/template/src/pages/video-call/CustomLayout.ts +0 -17
- package/template/src/rtm-events/types.ts +0 -7
- package/template/src/utils/getMeetingInvite.ts +0 -53
- package/template/src/utils/useGroupMessages.ts +0 -24
- package/template/src/utils/useNavParams.ts +0 -6
- package/template/src/utils/useNavigateTo.ts +0 -8
- package/template/src/utils/usePrivateMessages.ts +0 -33
- package/template/src/utils/useSendControlMessage.ts +0 -51
- package/template/src/utils/useSendMessage.ts +0 -40
- package/template/src/utils/useSetUnreadMessageCount.ts +0 -43
- package/template/src/utils/useUnreadMessageCount.ts +0 -50
- package/template/src/utils/useUserList.ts +0 -26
|
@@ -10,13 +10,15 @@
|
|
|
10
10
|
*********************************************
|
|
11
11
|
*/
|
|
12
12
|
import React from 'react';
|
|
13
|
-
import {Platform} from 'react-native';
|
|
13
|
+
import {Platform as ReactNativePlatform} from 'react-native';
|
|
14
|
+
import Platform from '../subComponents/Platform';
|
|
15
|
+
|
|
14
16
|
import * as ReactIs from 'react-is';
|
|
15
17
|
|
|
16
18
|
const isValidReactComponent = <T,>(Component?: React.ComponentType<T>) =>
|
|
17
19
|
Component && ReactIs.isValidElementType(Component) ? true : false;
|
|
18
20
|
|
|
19
|
-
const
|
|
21
|
+
const useHasBrandLogo = () => () => !!$config.LOGO;
|
|
20
22
|
|
|
21
23
|
const shouldAuthenticate: boolean =
|
|
22
24
|
$config.ENABLE_APPLE_OAUTH ||
|
|
@@ -24,17 +26,31 @@ const shouldAuthenticate: boolean =
|
|
|
24
26
|
$config.ENABLE_MICROSOFT_OAUTH ||
|
|
25
27
|
$config.ENABLE_SLACK_OAUTH;
|
|
26
28
|
|
|
27
|
-
|
|
28
|
-
const
|
|
29
|
-
|
|
29
|
+
//for our internal usage don't check Platform - electron and web will same kind ui checks. thats why we have isWeb for external usage
|
|
30
|
+
const isWebInternal = () => ReactNativePlatform.OS === 'web';
|
|
31
|
+
|
|
32
|
+
const isWeb = () => Platform === 'web' && ReactNativePlatform.OS === 'web';
|
|
33
|
+
|
|
34
|
+
const isAndroid = () =>
|
|
35
|
+
//@ts-ignore
|
|
36
|
+
Platform === 'native' && ReactNativePlatform.OS === 'android';
|
|
37
|
+
|
|
38
|
+
//@ts-ignore
|
|
39
|
+
const isIOS = () => Platform === 'native' && ReactNativePlatform.OS === 'ios';
|
|
40
|
+
|
|
41
|
+
//@ts-ignore
|
|
42
|
+
const isDestop = () => Platform === 'electron';
|
|
43
|
+
|
|
30
44
|
const isArray = (data: any[]) =>
|
|
31
45
|
data && Array.isArray(data) && data.length ? true : false ? true : false;
|
|
32
46
|
export {
|
|
33
|
-
|
|
34
|
-
shouldAuthenticate,
|
|
35
|
-
isWeb,
|
|
36
|
-
isIOS,
|
|
47
|
+
useHasBrandLogo,
|
|
37
48
|
isAndroid,
|
|
49
|
+
isIOS,
|
|
50
|
+
isWebInternal,
|
|
51
|
+
isWeb,
|
|
52
|
+
isDestop,
|
|
53
|
+
shouldAuthenticate,
|
|
38
54
|
isArray,
|
|
39
55
|
isValidReactComponent,
|
|
40
56
|
};
|
|
@@ -1,10 +1,23 @@
|
|
|
1
|
-
declare global{
|
|
2
|
-
|
|
1
|
+
declare global {
|
|
2
|
+
interface Window {
|
|
3
|
+
opera?: any;
|
|
4
|
+
}
|
|
3
5
|
}
|
|
6
|
+
|
|
4
7
|
const isMobileOrTablet = () => {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
let check = false;
|
|
9
|
+
(function (a) {
|
|
10
|
+
if (
|
|
11
|
+
/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(
|
|
12
|
+
a,
|
|
13
|
+
) ||
|
|
14
|
+
/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(
|
|
15
|
+
a.substr(0, 4),
|
|
16
|
+
)
|
|
17
|
+
)
|
|
18
|
+
check = true;
|
|
19
|
+
})(navigator?.userAgent || navigator?.vendor || window?.opera);
|
|
20
|
+
return check;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export default isMobileOrTablet;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import {gql, useMutation} from '@apollo/client';
|
|
2
2
|
import {MeetingInfoContextInterface} from '../components/meeting-info/useMeetingInfo';
|
|
3
3
|
import {useSetMeetingInfo} from '../components/meeting-info/useSetMeetingInfo';
|
|
4
|
+
import SDKEvents from '../utils/SdkEvents';
|
|
4
5
|
|
|
5
6
|
const CREATE_CHANNEL = gql`
|
|
6
7
|
mutation CreateChannel(
|
|
@@ -45,28 +46,38 @@ export default function useCreateMeeting() {
|
|
|
45
46
|
throw error;
|
|
46
47
|
}
|
|
47
48
|
if (res && res?.data && res?.data?.createChannel) {
|
|
48
|
-
let
|
|
49
|
-
{
|
|
49
|
+
let meetingInfo: Partial<MeetingInfoContextInterface['data']> = {
|
|
50
|
+
roomId: {
|
|
50
51
|
attendee: '',
|
|
51
|
-
}
|
|
52
|
+
},
|
|
53
|
+
};
|
|
52
54
|
if (res?.data?.createChannel?.passphrase?.view) {
|
|
53
|
-
|
|
55
|
+
meetingInfo.roomId.attendee = res.data.createChannel.passphrase.view;
|
|
54
56
|
}
|
|
55
57
|
if (res?.data?.createChannel?.passphrase?.host) {
|
|
56
|
-
|
|
58
|
+
meetingInfo.roomId.host = res.data.createChannel.passphrase.host;
|
|
57
59
|
}
|
|
58
60
|
if (enablePSTN === true && res?.data?.createChannel?.pstn) {
|
|
59
|
-
|
|
61
|
+
meetingInfo.pstn = {
|
|
60
62
|
number: res.data.createChannel.pstn.number,
|
|
61
63
|
pin: res.data.createChannel.pstn.dtmf,
|
|
62
64
|
};
|
|
63
65
|
}
|
|
64
66
|
setMeetingInfo({
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
67
|
+
data: {
|
|
68
|
+
isHost: true,
|
|
69
|
+
isSeparateHostLink: isSeparateHostLink ? true : false,
|
|
70
|
+
meetingTitle: roomTitle,
|
|
71
|
+
roomId: meetingInfo?.roomId,
|
|
72
|
+
pstn: meetingInfo?.pstn,
|
|
73
|
+
},
|
|
69
74
|
});
|
|
75
|
+
SDKEvents.emit(
|
|
76
|
+
'create',
|
|
77
|
+
meetingInfo.roomId.host,
|
|
78
|
+
meetingInfo.roomId.attendee,
|
|
79
|
+
meetingInfo?.pstn,
|
|
80
|
+
);
|
|
70
81
|
} else {
|
|
71
82
|
throw new Error(`An error occurred in parsing the channel data.`);
|
|
72
83
|
}
|
|
@@ -37,18 +37,17 @@ export default function useGetMeetingPhrase() {
|
|
|
37
37
|
try {
|
|
38
38
|
if (response && response.data) {
|
|
39
39
|
let data = response.data;
|
|
40
|
-
let
|
|
41
|
-
{
|
|
42
|
-
|
|
43
|
-
};
|
|
40
|
+
let meetingInfo: Partial<MeetingInfoContextInterface['data']> = {
|
|
41
|
+
roomId: {attendee: ''},
|
|
42
|
+
};
|
|
44
43
|
if (data?.share?.passphrase?.view) {
|
|
45
|
-
|
|
44
|
+
meetingInfo.roomId.attendee = data.share.passphrase.view;
|
|
46
45
|
}
|
|
47
46
|
if (data?.share?.passphrase?.host) {
|
|
48
|
-
|
|
47
|
+
meetingInfo.roomId.host = data.share.passphrase.host;
|
|
49
48
|
}
|
|
50
49
|
if (data?.share?.pstn) {
|
|
51
|
-
|
|
50
|
+
meetingInfo.pstn = {
|
|
52
51
|
number: data.share.pstn.number,
|
|
53
52
|
pin: data.share.pstn.dtmf,
|
|
54
53
|
};
|
|
@@ -56,7 +55,11 @@ export default function useGetMeetingPhrase() {
|
|
|
56
55
|
setMeetingInfo((prevState) => {
|
|
57
56
|
return {
|
|
58
57
|
...prevState,
|
|
59
|
-
|
|
58
|
+
data: {
|
|
59
|
+
...prevState.data,
|
|
60
|
+
roomId: meetingInfo.roomId,
|
|
61
|
+
pstn: meetingInfo?.pstn,
|
|
62
|
+
},
|
|
60
63
|
};
|
|
61
64
|
});
|
|
62
65
|
}
|
|
@@ -9,21 +9,21 @@
|
|
|
9
9
|
information visit https://appbuilder.agora.io.
|
|
10
10
|
*********************************************
|
|
11
11
|
*/
|
|
12
|
+
import {useRender} from 'customization-api';
|
|
12
13
|
import {UidType} from '../../agora-rn-uikit';
|
|
13
14
|
import {ToggleState} from '../../agora-rn-uikit/src/Contexts/PropsContext';
|
|
14
|
-
import useUserList from './useUserList';
|
|
15
15
|
|
|
16
16
|
function useIsAudioEnabled() {
|
|
17
|
-
const {renderList} =
|
|
17
|
+
const {renderList} = useRender();
|
|
18
18
|
/**
|
|
19
19
|
*
|
|
20
20
|
* @param uid UidType
|
|
21
21
|
* @returns boolean
|
|
22
22
|
*/
|
|
23
|
-
const
|
|
23
|
+
const isAudioEnabled = (uid: UidType): boolean =>
|
|
24
24
|
renderList[uid]?.audio === ToggleState.enabled;
|
|
25
25
|
|
|
26
|
-
return
|
|
26
|
+
return isAudioEnabled;
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
export default useIsAudioEnabled;
|
|
@@ -9,25 +9,22 @@
|
|
|
9
9
|
information visit https://appbuilder.agora.io.
|
|
10
10
|
*********************************************
|
|
11
11
|
*/
|
|
12
|
-
|
|
13
|
-
import {useMeetingInfo} from '../components/meeting-info/useMeetingInfo';
|
|
14
|
-
import {useLiveStreamDataContext} from '../components/contexts/LiveStreamDataContext';
|
|
15
12
|
import {UidType} from '../../agora-rn-uikit';
|
|
13
|
+
import {useLiveStreamDataContext} from '../components/contexts/LiveStreamDataContext';
|
|
14
|
+
import {useVideoMeetingData} from '../components/contexts/VideoMeetingDataContext';
|
|
16
15
|
|
|
17
16
|
function useIsHost() {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
return isHostFun;
|
|
30
|
-
}
|
|
17
|
+
const {hostUids: liveStreamHostUids} = useLiveStreamDataContext();
|
|
18
|
+
const {hostUids: videoMeetingHostUids} = useVideoMeetingData();
|
|
19
|
+
const isHost = (uid: UidType) => {
|
|
20
|
+
const hostUidsData = $config.EVENT_MODE
|
|
21
|
+
? liveStreamHostUids
|
|
22
|
+
: videoMeetingHostUids;
|
|
23
|
+
return hostUidsData.filter((hostId) => hostId === uid).length
|
|
24
|
+
? true
|
|
25
|
+
: false;
|
|
26
|
+
};
|
|
27
|
+
return isHost;
|
|
31
28
|
}
|
|
32
29
|
|
|
33
30
|
export default useIsHost;
|
|
@@ -9,14 +9,14 @@
|
|
|
9
9
|
information visit https://appbuilder.agora.io.
|
|
10
10
|
*********************************************
|
|
11
11
|
*/
|
|
12
|
+
import {useRender} from 'customization-api';
|
|
12
13
|
import {UidType} from '../../agora-rn-uikit';
|
|
13
|
-
import useUserList from './useUserList';
|
|
14
14
|
/**
|
|
15
15
|
* This hook will return the function to check whether the current user is a PSTN user or not
|
|
16
16
|
* @returns function
|
|
17
17
|
*/
|
|
18
18
|
function useIsPSTN() {
|
|
19
|
-
const {renderList} =
|
|
19
|
+
const {renderList} = useRender();
|
|
20
20
|
/**
|
|
21
21
|
*
|
|
22
22
|
* @param uid number
|
|
File without changes
|
|
@@ -9,21 +9,20 @@
|
|
|
9
9
|
information visit https://appbuilder.agora.io.
|
|
10
10
|
*********************************************
|
|
11
11
|
*/
|
|
12
|
-
import {
|
|
13
|
-
import {ToggleState} from '../../agora-rn-uikit
|
|
14
|
-
import useUserList from './useUserList';
|
|
12
|
+
import {useRender} from 'customization-api';
|
|
13
|
+
import {UidType, ToggleState} from '../../agora-rn-uikit';
|
|
15
14
|
|
|
16
15
|
function useIsVideoEnabled() {
|
|
17
|
-
const {renderList} =
|
|
16
|
+
const {renderList} = useRender();
|
|
18
17
|
|
|
19
18
|
/**
|
|
20
19
|
*
|
|
21
20
|
* @param uid UidType
|
|
22
21
|
* @returns boolean
|
|
23
22
|
*/
|
|
24
|
-
const
|
|
23
|
+
const isVideoEnabled = (uid: UidType): boolean =>
|
|
25
24
|
renderList[uid]?.video === ToggleState.enabled;
|
|
26
25
|
|
|
27
|
-
return
|
|
26
|
+
return isVideoEnabled;
|
|
28
27
|
}
|
|
29
28
|
export default useIsVideoEnabled;
|
|
@@ -77,9 +77,7 @@ export default function useJoinMeeting() {
|
|
|
77
77
|
} else {
|
|
78
78
|
if (response && response.data) {
|
|
79
79
|
let data = response.data;
|
|
80
|
-
let meetingInfo: Partial<MeetingInfoContextInterface> = {
|
|
81
|
-
isJoinDataFetched: true,
|
|
82
|
-
};
|
|
80
|
+
let meetingInfo: Partial<MeetingInfoContextInterface['data']> = {};
|
|
83
81
|
if (data?.joinChannel?.channel) {
|
|
84
82
|
meetingInfo.channel = data.joinChannel.channel;
|
|
85
83
|
}
|
|
@@ -90,10 +88,10 @@ export default function useJoinMeeting() {
|
|
|
90
88
|
meetingInfo.token = data.joinChannel.mainUser.rtc;
|
|
91
89
|
}
|
|
92
90
|
if (data?.joinChannel?.mainUser?.rtm) {
|
|
93
|
-
meetingInfo.
|
|
91
|
+
meetingInfo.rtmToken = data.joinChannel.mainUser.rtm;
|
|
94
92
|
}
|
|
95
93
|
if (data?.joinChannel?.secret) {
|
|
96
|
-
meetingInfo.
|
|
94
|
+
meetingInfo.encryptionSecret = data.joinChannel.secret;
|
|
97
95
|
}
|
|
98
96
|
if (data?.joinChannel?.screenShare?.uid) {
|
|
99
97
|
meetingInfo.screenShareUid = data.joinChannel.screenShare.uid;
|
|
@@ -114,7 +112,11 @@ export default function useJoinMeeting() {
|
|
|
114
112
|
setMeetingInfo((prevState) => {
|
|
115
113
|
return {
|
|
116
114
|
...prevState,
|
|
117
|
-
|
|
115
|
+
isJoinDataFetched: true,
|
|
116
|
+
data: {
|
|
117
|
+
...prevState.data,
|
|
118
|
+
...meetingInfo,
|
|
119
|
+
},
|
|
118
120
|
};
|
|
119
121
|
});
|
|
120
122
|
} else {
|
|
@@ -11,16 +11,16 @@
|
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
13
|
import React, {SetStateAction} from 'react';
|
|
14
|
-
import {createHook} from '
|
|
14
|
+
import {createHook} from 'customization-implementation';
|
|
15
15
|
|
|
16
16
|
export interface LayoutContextInterface {
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
currentLayout: string;
|
|
18
|
+
setLayout: React.Dispatch<SetStateAction<string>>;
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
const LayoutContext = React.createContext<LayoutContextInterface>({
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
currentLayout: '',
|
|
23
|
+
setLayout: () => {},
|
|
24
24
|
});
|
|
25
25
|
|
|
26
26
|
interface LayoutProviderProps {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {gql, useMutation} from '@apollo/client';
|
|
2
2
|
import {UidType} from '../../agora-rn-uikit';
|
|
3
3
|
import {useMeetingInfo} from '../components/meeting-info/useMeetingInfo';
|
|
4
|
-
import useIsPSTN from './
|
|
4
|
+
import useIsPSTN from './useIsPSTN';
|
|
5
5
|
const MUTE_PSTN = gql`
|
|
6
6
|
mutation mutePSTN($uid: Int!, $passphrase: String!, $mute: Boolean!) {
|
|
7
7
|
mutePSTN(uid: $uid, passphrase: $passphrase, mute: $mute) {
|
|
@@ -13,7 +13,9 @@ const MUTE_PSTN = gql`
|
|
|
13
13
|
|
|
14
14
|
const useMutePSTN = () => {
|
|
15
15
|
const [mutePSTN, {data, loading, error}] = useMutation(MUTE_PSTN);
|
|
16
|
-
const {
|
|
16
|
+
const {
|
|
17
|
+
data: {isHost, roomId},
|
|
18
|
+
} = useMeetingInfo();
|
|
17
19
|
const isPSTN = useIsPSTN();
|
|
18
20
|
return async (uid: UidType) => {
|
|
19
21
|
if (isHost) {
|
|
@@ -21,7 +23,7 @@ const useMutePSTN = () => {
|
|
|
21
23
|
await mutePSTN({
|
|
22
24
|
variables: {
|
|
23
25
|
uid: uid,
|
|
24
|
-
passphrase:
|
|
26
|
+
passphrase: roomId?.host,
|
|
25
27
|
//todo: hari need to test mute flag for PSTN
|
|
26
28
|
mute: 1,
|
|
27
29
|
},
|
|
@@ -9,8 +9,7 @@
|
|
|
9
9
|
information visit https://appbuilder.agora.io.
|
|
10
10
|
*********************************************
|
|
11
11
|
*/
|
|
12
|
-
import {
|
|
13
|
-
import {RtcContext, LocalContext} from '../../agora-rn-uikit';
|
|
12
|
+
import {useLocalUserInfo, useRtc} from 'customization-api';
|
|
14
13
|
import {ToggleState} from '../../agora-rn-uikit/src/Contexts/PropsContext';
|
|
15
14
|
|
|
16
15
|
export enum MUTE_LOCAL_TYPE {
|
|
@@ -18,8 +17,8 @@ export enum MUTE_LOCAL_TYPE {
|
|
|
18
17
|
video,
|
|
19
18
|
}
|
|
20
19
|
function useMuteToggleLocal() {
|
|
21
|
-
const {RtcEngine, dispatch} =
|
|
22
|
-
const local =
|
|
20
|
+
const {RtcEngine, dispatch} = useRtc();
|
|
21
|
+
const local = useLocalUserInfo();
|
|
23
22
|
|
|
24
23
|
return async (type: MUTE_LOCAL_TYPE) => {
|
|
25
24
|
switch (type) {
|
|
@@ -1,21 +1,22 @@
|
|
|
1
1
|
import {controlMessageEnum} from '../components/ChatContext';
|
|
2
|
-
import {UidType} from '../../agora-rn-uikit';
|
|
3
2
|
import {useMeetingInfo} from '../components/meeting-info/useMeetingInfo';
|
|
4
|
-
import useIsPSTN from './
|
|
5
|
-
import
|
|
6
|
-
|
|
7
|
-
} from '../utils/useSendControlMessage';
|
|
3
|
+
import useIsPSTN from './useIsPSTN';
|
|
4
|
+
import {UidType} from '../../agora-rn-uikit';
|
|
5
|
+
import events, {EventPersistLevel} from '../rtm-events-api';
|
|
8
6
|
|
|
9
7
|
const useRemoteEndCall = () => {
|
|
10
|
-
const
|
|
11
|
-
|
|
8
|
+
const {
|
|
9
|
+
data: {isHost},
|
|
10
|
+
} = useMeetingInfo();
|
|
12
11
|
const isPSTN = useIsPSTN();
|
|
12
|
+
|
|
13
13
|
return (uid: UidType) => {
|
|
14
|
-
if (isHost) {
|
|
14
|
+
if (isHost && uid) {
|
|
15
15
|
if (!isPSTN(uid)) {
|
|
16
|
-
|
|
17
|
-
CONTROL_MESSAGE_TYPE.controlMessageToUid,
|
|
16
|
+
events.send(
|
|
18
17
|
controlMessageEnum.kickUser,
|
|
18
|
+
'',
|
|
19
|
+
EventPersistLevel.LEVEL1,
|
|
19
20
|
uid,
|
|
20
21
|
);
|
|
21
22
|
}
|
|
@@ -10,47 +10,69 @@
|
|
|
10
10
|
*********************************************
|
|
11
11
|
*/
|
|
12
12
|
import {useMeetingInfo} from '../components/meeting-info/useMeetingInfo';
|
|
13
|
-
import {UidType} from '../../agora-rn-uikit';
|
|
14
13
|
import {controlMessageEnum} from '../components/ChatContext';
|
|
15
|
-
import useIsPSTN from './
|
|
14
|
+
import useIsPSTN from './useIsPSTN';
|
|
16
15
|
import useMutePSTN from './useMutePSTN';
|
|
17
|
-
import
|
|
18
|
-
|
|
19
|
-
} from '../utils/useSendControlMessage';
|
|
16
|
+
import {UidType} from '../../agora-rn-uikit';
|
|
17
|
+
import events, {EventPersistLevel} from '../rtm-events-api';
|
|
20
18
|
|
|
21
19
|
export enum MUTE_REMOTE_TYPE {
|
|
22
20
|
audio,
|
|
23
21
|
video,
|
|
24
22
|
}
|
|
25
23
|
function useRemoteMute() {
|
|
26
|
-
const
|
|
27
|
-
|
|
24
|
+
const {
|
|
25
|
+
data: {isHost},
|
|
26
|
+
} = useMeetingInfo();
|
|
28
27
|
const isPSTN = useIsPSTN();
|
|
29
28
|
const mutePSTN = useMutePSTN();
|
|
30
|
-
|
|
29
|
+
|
|
30
|
+
return async (type: MUTE_REMOTE_TYPE, uid?: UidType) => {
|
|
31
31
|
if (isHost) {
|
|
32
32
|
switch (type) {
|
|
33
33
|
case MUTE_REMOTE_TYPE.audio:
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
34
|
+
// To individual
|
|
35
|
+
if (uid) {
|
|
36
|
+
if (isPSTN(uid)) {
|
|
37
|
+
try {
|
|
38
|
+
mutePSTN(uid);
|
|
39
|
+
} catch (error) {
|
|
40
|
+
console.error('An error occurred while muting the PSTN user.');
|
|
41
|
+
}
|
|
42
|
+
} else {
|
|
43
|
+
events.send(
|
|
44
|
+
controlMessageEnum.muteAudio,
|
|
45
|
+
'',
|
|
46
|
+
EventPersistLevel.LEVEL1,
|
|
47
|
+
uid,
|
|
48
|
+
);
|
|
39
49
|
}
|
|
40
50
|
} else {
|
|
41
|
-
|
|
42
|
-
|
|
51
|
+
// To everyone
|
|
52
|
+
events.send(
|
|
43
53
|
controlMessageEnum.muteAudio,
|
|
44
|
-
|
|
54
|
+
'',
|
|
55
|
+
EventPersistLevel.LEVEL1,
|
|
45
56
|
);
|
|
46
57
|
}
|
|
47
58
|
break;
|
|
48
59
|
case MUTE_REMOTE_TYPE.video:
|
|
49
|
-
if (
|
|
50
|
-
|
|
51
|
-
|
|
60
|
+
if (uid) {
|
|
61
|
+
// To individual
|
|
62
|
+
if (!isPSTN(uid)) {
|
|
63
|
+
events.send(
|
|
64
|
+
controlMessageEnum.muteVideo,
|
|
65
|
+
'',
|
|
66
|
+
EventPersistLevel.LEVEL1,
|
|
67
|
+
uid,
|
|
68
|
+
);
|
|
69
|
+
}
|
|
70
|
+
} else {
|
|
71
|
+
// To everyone
|
|
72
|
+
events.send(
|
|
52
73
|
controlMessageEnum.muteVideo,
|
|
53
|
-
|
|
74
|
+
'',
|
|
75
|
+
EventPersistLevel.LEVEL1,
|
|
54
76
|
);
|
|
55
77
|
}
|
|
56
78
|
break;
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
|
|
13
13
|
import React, {SetStateAction} from 'react';
|
|
14
14
|
import {SidePanelType} from '../subComponents/SidePanelEnum';
|
|
15
|
-
import {createHook} from '
|
|
15
|
+
import {createHook} from 'customization-implementation';
|
|
16
16
|
|
|
17
17
|
export interface SidePanelContextInterface {
|
|
18
18
|
sidePanel: SidePanelType;
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
information visit https://appbuilder.agora.io.
|
|
10
10
|
*********************************************
|
|
11
11
|
*/
|
|
12
|
-
import {
|
|
12
|
+
import {useCustomization} from 'customization-implementation';
|
|
13
13
|
import {useLanguage} from '../language/useLanguage';
|
|
14
14
|
import {DEFAULT_I18_DATA} from '../language';
|
|
15
15
|
import {TextDataInterface} from '../language/default-labels/index';
|
|
@@ -17,7 +17,7 @@ import {TextDataInterface} from '../language/default-labels/index';
|
|
|
17
17
|
export function usei18nData(
|
|
18
18
|
selectedLanguageCode: string = DEFAULT_I18_DATA.locale,
|
|
19
19
|
) {
|
|
20
|
-
const languageData =
|
|
20
|
+
const languageData = useCustomization((data) => data?.i18n);
|
|
21
21
|
if (
|
|
22
22
|
!selectedLanguageCode ||
|
|
23
23
|
!languageData ||
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import useSetName from './useSetName';
|
|
2
|
+
import useGetName from './useGetName';
|
|
3
|
+
|
|
4
|
+
export default function useUserName(): [
|
|
5
|
+
string,
|
|
6
|
+
React.Dispatch<React.SetStateAction<string>>,
|
|
7
|
+
] {
|
|
8
|
+
const setName = useSetName();
|
|
9
|
+
const name = useGetName();
|
|
10
|
+
return [name, setName];
|
|
11
|
+
}
|