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
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
ToggleState,
|
|
15
15
|
PermissionState,
|
|
16
16
|
ImageIcon as UIKitImageIcon,
|
|
17
|
-
|
|
17
|
+
ClientRoleType,
|
|
18
18
|
PropsContext,
|
|
19
19
|
RtcContext,
|
|
20
20
|
DispatchContext,
|
|
@@ -42,9 +42,6 @@ import {
|
|
|
42
42
|
toolbarItemCameraText,
|
|
43
43
|
toolbarItemCameraTooltipText,
|
|
44
44
|
} from '../language/default-labels/videoCallScreenLabels';
|
|
45
|
-
import events from '../rtm-events-api';
|
|
46
|
-
import {controlMessageEnum} from '../components/ChatContext';
|
|
47
|
-
import {MUTE_REMOTE_TYPE} from '../utils/useRemoteMute';
|
|
48
45
|
|
|
49
46
|
/**
|
|
50
47
|
* A component to mute / unmute the local video
|
|
@@ -62,9 +59,6 @@ export interface LocalVideoMuteProps {
|
|
|
62
59
|
}
|
|
63
60
|
|
|
64
61
|
function LocalVideoMute(props: LocalVideoMuteProps) {
|
|
65
|
-
const {dispatch} = useContext(DispatchContext);
|
|
66
|
-
const {RtcEngineUnsafe} = useContext(RtcContext);
|
|
67
|
-
|
|
68
62
|
const {rtcProps} = useContext(PropsContext);
|
|
69
63
|
const {isScreenshareActive} = useScreenshare();
|
|
70
64
|
const {setShowStopScreenSharePopup} = useVideoCall();
|
|
@@ -73,47 +67,10 @@ function LocalVideoMute(props: LocalVideoMuteProps) {
|
|
|
73
67
|
data: {isHost},
|
|
74
68
|
} = useRoomInfo();
|
|
75
69
|
|
|
76
|
-
const isHostRef = useRef(isHost);
|
|
77
|
-
useEffect(() => {
|
|
78
|
-
isHostRef.current = isHost;
|
|
79
|
-
}, [isHost]);
|
|
80
|
-
|
|
81
70
|
const local = useLocalUserInfo();
|
|
82
71
|
const isHandRaised = useIsHandRaised();
|
|
83
72
|
const localMute = useMuteToggleLocal();
|
|
84
73
|
const {showToolTip = false, disabled = false, showWarningIcon = true} = props;
|
|
85
|
-
|
|
86
|
-
useEffect(() => {
|
|
87
|
-
events.on(controlMessageEnum.disableButton, async ({payload}) => {
|
|
88
|
-
try {
|
|
89
|
-
const data = JSON.parse(payload);
|
|
90
|
-
if (
|
|
91
|
-
data &&
|
|
92
|
-
data?.button === MUTE_REMOTE_TYPE.video &&
|
|
93
|
-
!isHostRef.current
|
|
94
|
-
) {
|
|
95
|
-
if (data?.action === true) {
|
|
96
|
-
isWebInternal()
|
|
97
|
-
? await RtcEngineUnsafe.muteLocalVideoStream(true)
|
|
98
|
-
: //@ts-ignore
|
|
99
|
-
await RtcEngineUnsafe.enableLocalVideo(false);
|
|
100
|
-
dispatch({
|
|
101
|
-
type: 'LocalMuteVideo',
|
|
102
|
-
value: [0, true],
|
|
103
|
-
});
|
|
104
|
-
} else {
|
|
105
|
-
dispatch({
|
|
106
|
-
type: 'LocalMuteVideo',
|
|
107
|
-
value: [0, false],
|
|
108
|
-
});
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
} catch (error) {
|
|
112
|
-
console.log('debugging error on disableButton');
|
|
113
|
-
}
|
|
114
|
-
});
|
|
115
|
-
}, []);
|
|
116
|
-
|
|
117
74
|
const {isOnActionSheet, isOnFirstRow, showLabel} = useActionSheet();
|
|
118
75
|
const {position} = useToolbar();
|
|
119
76
|
const {
|
|
@@ -197,8 +154,9 @@ function LocalVideoMute(props: LocalVideoMuteProps) {
|
|
|
197
154
|
// justifyContent: 'center',
|
|
198
155
|
// alignItems: 'center',
|
|
199
156
|
// };
|
|
200
|
-
const isAudience = rtcProps?.role ==
|
|
201
|
-
const isBroadCasting =
|
|
157
|
+
const isAudience = rtcProps?.role == ClientRoleType.ClientRoleAudience;
|
|
158
|
+
const isBroadCasting =
|
|
159
|
+
rtcProps?.role == ClientRoleType.ClientRoleBroadcaster;
|
|
202
160
|
|
|
203
161
|
iconButtonProps.disabled =
|
|
204
162
|
permissionDenied || ($config.EVENT_MODE && isAudience && !isBroadCasting)
|
|
@@ -234,7 +192,7 @@ function LocalVideoMute(props: LocalVideoMuteProps) {
|
|
|
234
192
|
}
|
|
235
193
|
|
|
236
194
|
if (
|
|
237
|
-
rtcProps.role ==
|
|
195
|
+
rtcProps.role == ClientRoleType.ClientRoleAudience &&
|
|
238
196
|
$config.EVENT_MODE &&
|
|
239
197
|
!$config.RAISE_HAND
|
|
240
198
|
) {
|
|
@@ -242,11 +200,11 @@ function LocalVideoMute(props: LocalVideoMuteProps) {
|
|
|
242
200
|
}
|
|
243
201
|
|
|
244
202
|
if (
|
|
245
|
-
(rtcProps.role ==
|
|
203
|
+
(rtcProps.role == ClientRoleType.ClientRoleAudience &&
|
|
246
204
|
$config.EVENT_MODE &&
|
|
247
205
|
$config.RAISE_HAND &&
|
|
248
206
|
!isHost) ||
|
|
249
|
-
local.
|
|
207
|
+
local.videoBtnDisabled
|
|
250
208
|
) {
|
|
251
209
|
iconButtonProps.iconProps = {
|
|
252
210
|
...iconButtonProps.iconProps,
|
|
@@ -254,7 +212,7 @@ function LocalVideoMute(props: LocalVideoMuteProps) {
|
|
|
254
212
|
tintColor: $config.SEMANTIC_NEUTRAL,
|
|
255
213
|
};
|
|
256
214
|
iconButtonProps.toolTipMessage =
|
|
257
|
-
showToolTip && !local.
|
|
215
|
+
showToolTip && !local.videoBtnDisabled
|
|
258
216
|
? lstooltip(isHandRaised(local.uid))
|
|
259
217
|
: '';
|
|
260
218
|
iconButtonProps.disabled = true;
|
|
@@ -13,7 +13,7 @@ import React, {useContext, useEffect, useState, useMemo} from 'react';
|
|
|
13
13
|
import {StyleSheet, View, Text} from 'react-native';
|
|
14
14
|
import {
|
|
15
15
|
PropsContext,
|
|
16
|
-
|
|
16
|
+
ClientRoleType,
|
|
17
17
|
LocalContext,
|
|
18
18
|
PermissionState,
|
|
19
19
|
LocalUserContext,
|
|
@@ -68,7 +68,10 @@ const useSelectDevice = (): [boolean, string] => {
|
|
|
68
68
|
const [isPickerDisabled, setPickerDisabled] = React.useState<boolean>(false);
|
|
69
69
|
|
|
70
70
|
React.useEffect(() => {
|
|
71
|
-
if (
|
|
71
|
+
if (
|
|
72
|
+
$config.EVENT_MODE &&
|
|
73
|
+
rtcProps.role === ClientRoleType.ClientRoleAudience
|
|
74
|
+
) {
|
|
72
75
|
setPickerDisabled(true);
|
|
73
76
|
setBtnTheme('rgba(16, 16, 16, 0.3)');
|
|
74
77
|
} else {
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
*/
|
|
12
12
|
import React, {useContext, useEffect} from 'react';
|
|
13
13
|
import {StyleSheet, View, Text} from 'react-native';
|
|
14
|
-
import {PropsContext,
|
|
14
|
+
import {PropsContext, ClientRoleType} from '../../agora-rn-uikit';
|
|
15
15
|
import DeviceContext from '../components/DeviceContext';
|
|
16
16
|
import ColorContext from '../components/ColorContext';
|
|
17
17
|
import {useString} from '../utils/useString';
|
|
@@ -30,7 +30,10 @@ const useSelectDevice = (): [boolean, string] => {
|
|
|
30
30
|
const [btnTheme, setBtnTheme] = React.useState<string>(primaryColor);
|
|
31
31
|
const [isPickerDisabled, setPickerDisabled] = React.useState<boolean>(false);
|
|
32
32
|
React.useEffect(() => {
|
|
33
|
-
if (
|
|
33
|
+
if (
|
|
34
|
+
$config.EVENT_MODE &&
|
|
35
|
+
rtcProps.role === ClientRoleType.ClientRoleAudience
|
|
36
|
+
) {
|
|
34
37
|
setPickerDisabled(true);
|
|
35
38
|
setBtnTheme('rgba(16, 16, 16, 0.3)');
|
|
36
39
|
} else {
|
|
@@ -60,7 +63,7 @@ const SelectVideoDevice = (props: SelectVideoDeviceProps) => {
|
|
|
60
63
|
return true;
|
|
61
64
|
}
|
|
62
65
|
})
|
|
63
|
-
?.map(
|
|
66
|
+
?.map(device => {
|
|
64
67
|
return {
|
|
65
68
|
label: device.label,
|
|
66
69
|
value: device.deviceId,
|
|
@@ -102,7 +105,7 @@ const SelectAudioDevice = (props: SelectAudioDeviceProps) => {
|
|
|
102
105
|
const [isFocussed, setIsFocussed] = React.useState(false);
|
|
103
106
|
|
|
104
107
|
const data = deviceList
|
|
105
|
-
.filter(
|
|
108
|
+
.filter(device => {
|
|
106
109
|
if (device.kind === 'audioinput') {
|
|
107
110
|
return true;
|
|
108
111
|
}
|
|
@@ -140,12 +143,12 @@ const SelectDeviceSettings = () => {
|
|
|
140
143
|
const {deviceList} = useContext(DeviceContext);
|
|
141
144
|
const {setCameraAvailable, setMicAvailable} = usePreCall();
|
|
142
145
|
|
|
143
|
-
const audioDevices = deviceList.filter(
|
|
146
|
+
const audioDevices = deviceList.filter(device => {
|
|
144
147
|
if (device.kind === 'audioinput') {
|
|
145
148
|
return true;
|
|
146
149
|
}
|
|
147
150
|
});
|
|
148
|
-
const videoDevices = deviceList.filter(
|
|
151
|
+
const videoDevices = deviceList.filter(device => {
|
|
149
152
|
if (device.kind === 'videoinput') {
|
|
150
153
|
return true;
|
|
151
154
|
}
|
|
@@ -6,11 +6,14 @@ import CaptionText from './CaptionText';
|
|
|
6
6
|
import Loading from '../Loading';
|
|
7
7
|
import {isWebInternal} from '../../utils/common';
|
|
8
8
|
import useStreamMessageUtils from './useStreamMessageUtils';
|
|
9
|
-
import {StreamMessageCallback} from 'react-native-agora/lib/typescript/common/RtcEvents';
|
|
10
9
|
import hexadecimalTransparency from '../../utils/hexadecimalTransparency';
|
|
11
10
|
import {useString} from '../../utils/useString';
|
|
12
11
|
import {sttSettingSpokenLanguageText} from '../../language/default-labels/videoCallScreenLabels';
|
|
13
12
|
|
|
13
|
+
type WebStreamMessageArgs = [number, Uint8Array];
|
|
14
|
+
type NativeStreamMessageArgs = [{}, number, number, Uint8Array, number, number];
|
|
15
|
+
type StreamMessageArgs = WebStreamMessageArgs | NativeStreamMessageArgs;
|
|
16
|
+
|
|
14
17
|
const Caption: React.FC = () => {
|
|
15
18
|
const {RtcEngineUnsafe} = useRtc();
|
|
16
19
|
const {
|
|
@@ -28,25 +31,24 @@ const Caption: React.FC = () => {
|
|
|
28
31
|
const [activelinesAvailable, setActiveLinesAvailable] = React.useState(0);
|
|
29
32
|
const [inActiveLinesAvailable, setInActiveLinesAvaialble] = React.useState(0);
|
|
30
33
|
|
|
31
|
-
const handleStreamMessageCallback = (
|
|
32
|
-
...args: [number, Uint8Array] | [number, string, Uint8Array]
|
|
33
|
-
) => {
|
|
34
|
+
const handleStreamMessageCallback = (...args: StreamMessageArgs) => {
|
|
34
35
|
setIsSTTListenerAdded(true);
|
|
35
36
|
if (isWebInternal()) {
|
|
36
|
-
|
|
37
|
+
const [uid, data] = args as WebStreamMessageArgs;
|
|
38
|
+
streamMessageCallback([uid, data]);
|
|
37
39
|
} else {
|
|
38
|
-
const [uid, , data] = args;
|
|
39
|
-
|
|
40
|
-
streamMessageCallback([uid, new Uint8Array(streamBuffer)]);
|
|
40
|
+
const [, uid, , data] = args as NativeStreamMessageArgs;
|
|
41
|
+
streamMessageCallback([uid, data]);
|
|
41
42
|
}
|
|
42
43
|
};
|
|
43
44
|
|
|
44
45
|
React.useEffect(() => {
|
|
45
46
|
!isSTTListenerAdded &&
|
|
46
47
|
RtcEngineUnsafe.addListener(
|
|
47
|
-
'
|
|
48
|
-
handleStreamMessageCallback
|
|
48
|
+
'onStreamMessage',
|
|
49
|
+
handleStreamMessageCallback,
|
|
49
50
|
);
|
|
51
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
50
52
|
}, []);
|
|
51
53
|
|
|
52
54
|
if (isLangChangeInProgress)
|
|
@@ -31,7 +31,6 @@ import ImageIcon from '../../atoms/ImageIcon';
|
|
|
31
31
|
import hexadecimalTransparency from '../../../src/utils/hexadecimalTransparency';
|
|
32
32
|
import Spacer from '../../atoms/Spacer';
|
|
33
33
|
import useStreamMessageUtils from './useStreamMessageUtils';
|
|
34
|
-
import {StreamMessageCallback} from 'react-native-agora/lib/typescript/common/RtcEvents';
|
|
35
34
|
import useCaptionWidth from './useCaptionWidth';
|
|
36
35
|
import DownloadTranscriptBtn from './DownloadTranscriptBtn';
|
|
37
36
|
import {useString} from '../../../src/utils/useString';
|
|
@@ -45,6 +44,11 @@ import {
|
|
|
45
44
|
interface TranscriptProps {
|
|
46
45
|
showHeader?: boolean;
|
|
47
46
|
}
|
|
47
|
+
|
|
48
|
+
type WebStreamMessageArgs = [number, Uint8Array];
|
|
49
|
+
type NativeStreamMessageArgs = [{}, number, number, Uint8Array, number, number];
|
|
50
|
+
type StreamMessageArgs = WebStreamMessageArgs | NativeStreamMessageArgs;
|
|
51
|
+
|
|
48
52
|
const Transcript = (props: TranscriptProps) => {
|
|
49
53
|
const settingSpokenLanguageLabel = useString(sttSettingSpokenLanguageText)();
|
|
50
54
|
const searchText = useString(sttTranscriptPanelSearchText)();
|
|
@@ -175,26 +179,25 @@ const Transcript = (props: TranscriptProps) => {
|
|
|
175
179
|
return <Text style={styles.emptyMsg}>{noresults}</Text>;
|
|
176
180
|
};
|
|
177
181
|
|
|
178
|
-
const handleStreamMessageCallback = (
|
|
179
|
-
...args: [number, Uint8Array] | [number, string, Uint8Array]
|
|
180
|
-
) => {
|
|
182
|
+
const handleStreamMessageCallback = (...args: StreamMessageArgs) => {
|
|
181
183
|
setIsSTTListenerAdded(true);
|
|
182
184
|
if (isWebInternal()) {
|
|
183
|
-
|
|
185
|
+
const [uid, data] = args as WebStreamMessageArgs;
|
|
186
|
+
streamMessageCallback([uid, data]);
|
|
184
187
|
} else {
|
|
185
|
-
const [uid, , data] = args;
|
|
186
|
-
|
|
187
|
-
streamMessageCallback([uid, new Uint8Array(streamBuffer)]);
|
|
188
|
+
const [, uid, , data] = args as NativeStreamMessageArgs;
|
|
189
|
+
streamMessageCallback([uid, data]);
|
|
188
190
|
}
|
|
189
191
|
};
|
|
190
192
|
|
|
191
193
|
React.useEffect(() => {
|
|
192
194
|
if (!isSTTListenerAdded) {
|
|
193
195
|
RtcEngineUnsafe.addListener(
|
|
194
|
-
'
|
|
195
|
-
handleStreamMessageCallback
|
|
196
|
+
'onStreamMessage',
|
|
197
|
+
handleStreamMessageCallback,
|
|
196
198
|
);
|
|
197
199
|
}
|
|
200
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
198
201
|
}, []);
|
|
199
202
|
|
|
200
203
|
return (
|
|
@@ -33,22 +33,17 @@ const useTranscriptDownload = (): {
|
|
|
33
33
|
.writeFile(filePath, finalContent, 'utf8')
|
|
34
34
|
.then(() => {
|
|
35
35
|
console.warn('Content downloaded successfully on native.');
|
|
36
|
-
//
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
.
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
.catch(error => {
|
|
48
|
-
console.error('Error sharing file:', error);
|
|
49
|
-
reject(error);
|
|
50
|
-
});
|
|
51
|
-
}
|
|
36
|
+
// need to show the preview of downloaded file
|
|
37
|
+
Share.open({url: `file://${filePath}`, type: 'text/plain'})
|
|
38
|
+
.then(res => {
|
|
39
|
+
// console.warn('File shared successfully:', res);
|
|
40
|
+
resolve(filePath);
|
|
41
|
+
})
|
|
42
|
+
.catch(error => {
|
|
43
|
+
// console.error('Error sharing file:', error);
|
|
44
|
+
reject(error);
|
|
45
|
+
});
|
|
46
|
+
|
|
52
47
|
resolve(filePath);
|
|
53
48
|
})
|
|
54
49
|
.catch(error => {
|
|
@@ -2,7 +2,7 @@ import React, {useContext} from 'react';
|
|
|
2
2
|
import {View} from 'react-native';
|
|
3
3
|
import RemoteLiveStreamApprovedRequestRecall from './controls/RemoteLiveStreamApprovedRequestRecall';
|
|
4
4
|
import LiveStreamContext, {RaiseHandValue} from '../../components/livestream';
|
|
5
|
-
import {
|
|
5
|
+
import {ClientRoleType} from '../../../agora-rn-uikit';
|
|
6
6
|
|
|
7
7
|
const ApprovedLiveStreamControlsView = (props: {
|
|
8
8
|
uid: number;
|
|
@@ -13,7 +13,7 @@ const ApprovedLiveStreamControlsView = (props: {
|
|
|
13
13
|
|
|
14
14
|
if (
|
|
15
15
|
raiseHandList[uid]?.raised === RaiseHandValue.TRUE &&
|
|
16
|
-
raiseHandList[uid]?.role ==
|
|
16
|
+
raiseHandList[uid]?.role == ClientRoleType.ClientRoleBroadcaster
|
|
17
17
|
) {
|
|
18
18
|
return (
|
|
19
19
|
<View style={[p_styles.actionBtnIcon, {marginRight: 10}]}>
|
|
@@ -6,7 +6,7 @@ import LiveStreamContext, {RaiseHandValue} from '../../components/livestream';
|
|
|
6
6
|
import {filterObject} from '../../utils/index';
|
|
7
7
|
import ParticipantSectionTitle from '../../components/participants/ParticipantSectionTitle';
|
|
8
8
|
import {useString} from '../../utils/useString';
|
|
9
|
-
import {
|
|
9
|
+
import {ClientRoleType} from '../../../agora-rn-uikit';
|
|
10
10
|
import {useContent} from 'customization-api';
|
|
11
11
|
import UserAvatar from '../../atoms/UserAvatar';
|
|
12
12
|
import Spacer from '../../atoms/Spacer';
|
|
@@ -31,7 +31,8 @@ const CurrentLiveStreamRequestsView = (props: any) => {
|
|
|
31
31
|
filterObject(
|
|
32
32
|
raiseHandList,
|
|
33
33
|
([k, v]) =>
|
|
34
|
-
v?.raised === RaiseHandValue.TRUE &&
|
|
34
|
+
v?.raised === RaiseHandValue.TRUE &&
|
|
35
|
+
v?.role == ClientRoleType.ClientRoleAudience,
|
|
35
36
|
),
|
|
36
37
|
);
|
|
37
38
|
}, [raiseHandList]);
|
|
@@ -18,7 +18,7 @@ import Styles from '../../../components/styles';
|
|
|
18
18
|
import ChatContext from '../../../components/ChatContext';
|
|
19
19
|
import IconButton from '../../../atoms/IconButton';
|
|
20
20
|
import ThemeConfig from '../../../theme';
|
|
21
|
-
import {
|
|
21
|
+
import {PropsContext} from '../../../../agora-rn-uikit';
|
|
22
22
|
import {useContent} from 'customization-api';
|
|
23
23
|
import {isMobileUA} from '../../../utils/common';
|
|
24
24
|
import {IconButtonProps} from '../../../atoms/IconButton';
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import {useSearchParams} from '../../utils/useSearchParams';
|
|
2
|
+
|
|
3
|
+
interface RecordingBotUIConfig {
|
|
4
|
+
chat: boolean;
|
|
5
|
+
topBar: boolean;
|
|
6
|
+
bottomBar: boolean;
|
|
7
|
+
stt: boolean;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
const regexPattern = new RegExp('true');
|
|
11
|
+
|
|
12
|
+
export function useIsRecordingBot() {
|
|
13
|
+
// Reading and setting URL params
|
|
14
|
+
const isRecordingBot = useSearchParams().get('bot');
|
|
15
|
+
const recordingBotToken = useSearchParams().get('token');
|
|
16
|
+
const recordingBotName = useSearchParams().get('user_name');
|
|
17
|
+
const isRecordingBotRoute = isRecordingBot && recordingBotToken;
|
|
18
|
+
|
|
19
|
+
const chatParam = useSearchParams().get('chat');
|
|
20
|
+
const topBarParam = useSearchParams().get('topBar');
|
|
21
|
+
const bottomBarParam = useSearchParams().get('bottomBar');
|
|
22
|
+
const sttParam = useSearchParams().get('stt');
|
|
23
|
+
|
|
24
|
+
const recordingBotUIConfig: RecordingBotUIConfig = {
|
|
25
|
+
chat: chatParam ? regexPattern.test(chatParam) : true,
|
|
26
|
+
topBar: topBarParam ? regexPattern.test(topBarParam) : false,
|
|
27
|
+
bottomBar: bottomBarParam ? regexPattern.test(bottomBarParam) : false,
|
|
28
|
+
stt: sttParam ? regexPattern.test(sttParam) : false,
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
return {
|
|
32
|
+
isRecordingBotRoute,
|
|
33
|
+
isRecordingBot,
|
|
34
|
+
recordingBotToken,
|
|
35
|
+
recordingBotName,
|
|
36
|
+
recordingBotUIConfig,
|
|
37
|
+
};
|
|
38
|
+
}
|