agora-appbuilder-core 4.0.0-api.7 → 4.0.0-api.9
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/package.json +3 -3
- package/template/_package-lock.json +5911 -4861
- package/template/agora-rn-uikit/.eslintrc.js +5 -0
- package/template/agora-rn-uikit/package.json +14 -14
- package/template/agora-rn-uikit/src/Contexts/PropsContext.tsx +41 -22
- package/template/agora-rn-uikit/src/Contexts/RtcContext.tsx +2 -2
- package/template/agora-rn-uikit/src/Rtc/Create.tsx +90 -57
- package/template/agora-rn-uikit/src/Rtc/Join.tsx +20 -16
- package/template/agora-rn-uikit/src/RtcConfigure.tsx +10 -10
- package/template/agora-rn-uikit/src/Utils/isBotUser.ts +15 -0
- package/template/agora-rn-uikit/src/Utils/quality.tsx +8 -0
- package/template/agora-rn-uikit/src/Views/MaxVideoView.native.tsx +32 -16
- package/template/agora-rn-uikit/src/Views/MaxVideoView.tsx +25 -14
- package/template/agora-rn-uikit/src/Views/MinVideoView.tsx +15 -9
- package/template/agora-rn-uikit/src/index.ts +1 -1
- package/template/bridge/rtc/webNg/RtcEngine.ts +73 -58
- package/template/bridge/rtc/webNg/{SurfaceView.tsx → RtcSurfaceView.tsx} +20 -26
- package/template/bridge/rtc/webNg/Types.ts +20 -5
- package/template/bridge/rtc/webNg/index.ts +9 -13
- package/template/customization-api/temp.ts +2 -2
- package/template/customization-api/typeDefinition.ts +1 -2
- package/template/customization-api/utils.ts +1 -2
- package/template/index.js +1 -0
- package/template/ios/HelloWorld/HelloWorldDebug.entitlements +10 -0
- package/template/ios/HelloWorld.xcodeproj/project.pbxproj +4 -0
- package/template/ios/Podfile +1 -1
- package/template/ios/Podfile.lock +72 -140
- package/template/package.json +5 -4
- package/template/src/App.tsx +58 -1
- package/template/src/AppRoutes.tsx +16 -3
- package/template/src/AppWrapper.tsx +21 -19
- package/template/src/components/Chat.tsx +17 -8
- package/template/src/components/ChatContext.ts +0 -2
- package/template/src/components/Controls.tsx +5 -5
- package/template/src/components/Controls1.native.tsx +7 -3
- package/template/src/components/DeviceConfigure.native.tsx +2 -2
- package/template/src/components/DeviceConfigure.tsx +2 -2
- package/template/src/components/EventsConfigure.tsx +13 -22
- package/template/src/components/GraphQLProvider.tsx +47 -30
- package/template/src/components/GridVideo.tsx +6 -2
- package/template/src/components/NetworkQualityContext.tsx +11 -5
- package/template/src/components/ParticipantsView.tsx +3 -3
- package/template/src/components/PinnedVideo.tsx +2 -2
- package/template/src/components/Precall.native.tsx +9 -6
- package/template/src/components/Precall.tsx +9 -6
- package/template/src/components/StorageContext.tsx +5 -2
- package/template/src/components/ToastComponent.tsx +7 -1
- package/template/src/components/contexts/LiveStreamDataContext.tsx +3 -3
- package/template/src/components/livestream/LiveStreamContext.tsx +42 -33
- package/template/src/components/livestream/Types.ts +2 -2
- package/template/src/components/participants/Participant.tsx +1 -1
- package/template/src/components/participants/UserActionMenuOptions.tsx +7 -2
- package/template/src/components/recording-bot/RecordingBotRoute.tsx +42 -0
- package/template/src/components/virtual-background/useVB.native.tsx +16 -19
- package/template/src/components/virtual-background/useVB.tsx +1 -1
- package/template/src/components/whiteboard/WhiteboardConfigure.native.tsx +11 -0
- package/template/src/components/whiteboard/WhiteboardConfigure.tsx +5 -0
- package/template/src/components/whiteboard/WhiteboardView.native.tsx +91 -12
- package/template/src/components/whiteboard/WhiteboardWidget.tsx +15 -4
- package/template/src/language/default-labels/precallScreenLabels.ts +5 -3
- package/template/src/language/default-labels/videoCallScreenLabels.ts +93 -41
- package/template/src/pages/VideoCall.tsx +39 -37
- package/template/src/pages/video-call/ActionSheetContent.tsx +4 -3
- package/template/src/pages/video-call/NameWithMicIcon.tsx +2 -1
- package/template/src/pages/video-call/VideoCallMobileView.tsx +26 -2
- package/template/src/pages/video-call/VideoCallScreen.tsx +32 -12
- package/template/src/pages/video-call/VideoCallScreenWrapper.tsx +41 -0
- package/template/src/pages/video-call/VideoComponent.tsx +5 -2
- package/template/src/pages/video-call/VideoRenderer.tsx +55 -34
- package/template/src/rtm-events/constants.ts +0 -2
- package/template/src/subComponents/ChatBubble.tsx +2 -0
- package/template/src/subComponents/LocalAudioMute.tsx +8 -47
- package/template/src/subComponents/LocalEndCall.tsx +5 -52
- package/template/src/subComponents/LocalSwitchCamera.tsx +3 -3
- package/template/src/subComponents/LocalVideoMute.tsx +8 -50
- package/template/src/subComponents/SelectDevice.tsx +5 -2
- package/template/src/subComponents/SelectDeviceSettings.backup.tsx +9 -6
- package/template/src/subComponents/caption/Caption.tsx +12 -10
- package/template/src/subComponents/caption/Transcript.tsx +13 -10
- package/template/src/subComponents/caption/useTranscriptDownload.native.ts +11 -16
- package/template/src/subComponents/caption/utils.ts +1 -0
- package/template/src/subComponents/livestream/ApprovedLiveStreamControlsView.tsx +2 -2
- package/template/src/subComponents/livestream/CurrentLiveStreamRequestsView.tsx +3 -2
- package/template/src/subComponents/livestream/controls/LocalRaiseHand.tsx +1 -1
- package/template/src/subComponents/recording/useIsRecordingBot.tsx +38 -0
- package/template/src/subComponents/recording/useRecording.tsx +176 -135
- package/template/src/subComponents/screenshare/ScreenshareButton.tsx +3 -3
- package/template/src/subComponents/screenshare/ScreenshareConfigure.tsx +1 -22
- package/template/src/utils/index.tsx +16 -5
- package/template/src/utils/useEndCall.ts +65 -0
- package/template/src/utils/useIsLocalUserSpeaking.ts +6 -1
- package/template/{bridge/rtc/webNg/LocalView.tsx → src/utils/useLocalAudio.ts} +24 -6
- package/template/src/utils/useMuteToggleLocal.ts +10 -5
- package/template/src/utils/useSearchParams.tsx +18 -0
- package/template/src/wasms/agora-virtual-background.wasm +0 -0
- package/template/src/utils/endCallEveryOne.ts +0 -7
- package/template/src/utils/useDisableButton.tsx +0 -37
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
*/
|
|
12
12
|
import React, {useState, useContext, useEffect} from 'react';
|
|
13
13
|
import {View, Text, StyleSheet, ScrollView} from 'react-native';
|
|
14
|
-
import {PropsContext,
|
|
14
|
+
import {PropsContext, ClientRoleType, ToggleState} from '../../agora-rn-uikit';
|
|
15
15
|
import {isValidReactComponent, isWebInternal, trimText} from '../utils/common';
|
|
16
16
|
import ColorContext from './ColorContext';
|
|
17
17
|
import {useRoomInfo} from './room-info/useRoomInfo';
|
|
@@ -96,7 +96,9 @@ const JoinRoomInputView = ({isDesktop}) => {
|
|
|
96
96
|
{/* <Text style={style.subTextStyle}>
|
|
97
97
|
Enter the name you would like to join the room as
|
|
98
98
|
</Text> */}
|
|
99
|
-
{rtcProps.role ==
|
|
99
|
+
{rtcProps.role == ClientRoleType.ClientRoleAudience && (
|
|
100
|
+
<Spacer size={20} />
|
|
101
|
+
)}
|
|
100
102
|
</>
|
|
101
103
|
) : (
|
|
102
104
|
<></>
|
|
@@ -104,7 +106,7 @@ const JoinRoomInputView = ({isDesktop}) => {
|
|
|
104
106
|
<View
|
|
105
107
|
style={
|
|
106
108
|
$config.EVENT_MODE &&
|
|
107
|
-
rtcProps.role ==
|
|
109
|
+
rtcProps.role == ClientRoleType.ClientRoleAudience && {
|
|
108
110
|
justifyContent: 'space-between',
|
|
109
111
|
flex: 1,
|
|
110
112
|
}
|
|
@@ -117,7 +119,7 @@ const JoinRoomInputView = ({isDesktop}) => {
|
|
|
117
119
|
: {width: '100%'}
|
|
118
120
|
}>
|
|
119
121
|
{$config.ENABLE_WAITING_ROOM &&
|
|
120
|
-
rtcProps.role ===
|
|
122
|
+
rtcProps.role === ClientRoleType.ClientRoleAudience ? (
|
|
121
123
|
<JoinWaitingRoomBtn />
|
|
122
124
|
) : (
|
|
123
125
|
<JoinButton />
|
|
@@ -203,7 +205,7 @@ const JoinRoomButton = () => {
|
|
|
203
205
|
return components;
|
|
204
206
|
});
|
|
205
207
|
return $config.ENABLE_WAITING_ROOM &&
|
|
206
|
-
rtcProps.role ===
|
|
208
|
+
rtcProps.role === ClientRoleType.ClientRoleAudience ? (
|
|
207
209
|
<JoinWaitingRoomBtn />
|
|
208
210
|
) : (
|
|
209
211
|
<JoinButton />
|
|
@@ -350,7 +352,8 @@ const Precall = (props: any) => {
|
|
|
350
352
|
contentContainerStyle={style.mainMobile}
|
|
351
353
|
testID="precall-screen">
|
|
352
354
|
{/* Precall screen only changes for audience in Live Stream event */}
|
|
353
|
-
{$config.EVENT_MODE &&
|
|
355
|
+
{$config.EVENT_MODE &&
|
|
356
|
+
rtcProps.role == ClientRoleType.ClientRoleAudience ? (
|
|
354
357
|
// Live (Audience)
|
|
355
358
|
<View style={{flex: 1}}>
|
|
356
359
|
<View
|
|
@@ -18,7 +18,7 @@ import {
|
|
|
18
18
|
ScrollView,
|
|
19
19
|
useWindowDimensions,
|
|
20
20
|
} from 'react-native';
|
|
21
|
-
import {PropsContext,
|
|
21
|
+
import {PropsContext, ClientRoleType} from '../../agora-rn-uikit';
|
|
22
22
|
import {
|
|
23
23
|
isMobileUA,
|
|
24
24
|
isWebInternal,
|
|
@@ -108,7 +108,9 @@ const JoinRoomInputView = ({isDesktop}) => {
|
|
|
108
108
|
{/* <Text style={style.subTextStyle}>
|
|
109
109
|
Enter the name you would like to join the room as
|
|
110
110
|
</Text> */}
|
|
111
|
-
{rtcProps.role ==
|
|
111
|
+
{rtcProps.role == ClientRoleType.ClientRoleAudience && (
|
|
112
|
+
<Spacer size={40} />
|
|
113
|
+
)}
|
|
112
114
|
</>
|
|
113
115
|
) : (
|
|
114
116
|
<></>
|
|
@@ -116,7 +118,7 @@ const JoinRoomInputView = ({isDesktop}) => {
|
|
|
116
118
|
<View
|
|
117
119
|
style={
|
|
118
120
|
$config.EVENT_MODE &&
|
|
119
|
-
rtcProps.role ==
|
|
121
|
+
rtcProps.role == ClientRoleType.ClientRoleAudience && {
|
|
120
122
|
justifyContent: 'space-between',
|
|
121
123
|
flex: 1,
|
|
122
124
|
}
|
|
@@ -129,7 +131,7 @@ const JoinRoomInputView = ({isDesktop}) => {
|
|
|
129
131
|
: {width: '100%'}
|
|
130
132
|
}>
|
|
131
133
|
{$config.ENABLE_WAITING_ROOM &&
|
|
132
|
-
rtcProps.role ===
|
|
134
|
+
rtcProps.role === ClientRoleType.ClientRoleAudience ? (
|
|
133
135
|
<JoinWaitingRoomBtn />
|
|
134
136
|
) : (
|
|
135
137
|
<JoinButton />
|
|
@@ -217,7 +219,7 @@ const JoinRoomButton = () => {
|
|
|
217
219
|
});
|
|
218
220
|
|
|
219
221
|
return $config.ENABLE_WAITING_ROOM &&
|
|
220
|
-
rtcProps.role ===
|
|
222
|
+
rtcProps.role === ClientRoleType.ClientRoleAudience ? (
|
|
221
223
|
<JoinWaitingRoomBtn />
|
|
222
224
|
) : (
|
|
223
225
|
<JoinButton />
|
|
@@ -355,7 +357,8 @@ const Precall = () => {
|
|
|
355
357
|
) : (
|
|
356
358
|
<>
|
|
357
359
|
<PrecallBeforeView />
|
|
358
|
-
{$config.EVENT_MODE &&
|
|
360
|
+
{$config.EVENT_MODE &&
|
|
361
|
+
rtcProps.role == ClientRoleType.ClientRoleAudience ? (
|
|
359
362
|
<View style={style.root}>
|
|
360
363
|
{!isMobileUA() ? <IDPLogoutComponent /> : <></>}
|
|
361
364
|
<ScrollView contentContainerStyle={style.main}>
|
|
@@ -28,6 +28,7 @@ export interface StoreInterface {
|
|
|
28
28
|
rememberedDevicesListEntries
|
|
29
29
|
>;
|
|
30
30
|
activeDeviceId: Record<MediaDeviceInfo['kind'], string>;
|
|
31
|
+
whiteboardNativeInfoToast?: boolean;
|
|
31
32
|
}
|
|
32
33
|
|
|
33
34
|
export interface StorageContextInterface {
|
|
@@ -36,6 +37,7 @@ export interface StorageContextInterface {
|
|
|
36
37
|
}
|
|
37
38
|
|
|
38
39
|
export const initStoreValue: StoreInterface = {
|
|
40
|
+
whiteboardNativeInfoToast: false,
|
|
39
41
|
token: null,
|
|
40
42
|
displayName: '',
|
|
41
43
|
selectedLanguageCode: '',
|
|
@@ -78,15 +80,16 @@ export const StorageProvider = (props: {children: React.ReactNode}) => {
|
|
|
78
80
|
setReady(true);
|
|
79
81
|
} else {
|
|
80
82
|
const storeFromStorage = JSON.parse(storeString);
|
|
81
|
-
Object.keys(initStoreValue).forEach(
|
|
83
|
+
Object.keys(initStoreValue).forEach(key => {
|
|
82
84
|
if (!storeFromStorage[key]) {
|
|
83
85
|
storeFromStorage[key] = initStoreValue[key];
|
|
84
86
|
}
|
|
85
87
|
});
|
|
86
|
-
//unauth flow delete token from the localstoage if any
|
|
88
|
+
// unauth flow delete token from the localstoage if any
|
|
87
89
|
if (!ENABLE_AUTH) {
|
|
88
90
|
storeFromStorage['token'] = null;
|
|
89
91
|
}
|
|
92
|
+
storeFromStorage['whiteboardNativeInfoToast'] = false;
|
|
90
93
|
setStore(storeFromStorage);
|
|
91
94
|
setReady(true);
|
|
92
95
|
}
|
|
@@ -1,11 +1,17 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import Toast from '../../react-native-toast-message';
|
|
3
3
|
import ToastConfig from '../subComponents/ToastConfig';
|
|
4
|
+
import {useIsRecordingBot} from '../subComponents/recording/useIsRecordingBot';
|
|
4
5
|
|
|
5
6
|
const ToastComponent = () => {
|
|
7
|
+
const {isRecordingBot} = useIsRecordingBot();
|
|
8
|
+
|
|
6
9
|
// if ($config.TOAST_NOTIFICATIONS) {
|
|
7
10
|
// return <Toast ref={(ref) => Toast.setRef(ref)} config={ToastConfig} />;
|
|
8
11
|
// } else return <></>;
|
|
9
|
-
|
|
12
|
+
if (isRecordingBot) {
|
|
13
|
+
return <></>;
|
|
14
|
+
}
|
|
15
|
+
return <Toast ref={ref => Toast.setRef(ref)} config={ToastConfig} />;
|
|
10
16
|
};
|
|
11
17
|
export default ToastComponent;
|
|
@@ -10,7 +10,7 @@ import {createHook} from 'customization-implementation';
|
|
|
10
10
|
import LiveStreamContext, {
|
|
11
11
|
raiseHandListInterface,
|
|
12
12
|
} from '../../components/livestream';
|
|
13
|
-
import {
|
|
13
|
+
import {ClientRoleType, useLocalUid} from '../../../agora-rn-uikit';
|
|
14
14
|
import {filterObject} from '../../utils';
|
|
15
15
|
import {useContent} from 'customization-api';
|
|
16
16
|
|
|
@@ -49,7 +49,7 @@ const LiveStreamDataProvider = (props: ScreenShareProviderProps) => {
|
|
|
49
49
|
(v?.type === 'rtc' || v?.type === 'live') && //||
|
|
50
50
|
//(v?.type === 'screenshare' && v?.video == 1)
|
|
51
51
|
(raiseHandList[k]
|
|
52
|
-
? raiseHandList[k]?.role ==
|
|
52
|
+
? raiseHandList[k]?.role == ClientRoleType.ClientRoleBroadcaster
|
|
53
53
|
: true) &&
|
|
54
54
|
!v?.offline &&
|
|
55
55
|
activeUids.indexOf(v?.uid) !== -1,
|
|
@@ -58,7 +58,7 @@ const LiveStreamDataProvider = (props: ScreenShareProviderProps) => {
|
|
|
58
58
|
defaultContent,
|
|
59
59
|
([k, v]) =>
|
|
60
60
|
(v?.type === 'rtc' || v?.type === 'live') &&
|
|
61
|
-
raiseHandList[k]?.role ==
|
|
61
|
+
raiseHandList[k]?.role == ClientRoleType.ClientRoleAudience &&
|
|
62
62
|
!v.offline,
|
|
63
63
|
);
|
|
64
64
|
const hUids = Object.keys(hostList).map(uid => parseInt(uid));
|
|
@@ -18,7 +18,7 @@ import {
|
|
|
18
18
|
RaiseHandValue,
|
|
19
19
|
raiseHandListInterface,
|
|
20
20
|
} from './Types';
|
|
21
|
-
import {
|
|
21
|
+
import {ClientRoleType, useLocalUid, UidType} from '../../../agora-rn-uikit';
|
|
22
22
|
import {filterObject, isEmptyObject} from '../../utils';
|
|
23
23
|
import {useRoomInfo} from '../room-info/useRoomInfo';
|
|
24
24
|
import {useScreenshare} from '../../subComponents/screenshare/useScreenshare';
|
|
@@ -219,13 +219,13 @@ export const LiveStreamContextProvider: React.FC<
|
|
|
219
219
|
});
|
|
220
220
|
};
|
|
221
221
|
|
|
222
|
-
const updateRtcProps = (newClientRole:
|
|
222
|
+
const updateRtcProps = (newClientRole: ClientRoleType) => {
|
|
223
223
|
setRtcProps((prevState: any) => ({
|
|
224
224
|
...prevState,
|
|
225
225
|
role:
|
|
226
|
-
newClientRole ===
|
|
227
|
-
?
|
|
228
|
-
:
|
|
226
|
+
newClientRole === ClientRoleType.ClientRoleAudience
|
|
227
|
+
? ClientRoleType.ClientRoleAudience
|
|
228
|
+
: ClientRoleType.ClientRoleBroadcaster,
|
|
229
229
|
}));
|
|
230
230
|
};
|
|
231
231
|
|
|
@@ -250,23 +250,23 @@ export const LiveStreamContextProvider: React.FC<
|
|
|
250
250
|
role:
|
|
251
251
|
payload?.role ||
|
|
252
252
|
oldRaisedHandList[userId]?.role ||
|
|
253
|
-
|
|
253
|
+
ClientRoleType.ClientRoleAudience,
|
|
254
254
|
},
|
|
255
255
|
}));
|
|
256
256
|
}
|
|
257
257
|
};
|
|
258
258
|
|
|
259
|
-
const changeClientRoleTo = (newRole:
|
|
259
|
+
const changeClientRoleTo = (newRole: ClientRoleType) => {
|
|
260
260
|
updateRtcProps(newRole);
|
|
261
261
|
};
|
|
262
262
|
|
|
263
|
-
const UpdtLocStateAndBCastAttr = (newRole:
|
|
263
|
+
const UpdtLocStateAndBCastAttr = (newRole: ClientRoleType, ts: number) => {
|
|
264
264
|
switch (newRole) {
|
|
265
|
-
case
|
|
265
|
+
case ClientRoleType.ClientRoleAudience:
|
|
266
266
|
addOrUpdateLiveStreamRequest(localUidRef.current, {
|
|
267
267
|
raised: RaiseHandValue.FALSE,
|
|
268
268
|
ts: ts,
|
|
269
|
-
role:
|
|
269
|
+
role: ClientRoleType.ClientRoleAudience,
|
|
270
270
|
});
|
|
271
271
|
// Audience notfies all host when request is rejected
|
|
272
272
|
events.send(
|
|
@@ -292,12 +292,12 @@ export const LiveStreamContextProvider: React.FC<
|
|
|
292
292
|
PersistanceLevel.Sender,
|
|
293
293
|
);
|
|
294
294
|
break;
|
|
295
|
-
case
|
|
295
|
+
case ClientRoleType.ClientRoleBroadcaster:
|
|
296
296
|
// Update local state
|
|
297
297
|
addOrUpdateLiveStreamRequest(localUidRef.current, {
|
|
298
298
|
raised: RaiseHandValue.TRUE,
|
|
299
299
|
ts: ts,
|
|
300
|
-
role:
|
|
300
|
+
role: ClientRoleType.ClientRoleBroadcaster,
|
|
301
301
|
});
|
|
302
302
|
// Audience notfies all host when request is approved
|
|
303
303
|
events.send(
|
|
@@ -329,7 +329,8 @@ export const LiveStreamContextProvider: React.FC<
|
|
|
329
329
|
const pendingRequests = filterObject(
|
|
330
330
|
raiseHandList,
|
|
331
331
|
([k, v]) =>
|
|
332
|
-
v?.raised === RaiseHandValue.TRUE &&
|
|
332
|
+
v?.raised === RaiseHandValue.TRUE &&
|
|
333
|
+
v?.role == ClientRoleType.ClientRoleAudience,
|
|
333
334
|
);
|
|
334
335
|
|
|
335
336
|
React.useEffect(() => {
|
|
@@ -368,9 +369,9 @@ export const LiveStreamContextProvider: React.FC<
|
|
|
368
369
|
[data.sender]: {
|
|
369
370
|
...prevState[data.sender],
|
|
370
371
|
role:
|
|
371
|
-
data.payload in
|
|
372
|
+
data.payload in ClientRoleType
|
|
372
373
|
? parseInt(data.payload)
|
|
373
|
-
:
|
|
374
|
+
: ClientRoleType.ClientRoleAudience,
|
|
374
375
|
},
|
|
375
376
|
};
|
|
376
377
|
});
|
|
@@ -386,7 +387,9 @@ export const LiveStreamContextProvider: React.FC<
|
|
|
386
387
|
events.send(
|
|
387
388
|
EventNames.ROLE_ATTRIBUTE,
|
|
388
389
|
JSON.stringify(
|
|
389
|
-
rtcProps.role in
|
|
390
|
+
rtcProps.role in ClientRoleType
|
|
391
|
+
? rtcProps.role
|
|
392
|
+
: ClientRoleType.ClientRoleAudience,
|
|
390
393
|
),
|
|
391
394
|
PersistanceLevel.Sender,
|
|
392
395
|
);
|
|
@@ -396,7 +399,9 @@ export const LiveStreamContextProvider: React.FC<
|
|
|
396
399
|
[localUid]: {
|
|
397
400
|
...prevState[localUid],
|
|
398
401
|
role:
|
|
399
|
-
rtcProps.role in
|
|
402
|
+
rtcProps.role in ClientRoleType
|
|
403
|
+
? rtcProps.role
|
|
404
|
+
: ClientRoleType.ClientRoleAudience,
|
|
400
405
|
},
|
|
401
406
|
};
|
|
402
407
|
});
|
|
@@ -440,7 +445,7 @@ export const LiveStreamContextProvider: React.FC<
|
|
|
440
445
|
addOrUpdateLiveStreamRequest(data.sender, {
|
|
441
446
|
ts: data.ts,
|
|
442
447
|
raised: RaiseHandValue.TRUE,
|
|
443
|
-
role:
|
|
448
|
+
role: ClientRoleType.ClientRoleAudience,
|
|
444
449
|
isProcessed: isProcessed,
|
|
445
450
|
});
|
|
446
451
|
break;
|
|
@@ -461,7 +466,7 @@ export const LiveStreamContextProvider: React.FC<
|
|
|
461
466
|
addOrUpdateLiveStreamRequest(data.sender, {
|
|
462
467
|
ts: data.ts,
|
|
463
468
|
raised: RaiseHandValue.FALSE,
|
|
464
|
-
role:
|
|
469
|
+
role: ClientRoleType.ClientRoleAudience,
|
|
465
470
|
isProcessed: isProcessed,
|
|
466
471
|
});
|
|
467
472
|
default:
|
|
@@ -476,7 +481,7 @@ export const LiveStreamContextProvider: React.FC<
|
|
|
476
481
|
addOrUpdateLiveStreamRequest(data.sender, {
|
|
477
482
|
ts: data.ts,
|
|
478
483
|
raised: RaiseHandValue.TRUE,
|
|
479
|
-
role:
|
|
484
|
+
role: ClientRoleType.ClientRoleBroadcaster,
|
|
480
485
|
isProcessed: isProcessed,
|
|
481
486
|
});
|
|
482
487
|
break;
|
|
@@ -484,7 +489,7 @@ export const LiveStreamContextProvider: React.FC<
|
|
|
484
489
|
addOrUpdateLiveStreamRequest(data.sender, {
|
|
485
490
|
ts: data.ts,
|
|
486
491
|
raised: RaiseHandValue.FALSE,
|
|
487
|
-
role:
|
|
492
|
+
role: ClientRoleType.ClientRoleAudience,
|
|
488
493
|
isProcessed: isProcessed,
|
|
489
494
|
});
|
|
490
495
|
break;
|
|
@@ -511,9 +516,9 @@ export const LiveStreamContextProvider: React.FC<
|
|
|
511
516
|
raiseHandRequestAcceptedToastSubHeading?.current(),
|
|
512
517
|
);
|
|
513
518
|
// Promote user's privileges to host
|
|
514
|
-
changeClientRoleTo(
|
|
519
|
+
changeClientRoleTo(ClientRoleType.ClientRoleBroadcaster);
|
|
515
520
|
// Audience updates its local attributes and notfies all host when request is approved
|
|
516
|
-
UpdtLocStateAndBCastAttr(
|
|
521
|
+
UpdtLocStateAndBCastAttr(ClientRoleType.ClientRoleBroadcaster, data.ts);
|
|
517
522
|
},
|
|
518
523
|
);
|
|
519
524
|
/** 2. Audience receives this when the request is rejected by host
|
|
@@ -526,12 +531,12 @@ export const LiveStreamContextProvider: React.FC<
|
|
|
526
531
|
/** 2.a */
|
|
527
532
|
if (
|
|
528
533
|
raiseHandListRef.current[localUidRef.current].role ==
|
|
529
|
-
|
|
534
|
+
ClientRoleType.ClientRoleAudience
|
|
530
535
|
) {
|
|
531
536
|
showToast(raiseHandRequestRejectedToastHeading?.current(), null);
|
|
532
537
|
} else if (
|
|
533
538
|
raiseHandListRef.current[localUidRef.current].role ==
|
|
534
|
-
|
|
539
|
+
ClientRoleType.ClientRoleBroadcaster
|
|
535
540
|
) {
|
|
536
541
|
/** 2.b */
|
|
537
542
|
showToast(
|
|
@@ -541,16 +546,16 @@ export const LiveStreamContextProvider: React.FC<
|
|
|
541
546
|
screenshareContextInstanceRef?.current?.stopUserScreenShare(); // This will not exist on ios
|
|
542
547
|
|
|
543
548
|
// Demote user's privileges to audience
|
|
544
|
-
changeClientRoleTo(
|
|
549
|
+
changeClientRoleTo(ClientRoleType.ClientRoleAudience);
|
|
545
550
|
}
|
|
546
551
|
// Audience updates its local attributes and notfies all host when demoted/request rejected
|
|
547
|
-
UpdtLocStateAndBCastAttr(
|
|
552
|
+
UpdtLocStateAndBCastAttr(ClientRoleType.ClientRoleAudience, data.ts);
|
|
548
553
|
},
|
|
549
554
|
);
|
|
550
555
|
// 3. Audience when receives kickUser notifies all host when is kicked out
|
|
551
556
|
const unsubKickUser = events.on(controlMessageEnum.kickUser, data => {
|
|
552
557
|
// Audience updates its local attributes and notfies all host when they(audience) are kicked out
|
|
553
|
-
UpdtLocStateAndBCastAttr(
|
|
558
|
+
UpdtLocStateAndBCastAttr(ClientRoleType.ClientRoleAudience, data.ts);
|
|
554
559
|
});
|
|
555
560
|
// 4. Host promote audience as co-host
|
|
556
561
|
const unsubPromoteAsCoHost = events.on(
|
|
@@ -558,9 +563,9 @@ export const LiveStreamContextProvider: React.FC<
|
|
|
558
563
|
data => {
|
|
559
564
|
showToast(promoteAsCoHostToastHeading.current(), null);
|
|
560
565
|
// Promote user's privileges to host
|
|
561
|
-
changeClientRoleTo(
|
|
566
|
+
changeClientRoleTo(ClientRoleType.ClientRoleBroadcaster);
|
|
562
567
|
// Audience updates its local attributes and notfies all host when request is approved
|
|
563
|
-
UpdtLocStateAndBCastAttr(
|
|
568
|
+
UpdtLocStateAndBCastAttr(ClientRoleType.ClientRoleBroadcaster, data.ts);
|
|
564
569
|
},
|
|
565
570
|
);
|
|
566
571
|
// 4. New co-host has joined
|
|
@@ -707,12 +712,13 @@ export const LiveStreamContextProvider: React.FC<
|
|
|
707
712
|
* else: Audience Request was not approved by host, and was pending
|
|
708
713
|
*/
|
|
709
714
|
if (
|
|
710
|
-
raiseHandList[localUidRef.current]?.role ==
|
|
715
|
+
raiseHandList[localUidRef.current]?.role ==
|
|
716
|
+
ClientRoleType.ClientRoleBroadcaster &&
|
|
711
717
|
raiseHandList[localUidRef.current]?.raised === RaiseHandValue.TRUE
|
|
712
718
|
) {
|
|
713
719
|
screenshareContextInstanceRef?.current?.stopUserScreenShare(); // This will not exist on ios
|
|
714
720
|
// Change role
|
|
715
|
-
changeClientRoleTo(
|
|
721
|
+
changeClientRoleTo(ClientRoleType.ClientRoleAudience);
|
|
716
722
|
}
|
|
717
723
|
//notify host users
|
|
718
724
|
events.send(
|
|
@@ -725,7 +731,10 @@ export const LiveStreamContextProvider: React.FC<
|
|
|
725
731
|
}),
|
|
726
732
|
PersistanceLevel.Sender,
|
|
727
733
|
);
|
|
728
|
-
UpdtLocStateAndBCastAttr(
|
|
734
|
+
UpdtLocStateAndBCastAttr(
|
|
735
|
+
ClientRoleType.ClientRoleAudience,
|
|
736
|
+
new Date().getTime(),
|
|
737
|
+
);
|
|
729
738
|
showToast(raiseHandRequestRecallLocalToastHeading?.current(), null);
|
|
730
739
|
};
|
|
731
740
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// DECLARE ENUMS & CONTANTS
|
|
2
2
|
import {TextDataInterface} from '../../language/default-labels';
|
|
3
|
-
import {
|
|
3
|
+
import {ClientRoleType} from '../../../agora-rn-uikit';
|
|
4
4
|
|
|
5
5
|
export enum RaiseHandValue {
|
|
6
6
|
TRUE = 'TRUE',
|
|
@@ -14,7 +14,7 @@ export interface raiseHandListInterface {
|
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
export interface raiseHandItemInterface {
|
|
17
|
-
role:
|
|
17
|
+
role: ClientRoleType;
|
|
18
18
|
raised: RaiseHandValue;
|
|
19
19
|
ts: number;
|
|
20
20
|
isProcessed: boolean;
|
|
@@ -13,7 +13,7 @@ import React, {useContext, useRef, useState} from 'react';
|
|
|
13
13
|
import {View, StyleSheet, Text, TouchableOpacity} from 'react-native';
|
|
14
14
|
import RemoteAudioMute from '../../subComponents/RemoteAudioMute';
|
|
15
15
|
import RemoteVideoMute from '../../subComponents/RemoteVideoMute';
|
|
16
|
-
import {
|
|
16
|
+
import {ContentInterface, UidType} from '../../../agora-rn-uikit';
|
|
17
17
|
import UserAvatar from '../../atoms/UserAvatar';
|
|
18
18
|
import {isMobileUA, isWebInternal} from '../../utils/common';
|
|
19
19
|
import ActionMenu, {ActionMenuItem} from '../../atoms/ActionMenu';
|
|
@@ -21,7 +21,11 @@ import {useChatMessages} from '../chat-messages/useChatMessages';
|
|
|
21
21
|
import {useLiveStreamDataContext} from '../contexts/LiveStreamDataContext';
|
|
22
22
|
import useRemoteEndCall from '../../utils/useRemoteEndCall';
|
|
23
23
|
import LiveStreamContext from '../livestream/LiveStreamContext';
|
|
24
|
-
import {
|
|
24
|
+
import {
|
|
25
|
+
ClientRoleType,
|
|
26
|
+
DispatchContext,
|
|
27
|
+
UidType,
|
|
28
|
+
} from '../../../agora-rn-uikit';
|
|
25
29
|
import {useWindowDimensions} from 'react-native';
|
|
26
30
|
import {
|
|
27
31
|
LiveStreamControlMessageEnum,
|
|
@@ -299,7 +303,8 @@ export default function UserActionMenuOptionsOptions(
|
|
|
299
303
|
if ($config.EVENT_MODE) {
|
|
300
304
|
if (
|
|
301
305
|
raiseHandList[user.uid]?.raised === RaiseHandValue.TRUE &&
|
|
302
|
-
raiseHandList[user.uid]?.role ==
|
|
306
|
+
raiseHandList[user.uid]?.role ==
|
|
307
|
+
ClientRoleType.ClientRoleBroadcaster
|
|
303
308
|
) {
|
|
304
309
|
items.push({
|
|
305
310
|
isBase64Icon: true,
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/*
|
|
2
|
+
********************************************
|
|
3
|
+
Copyright © 2024 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, useState} from 'react';
|
|
13
|
+
import type {RouteProps} from 'react-router';
|
|
14
|
+
import StorageContext from '../StorageContext';
|
|
15
|
+
import Loading from '../../subComponents/Loading';
|
|
16
|
+
import {useIsRecordingBot} from '../../subComponents/recording/useIsRecordingBot';
|
|
17
|
+
|
|
18
|
+
interface RecordingBotRouteProps extends RouteProps {
|
|
19
|
+
children: React.ReactNode;
|
|
20
|
+
history: any;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const RecordingBotRoute: React.FC<RecordingBotRouteProps> = props => {
|
|
24
|
+
const {setStore, store} = useContext(StorageContext);
|
|
25
|
+
const [ready, setReady] = useState(false);
|
|
26
|
+
const {recordingBotToken} = useIsRecordingBot();
|
|
27
|
+
useEffect(() => {
|
|
28
|
+
setStore &&
|
|
29
|
+
setStore(prevState => ({
|
|
30
|
+
...prevState,
|
|
31
|
+
token: recordingBotToken,
|
|
32
|
+
}));
|
|
33
|
+
}, []);
|
|
34
|
+
|
|
35
|
+
useEffect(() => {
|
|
36
|
+
store?.token === recordingBotToken && setReady(true);
|
|
37
|
+
}, [store?.token, recordingBotToken]);
|
|
38
|
+
|
|
39
|
+
return ready ? <>{props.children}</> : <Loading text={'Loading...'} />;
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
export default RecordingBotRoute;
|
|
@@ -5,9 +5,9 @@ import {ILocalVideoTrack} from 'agora-rtc-sdk-ng';
|
|
|
5
5
|
import {retrieveImagesFromAsyncStorage} from './VButils.native';
|
|
6
6
|
|
|
7
7
|
import RtcEngine, {
|
|
8
|
-
|
|
8
|
+
BackgroundBlurDegree,
|
|
9
9
|
VirtualBackgroundSource,
|
|
10
|
-
|
|
10
|
+
BackgroundSourceType,
|
|
11
11
|
} from 'react-native-agora';
|
|
12
12
|
import {useRtc} from 'customization-api';
|
|
13
13
|
import RNFS from 'react-native-fs';
|
|
@@ -45,7 +45,7 @@ type VBContextValue = {
|
|
|
45
45
|
export const VBContext = React.createContext<VBContextValue>({
|
|
46
46
|
isVBActive: false,
|
|
47
47
|
setIsVBActive: () => {},
|
|
48
|
-
vbMode:
|
|
48
|
+
vbMode: null,
|
|
49
49
|
setVBmode: () => {},
|
|
50
50
|
selectedImage: null,
|
|
51
51
|
setSelectedImage: () => {},
|
|
@@ -72,7 +72,7 @@ const downloadBase64Image = async (base64Data, filename) => {
|
|
|
72
72
|
|
|
73
73
|
const VBProvider: React.FC = ({children}) => {
|
|
74
74
|
const [isVBActive, setIsVBActive] = React.useState<boolean>(false);
|
|
75
|
-
const [vbMode, setVBmode] = React.useState<VBMode>(
|
|
75
|
+
const [vbMode, setVBmode] = React.useState<VBMode>(null);
|
|
76
76
|
const [selectedImage, setSelectedImage] = React.useState<
|
|
77
77
|
ImageSourcePropType | string | null
|
|
78
78
|
>(null);
|
|
@@ -114,9 +114,9 @@ const VBProvider: React.FC = ({children}) => {
|
|
|
114
114
|
disable = false,
|
|
115
115
|
) => {
|
|
116
116
|
if (disable) {
|
|
117
|
-
await rtc?.RtcEngineUnsafe.enableVirtualBackground(false, config);
|
|
117
|
+
await rtc?.RtcEngineUnsafe.enableVirtualBackground(false, config, {});
|
|
118
118
|
} else {
|
|
119
|
-
await rtc?.RtcEngineUnsafe.enableVirtualBackground(true, config);
|
|
119
|
+
await rtc?.RtcEngineUnsafe.enableVirtualBackground(true, config, {});
|
|
120
120
|
}
|
|
121
121
|
};
|
|
122
122
|
|
|
@@ -133,32 +133,29 @@ const VBProvider: React.FC = ({children}) => {
|
|
|
133
133
|
disableVB();
|
|
134
134
|
break;
|
|
135
135
|
default:
|
|
136
|
-
|
|
136
|
+
break;
|
|
137
137
|
}
|
|
138
138
|
}, [vbMode, selectedImage, saveVB, previewVideoTrack]);
|
|
139
139
|
|
|
140
140
|
const blurVB = async () => {
|
|
141
|
-
const blurConfig: VirtualBackgroundSource = new VirtualBackgroundSource(
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
});
|
|
141
|
+
const blurConfig: VirtualBackgroundSource = new VirtualBackgroundSource();
|
|
142
|
+
blurConfig.background_source_type = BackgroundSourceType.BackgroundBlur;
|
|
143
|
+
blurConfig.blur_degree = BackgroundBlurDegree.BlurDegreeMedium;
|
|
145
144
|
await applyVirtualBackgroundToMainView(blurConfig);
|
|
146
145
|
};
|
|
147
146
|
|
|
148
147
|
const imageVB = async () => {
|
|
149
148
|
const savedImagePath = await downloadBase64Image(selectedImage, 'img.png');
|
|
150
|
-
const imageConfig = new VirtualBackgroundSource(
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
});
|
|
149
|
+
const imageConfig: VirtualBackgroundSource = new VirtualBackgroundSource();
|
|
150
|
+
imageConfig.background_source_type = BackgroundSourceType.BackgroundImg;
|
|
151
|
+
imageConfig.source = savedImagePath;
|
|
154
152
|
await applyVirtualBackgroundToMainView(imageConfig);
|
|
155
153
|
};
|
|
156
154
|
|
|
157
155
|
const disableVB = async () => {
|
|
158
|
-
const disableConfig: VirtualBackgroundSource =
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
156
|
+
const disableConfig: VirtualBackgroundSource =
|
|
157
|
+
new VirtualBackgroundSource();
|
|
158
|
+
disableConfig.background_source_type = BackgroundSourceType.BackgroundNone;
|
|
162
159
|
await applyVirtualBackgroundToMainView(disableConfig, true);
|
|
163
160
|
};
|
|
164
161
|
|
|
@@ -6,7 +6,7 @@ import AgoraRTC, {ILocalVideoTrack} from 'agora-rtc-sdk-ng';
|
|
|
6
6
|
import Image from 'react-native';
|
|
7
7
|
import VirtualBackgroundExtension from 'agora-extension-virtual-background';
|
|
8
8
|
//@ts-ignore
|
|
9
|
-
import wasm1 from '
|
|
9
|
+
import wasm1 from '../../wasms/agora-virtual-background.wasm';
|
|
10
10
|
import {IconsInterface} from '../../atoms/CustomIcon';
|
|
11
11
|
import {PropsContext} from '../../../agora-rn-uikit';
|
|
12
12
|
import {isMobileUA} from '../../utils/common';
|
|
@@ -77,6 +77,8 @@ export interface whiteboardContextInterface {
|
|
|
77
77
|
getWhiteboardUid: () => number;
|
|
78
78
|
whiteboardStartedFirst?: boolean;
|
|
79
79
|
clearAllCallback: () => void;
|
|
80
|
+
isWhiteboardOnFullScreen?: boolean;
|
|
81
|
+
setWhiteboardOnFullScreen?: React.Dispatch<React.SetStateAction<boolean>>;
|
|
80
82
|
}
|
|
81
83
|
|
|
82
84
|
export interface WhiteboardPropsInterface {
|
|
@@ -90,6 +92,7 @@ const WhiteboardConfigure: React.FC<WhiteboardPropsInterface> = props => {
|
|
|
90
92
|
const [boardColor, setBoardColor] = useState<BoardColor>(BoardColor.White);
|
|
91
93
|
// Defines whiteboard room state, whether disconnected, Connected, Connecting etc.
|
|
92
94
|
const [whiteboardRoomState, setWhiteboardRoomState] = useState();
|
|
95
|
+
const [isWhiteboardOnFullScreen, setWhiteboardOnFullScreen] = useState(false);
|
|
93
96
|
const whiteboardUidRef = useRef(Date.now());
|
|
94
97
|
const whiteboardRoom = useRef({});
|
|
95
98
|
|
|
@@ -109,6 +112,12 @@ const WhiteboardConfigure: React.FC<WhiteboardPropsInterface> = props => {
|
|
|
109
112
|
return whiteboardUidRef?.current;
|
|
110
113
|
};
|
|
111
114
|
|
|
115
|
+
useEffect(() => {
|
|
116
|
+
if (!whiteboardActive && isWhiteboardOnFullScreen) {
|
|
117
|
+
setWhiteboardOnFullScreen(false);
|
|
118
|
+
}
|
|
119
|
+
}, [whiteboardActive]);
|
|
120
|
+
|
|
112
121
|
const clearAllCallback = () => {};
|
|
113
122
|
return (
|
|
114
123
|
<whiteboardContext.Provider
|
|
@@ -126,6 +135,8 @@ const WhiteboardConfigure: React.FC<WhiteboardPropsInterface> = props => {
|
|
|
126
135
|
insertImageIntoWhiteboard,
|
|
127
136
|
whiteboardStartedFirst,
|
|
128
137
|
clearAllCallback,
|
|
138
|
+
isWhiteboardOnFullScreen,
|
|
139
|
+
setWhiteboardOnFullScreen,
|
|
129
140
|
}}>
|
|
130
141
|
{props.children}
|
|
131
142
|
</whiteboardContext.Provider>
|