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
|
@@ -23,12 +23,23 @@ import ChatParticipants from '../subComponents/chat/ChatParticipants';
|
|
|
23
23
|
import ColorContext from './ColorContext';
|
|
24
24
|
import {useChatNotification} from './chat-notification/useChatNotification';
|
|
25
25
|
import {useString} from '../utils/useString';
|
|
26
|
-
import {isIOS, isValidReactComponent,
|
|
26
|
+
import {isIOS, isValidReactComponent, isWebInternal} from '../utils/common';
|
|
27
27
|
import {useChatUIControl} from './chat-ui/useChatUIControl';
|
|
28
|
-
import {
|
|
28
|
+
import {useCustomization} from 'customization-implementation';
|
|
29
29
|
import {UidType} from '../../agora-rn-uikit';
|
|
30
|
+
import {ChatBubbleProps} from './ChatContext';
|
|
31
|
+
import {
|
|
32
|
+
ChatTextInputProps,
|
|
33
|
+
ChatSendButtonProps,
|
|
34
|
+
} from '../subComponents/ChatInput';
|
|
35
|
+
|
|
36
|
+
interface ChatProps {
|
|
37
|
+
chatBubble?: React.ComponentType<ChatBubbleProps>;
|
|
38
|
+
chatInput?: React.ComponentType<ChatTextInputProps>;
|
|
39
|
+
chatSendButton?: React.ComponentType<ChatSendButtonProps>;
|
|
40
|
+
}
|
|
30
41
|
|
|
31
|
-
const Chat = () => {
|
|
42
|
+
const Chat = (props?: ChatProps) => {
|
|
32
43
|
// commented for v1 release
|
|
33
44
|
// const groupChatLabel = useString('groupChatLabel')();
|
|
34
45
|
// const privateChatLabel = useString('privateChatLabel')();
|
|
@@ -93,7 +104,7 @@ const Chat = () => {
|
|
|
93
104
|
);
|
|
94
105
|
};
|
|
95
106
|
|
|
96
|
-
const {ChatAfterView, ChatBeforeView} =
|
|
107
|
+
const {ChatAfterView, ChatBeforeView} = useCustomization((data) => {
|
|
97
108
|
let components: {
|
|
98
109
|
ChatAfterView: React.ComponentType;
|
|
99
110
|
ChatBeforeView: React.ComponentType;
|
|
@@ -131,7 +142,7 @@ const Chat = () => {
|
|
|
131
142
|
<>
|
|
132
143
|
<View
|
|
133
144
|
style={
|
|
134
|
-
|
|
145
|
+
isWebInternal()
|
|
135
146
|
? !isSmall
|
|
136
147
|
? style.chatView
|
|
137
148
|
: style.chatViewNative
|
|
@@ -190,12 +201,12 @@ const Chat = () => {
|
|
|
190
201
|
</View>
|
|
191
202
|
{groupActive ? (
|
|
192
203
|
<>
|
|
193
|
-
<ChatContainer
|
|
204
|
+
<ChatContainer {...props} />
|
|
194
205
|
<View style={[style.chatInputLineSeparator, {marginBottom: 0}]} />
|
|
195
206
|
<View>
|
|
196
207
|
<View style={style.chatInputContainer}>
|
|
197
208
|
<View style={[style.chatInputLineSeparator, {opacity: 0.3}]} />
|
|
198
|
-
<ChatInput />
|
|
209
|
+
<ChatInput {...props} />
|
|
199
210
|
</View>
|
|
200
211
|
</View>
|
|
201
212
|
</>
|
|
@@ -205,7 +216,7 @@ const Chat = () => {
|
|
|
205
216
|
<ChatParticipants selectUser={selectUser} />
|
|
206
217
|
) : (
|
|
207
218
|
<>
|
|
208
|
-
<ChatContainer
|
|
219
|
+
<ChatContainer {...props} />
|
|
209
220
|
<View
|
|
210
221
|
style={[style.chatInputLineSeparator, {marginBottom: 0}]}
|
|
211
222
|
/>
|
|
@@ -214,7 +225,7 @@ const Chat = () => {
|
|
|
214
225
|
<View
|
|
215
226
|
style={[style.chatInputLineSeparator, {opacity: 0.3}]}
|
|
216
227
|
/>
|
|
217
|
-
<ChatInput />
|
|
228
|
+
<ChatInput {...props} />
|
|
218
229
|
</View>
|
|
219
230
|
</View>
|
|
220
231
|
</>
|
|
@@ -340,7 +351,7 @@ const style = StyleSheet.create({
|
|
|
340
351
|
justifyContent: 'center',
|
|
341
352
|
backgroundColor: $config.PRIMARY_COLOR,
|
|
342
353
|
color: $config.SECONDARY_FONT_COLOR,
|
|
343
|
-
fontFamily: isIOS ? 'Helvetica' : 'sans-serif',
|
|
354
|
+
fontFamily: isIOS() ? 'Helvetica' : 'sans-serif',
|
|
344
355
|
borderRadius: 10,
|
|
345
356
|
position: 'absolute',
|
|
346
357
|
left: 25,
|
|
@@ -354,7 +365,7 @@ const style = StyleSheet.create({
|
|
|
354
365
|
justifyContent: 'center',
|
|
355
366
|
backgroundColor: $config.PRIMARY_COLOR,
|
|
356
367
|
color: $config.SECONDARY_FONT_COLOR,
|
|
357
|
-
fontFamily: isIOS ? 'Helvetica' : 'sans-serif',
|
|
368
|
+
fontFamily: isIOS() ? 'Helvetica' : 'sans-serif',
|
|
358
369
|
borderRadius: 10,
|
|
359
370
|
position: 'absolute',
|
|
360
371
|
right: 20,
|
|
@@ -16,51 +16,36 @@ import {createContext, SetStateAction} from 'react';
|
|
|
16
16
|
export interface ChatBubbleProps {
|
|
17
17
|
isLocal: boolean;
|
|
18
18
|
message: string;
|
|
19
|
-
|
|
19
|
+
createdTimestamp: string;
|
|
20
|
+
updatedTimestamp?: string;
|
|
20
21
|
uid: UidType;
|
|
22
|
+
msgId: string;
|
|
23
|
+
isDeleted: boolean;
|
|
21
24
|
render?: (
|
|
22
25
|
isLocal: boolean,
|
|
23
26
|
message: string,
|
|
24
|
-
|
|
27
|
+
createdTimestamp: string,
|
|
25
28
|
uid: UidType,
|
|
29
|
+
msgId: string,
|
|
30
|
+
isDeleted: boolean,
|
|
31
|
+
updatedTimestamp?: string,
|
|
26
32
|
) => JSX.Element;
|
|
27
33
|
}
|
|
28
34
|
|
|
29
35
|
export interface messageStoreInterface {
|
|
30
|
-
|
|
36
|
+
createdTimestamp: string;
|
|
37
|
+
updatedTimestamp?: string;
|
|
31
38
|
uid: UidType;
|
|
32
39
|
msg: string;
|
|
33
40
|
}
|
|
34
41
|
|
|
35
|
-
export interface messageEventInterface extends messageStoreInterface {
|
|
36
|
-
type: messageActionType;
|
|
37
|
-
source: messageSourceType;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
export enum messageSourceType {
|
|
41
|
-
Core = 'core',
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
export enum messageChannelType {
|
|
45
|
-
Private = 'private',
|
|
46
|
-
Public = 'public',
|
|
47
|
-
}
|
|
48
|
-
|
|
49
42
|
export enum messageActionType {
|
|
50
43
|
Control = '0',
|
|
51
44
|
Normal = '1',
|
|
52
45
|
}
|
|
53
46
|
|
|
54
|
-
export enum attrRequestTypes {
|
|
55
|
-
none = 'NONE',
|
|
56
|
-
}
|
|
57
|
-
|
|
58
47
|
export interface chatContext {
|
|
59
48
|
hasUserJoinedRTM: boolean;
|
|
60
|
-
sendMessage: (msg: string) => void;
|
|
61
|
-
sendMessageToUid: (msg: string, uid: number | string) => void;
|
|
62
|
-
sendControlMessage: (msg: string) => void;
|
|
63
|
-
sendControlMessageToUid: (msg: string, uid: number) => void;
|
|
64
49
|
engine: RtmEngine;
|
|
65
50
|
localUid: UidType;
|
|
66
51
|
onlineUsersCount: number;
|
|
@@ -72,8 +57,6 @@ export enum controlMessageEnum {
|
|
|
72
57
|
muteSingleVideo = '3',
|
|
73
58
|
muteSingleAudio = '4',
|
|
74
59
|
kickUser = '5',
|
|
75
|
-
cloudRecordingActive = '6',
|
|
76
|
-
cloudRecordingUnactive = '7',
|
|
77
60
|
}
|
|
78
61
|
|
|
79
62
|
const ChatContext = createContext(null as unknown as chatContext);
|
|
@@ -32,7 +32,9 @@ import LocalSwitchCamera, {
|
|
|
32
32
|
} from '../subComponents/LocalSwitchCamera';
|
|
33
33
|
|
|
34
34
|
const Controls = () => {
|
|
35
|
-
const {
|
|
35
|
+
const {
|
|
36
|
+
data: {isHost},
|
|
37
|
+
} = useMeetingInfo();
|
|
36
38
|
const {rtcProps} = useContext(PropsContext);
|
|
37
39
|
|
|
38
40
|
return (
|
|
@@ -54,17 +56,21 @@ const Controls = () => {
|
|
|
54
56
|
<View style={{alignSelf: 'center'}}>
|
|
55
57
|
<LocalAudioMute />
|
|
56
58
|
</View>
|
|
57
|
-
|
|
58
|
-
<
|
|
59
|
-
|
|
59
|
+
{!$config.AUDIO_ROOM && (
|
|
60
|
+
<View style={{alignSelf: 'center'}}>
|
|
61
|
+
<LocalVideoMute />
|
|
62
|
+
</View>
|
|
63
|
+
)}
|
|
60
64
|
{isHost && $config.CLOUD_RECORDING && (
|
|
61
65
|
<View style={{alignSelf: 'baseline'}}>
|
|
62
66
|
<Recording />
|
|
63
67
|
</View>
|
|
64
68
|
)}
|
|
65
|
-
|
|
66
|
-
<
|
|
67
|
-
|
|
69
|
+
{!$config.AUDIO_ROOM && (
|
|
70
|
+
<View style={{alignSelf: 'center'}}>
|
|
71
|
+
<LocalSwitchCamera />
|
|
72
|
+
</View>
|
|
73
|
+
)}
|
|
68
74
|
</>
|
|
69
75
|
)}
|
|
70
76
|
<View style={{alignSelf: 'center'}}>
|
|
@@ -31,7 +31,7 @@ import {ClientRole} from '../../agora-rn-uikit';
|
|
|
31
31
|
import LiveStreamControls, {
|
|
32
32
|
LiveStreamControlsProps,
|
|
33
33
|
} from './livestream/views/LiveStreamControls';
|
|
34
|
-
import {
|
|
34
|
+
import {isWebInternal} from '../utils/common';
|
|
35
35
|
import {useMeetingInfo} from './meeting-info/useMeetingInfo';
|
|
36
36
|
import LocalEndcall, {LocalEndcallProps} from '../subComponents/LocalEndCall';
|
|
37
37
|
|
|
@@ -47,8 +47,9 @@ const Controls = () => {
|
|
|
47
47
|
Dimensions.get('window').width > Dimensions.get('window').height,
|
|
48
48
|
]);
|
|
49
49
|
const isDesktop = dim[0] > 1224;
|
|
50
|
-
const {
|
|
51
|
-
|
|
50
|
+
const {
|
|
51
|
+
data: {isHost},
|
|
52
|
+
} = useMeetingInfo();
|
|
52
53
|
return (
|
|
53
54
|
<View
|
|
54
55
|
style={[
|
|
@@ -76,10 +77,12 @@ const Controls = () => {
|
|
|
76
77
|
<View style={{alignSelf: 'center'}}>
|
|
77
78
|
<LocalAudioMute />
|
|
78
79
|
</View>
|
|
79
|
-
|
|
80
|
-
<
|
|
81
|
-
|
|
82
|
-
|
|
80
|
+
{!$config.AUDIO_ROOM && (
|
|
81
|
+
<View style={{alignSelf: 'center'}}>
|
|
82
|
+
<LocalVideoMute />
|
|
83
|
+
</View>
|
|
84
|
+
)}
|
|
85
|
+
{!$config.AUDIO_ROOM && isMobileOrTablet() && (
|
|
83
86
|
<View style={{alignSelf: 'center'}}>
|
|
84
87
|
<LocalSwitchCamera />
|
|
85
88
|
</View>
|
|
@@ -103,7 +106,7 @@ const Controls = () => {
|
|
|
103
106
|
);
|
|
104
107
|
};
|
|
105
108
|
|
|
106
|
-
|
|
109
|
+
type ControlsComponentsArrayProps = [
|
|
107
110
|
(props: LocalAudioMuteProps) => JSX.Element,
|
|
108
111
|
(props: LocalVideoMuteProps) => JSX.Element,
|
|
109
112
|
(props: LocalSwitchCameraProps) => JSX.Element,
|
|
@@ -111,7 +114,9 @@ export const ControlsComponentsArray: [
|
|
|
111
114
|
(props: RecordingButtonProps) => JSX.Element,
|
|
112
115
|
(props: LocalEndcallProps) => JSX.Element,
|
|
113
116
|
(props: LiveStreamControlsProps) => JSX.Element,
|
|
114
|
-
]
|
|
117
|
+
];
|
|
118
|
+
|
|
119
|
+
export const ControlsComponentsArray: ControlsComponentsArrayProps = [
|
|
115
120
|
LocalAudioMute,
|
|
116
121
|
LocalVideoMute,
|
|
117
122
|
LocalSwitchCamera,
|
|
@@ -124,23 +129,9 @@ export const ControlsComponentsArray: [
|
|
|
124
129
|
const style = StyleSheet.create({
|
|
125
130
|
// @ts-ignore
|
|
126
131
|
controlsHolder: {
|
|
127
|
-
flex:
|
|
132
|
+
flex: isWebInternal() ? 1.3 : 1.6,
|
|
128
133
|
...controlsHolder,
|
|
129
134
|
},
|
|
130
|
-
chatNotification: {
|
|
131
|
-
width: 20,
|
|
132
|
-
height: 20,
|
|
133
|
-
display: 'flex',
|
|
134
|
-
alignItems: 'center',
|
|
135
|
-
justifyContent: 'center',
|
|
136
|
-
backgroundColor: $config.PRIMARY_COLOR,
|
|
137
|
-
color: $config.SECONDARY_FONT_COLOR,
|
|
138
|
-
fontFamily: isIOS ? 'Helvetica' : 'sans-serif',
|
|
139
|
-
borderRadius: 10,
|
|
140
|
-
position: 'absolute',
|
|
141
|
-
left: 25,
|
|
142
|
-
top: -10,
|
|
143
|
-
},
|
|
144
135
|
});
|
|
145
136
|
|
|
146
137
|
export default Controls;
|
|
@@ -9,10 +9,11 @@
|
|
|
9
9
|
information visit https://appbuilder.agora.io.
|
|
10
10
|
*********************************************
|
|
11
11
|
*/
|
|
12
|
-
import React, {useState,
|
|
13
|
-
import {
|
|
12
|
+
import React, {useState, useEffect, useCallback} from 'react';
|
|
13
|
+
import {ClientRole} from '../../agora-rn-uikit';
|
|
14
14
|
import DeviceContext from './DeviceContext';
|
|
15
15
|
import AgoraRTC from 'agora-rtc-sdk-ng';
|
|
16
|
+
import {useRtc} from 'customization-api';
|
|
16
17
|
|
|
17
18
|
interface Props {
|
|
18
19
|
userRole: ClientRole;
|
|
@@ -33,7 +34,7 @@ const DeviceConfigure: React.FC<Props> = (props: any) => {
|
|
|
33
34
|
const [selectedCam, setSelectedCam] = useState('');
|
|
34
35
|
const [selectedMic, setSelectedMic] = useState('');
|
|
35
36
|
const [deviceList, setDeviceList] = useState<any>([]);
|
|
36
|
-
const rtc =
|
|
37
|
+
const rtc = useRtc();
|
|
37
38
|
|
|
38
39
|
const refreshDevices = useCallback(async () => {
|
|
39
40
|
rtc.RtcEngine.getDevices(function (devices: deviceInfo[]) {
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/*
|
|
2
|
+
********************************************
|
|
3
|
+
Copyright © 2022 Agora Lab, Inc., all rights reserved.
|
|
4
|
+
AppBuilder and all associated components, source code, APIs, services, and documentation
|
|
5
|
+
(the “Materials”) are owned by Agora Lab, Inc. and its licensors. The Materials may not be
|
|
6
|
+
accessed, used, modified, or distributed for any purpose without a license from Agora Lab, Inc.
|
|
7
|
+
Use without a license or in violation of any license terms and conditions (including use for
|
|
8
|
+
any purpose competitive to Agora Lab, Inc.’s business) is strictly prohibited. For more
|
|
9
|
+
information visit https://appbuilder.agora.io.
|
|
10
|
+
*********************************************
|
|
11
|
+
*/
|
|
12
|
+
import React, {useContext, useEffect} from 'react';
|
|
13
|
+
import {RtcContext} from '../../agora-rn-uikit';
|
|
14
|
+
import events from '../rtm-events-api';
|
|
15
|
+
import {controlMessageEnum} from '../components/ChatContext';
|
|
16
|
+
|
|
17
|
+
interface Props {
|
|
18
|
+
children: React.ReactNode;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
const EventsConfigure: React.FC<Props> = (props) => {
|
|
22
|
+
const {RtcEngine, dispatch} = useContext(RtcContext);
|
|
23
|
+
useEffect(() => {
|
|
24
|
+
events.on(controlMessageEnum.muteVideo, () => {
|
|
25
|
+
RtcEngine.muteLocalVideoStream(true);
|
|
26
|
+
dispatch({
|
|
27
|
+
type: 'LocalMuteVideo',
|
|
28
|
+
value: [0],
|
|
29
|
+
});
|
|
30
|
+
});
|
|
31
|
+
events.on(controlMessageEnum.muteAudio, () => {
|
|
32
|
+
RtcEngine.muteLocalAudioStream(true);
|
|
33
|
+
dispatch({
|
|
34
|
+
type: 'LocalMuteAudio',
|
|
35
|
+
value: [0],
|
|
36
|
+
});
|
|
37
|
+
});
|
|
38
|
+
events.on(controlMessageEnum.kickUser, () => {
|
|
39
|
+
dispatch({
|
|
40
|
+
type: 'EndCall',
|
|
41
|
+
value: [],
|
|
42
|
+
});
|
|
43
|
+
});
|
|
44
|
+
return () => {
|
|
45
|
+
events.off(controlMessageEnum.muteVideo);
|
|
46
|
+
events.off(controlMessageEnum.muteAudio);
|
|
47
|
+
events.off(controlMessageEnum.kickUser);
|
|
48
|
+
};
|
|
49
|
+
}, []);
|
|
50
|
+
|
|
51
|
+
return <>{props.children}</>;
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
export default EventsConfigure;
|
|
@@ -9,11 +9,10 @@
|
|
|
9
9
|
information visit https://appbuilder.agora.io.
|
|
10
10
|
*********************************************
|
|
11
11
|
*/
|
|
12
|
-
import {layoutComponent} from '
|
|
13
|
-
import React, {useMemo,
|
|
12
|
+
import {layoutComponent, useRtc} from 'customization-api';
|
|
13
|
+
import React, {useMemo, useState} from 'react';
|
|
14
14
|
import {View, StyleSheet, Dimensions, Pressable} from 'react-native';
|
|
15
|
-
import {
|
|
16
|
-
import {RtcContext} from '../../agora-rn-uikit';
|
|
15
|
+
import {isWebInternal} from '../utils/common';
|
|
17
16
|
import {useSetPinnedLayout} from '../pages/video-call/DefaultLayouts';
|
|
18
17
|
import RenderComponent from '../pages/video-call/RenderComponent';
|
|
19
18
|
const layout = (len: number, isDesktop: boolean = true) => {
|
|
@@ -35,7 +34,7 @@ const layout = (len: number, isDesktop: boolean = true) => {
|
|
|
35
34
|
};
|
|
36
35
|
|
|
37
36
|
const GridVideo: layoutComponent = ({renderData}) => {
|
|
38
|
-
const {dispatch} =
|
|
37
|
+
const {dispatch} = useRtc();
|
|
39
38
|
let onLayout = (e: any) => {
|
|
40
39
|
setDim([
|
|
41
40
|
e.nativeEvent.layout.width,
|
|
@@ -74,7 +73,7 @@ const GridVideo: layoutComponent = ({renderData}) => {
|
|
|
74
73
|
setPinnedLayout();
|
|
75
74
|
}}
|
|
76
75
|
style={{
|
|
77
|
-
flex:
|
|
76
|
+
flex: isWebInternal() ? 1 / dims.c : 1,
|
|
78
77
|
marginHorizontal: 'auto',
|
|
79
78
|
}}
|
|
80
79
|
key={cidx}>
|
|
@@ -11,27 +11,21 @@
|
|
|
11
11
|
*/
|
|
12
12
|
import React from 'react';
|
|
13
13
|
import {View, Text, StyleSheet} from 'react-native';
|
|
14
|
-
import {controlMessageEnum} from './ChatContext';
|
|
15
14
|
import SecondaryButton from '../atoms/SecondaryButton';
|
|
16
15
|
import {useString} from '../utils/useString';
|
|
17
|
-
import
|
|
18
|
-
CONTROL_MESSAGE_TYPE,
|
|
19
|
-
} from '../utils/useSendControlMessage';
|
|
16
|
+
import useRemoteMute, {MUTE_REMOTE_TYPE} from '../utils/useRemoteMute';
|
|
20
17
|
|
|
21
18
|
export interface MuteAllAudioButtonProps {
|
|
22
19
|
render?: (onPress: () => void) => JSX.Element;
|
|
23
20
|
}
|
|
24
21
|
|
|
25
22
|
export const MuteAllAudioButton = (props: MuteAllAudioButtonProps) => {
|
|
26
|
-
const
|
|
23
|
+
const muteRemoteAudio = useRemoteMute();
|
|
27
24
|
//commented for v1 release
|
|
28
25
|
//const muteAllAudioButton = useString('muteAllAudioButton')();
|
|
29
26
|
const muteAllAudioButton = 'Mute all audios';
|
|
30
|
-
const onPress = () =>
|
|
31
|
-
|
|
32
|
-
CONTROL_MESSAGE_TYPE.controlMessageToEveryOne,
|
|
33
|
-
controlMessageEnum.muteAudio,
|
|
34
|
-
);
|
|
27
|
+
const onPress = () => muteRemoteAudio(MUTE_REMOTE_TYPE.audio);
|
|
28
|
+
|
|
35
29
|
return props?.render ? (
|
|
36
30
|
props.render(onPress)
|
|
37
31
|
) : (
|
|
@@ -43,15 +37,13 @@ export interface MuteAllVideoButtonProps {
|
|
|
43
37
|
render?: (onPress: () => void) => JSX.Element;
|
|
44
38
|
}
|
|
45
39
|
export const MuteAllVideoButton = (props: MuteAllVideoButtonProps) => {
|
|
46
|
-
const
|
|
40
|
+
const muteRemoteVideo = useRemoteMute();
|
|
41
|
+
|
|
47
42
|
//commented for v1 release
|
|
48
43
|
//const muteAllVideoButton = useString('muteAllVideoButton')();
|
|
49
44
|
const muteAllVideoButton = 'Mute all videos';
|
|
50
|
-
const onPress = () =>
|
|
51
|
-
|
|
52
|
-
CONTROL_MESSAGE_TYPE.controlMessageToEveryOne,
|
|
53
|
-
controlMessageEnum.muteVideo,
|
|
54
|
-
);
|
|
45
|
+
const onPress = () => muteRemoteVideo(MUTE_REMOTE_TYPE.video);
|
|
46
|
+
|
|
55
47
|
return props?.render ? (
|
|
56
48
|
props.render(onPress)
|
|
57
49
|
) : (
|
|
@@ -70,9 +62,11 @@ const HostControlView = () => {
|
|
|
70
62
|
<View style={style.btnContainer}>
|
|
71
63
|
<MuteAllAudioButton />
|
|
72
64
|
</View>
|
|
73
|
-
|
|
74
|
-
<
|
|
75
|
-
|
|
65
|
+
{!$config.AUDIO_ROOM && (
|
|
66
|
+
<View style={style.btnContainer}>
|
|
67
|
+
<MuteAllVideoButton />
|
|
68
|
+
</View>
|
|
69
|
+
)}
|
|
76
70
|
</View>
|
|
77
71
|
</>
|
|
78
72
|
);
|