agora-appbuilder-core 4.0.7 → 4.0.8
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 +1 -1
- package/template/_package-lock.json +82 -0
- package/template/android/app/build.gradle +8 -0
- package/template/android/build.gradle +3 -0
- package/template/bridge/rtc/webNg/RtcEngine.ts +581 -31
- package/template/bridge/rtc/webNg/RtcSurfaceView.tsx +2 -1
- package/template/bridge/rtm/web/index.ts +2 -1
- package/template/customization-api/customize.ts +29 -10
- package/template/index.js +17 -1
- package/template/index.web.js +2 -2
- package/template/package.json +3 -0
- package/template/src/SDKAppWrapper.tsx +44 -2
- package/template/src/app-state/useNoiseSupression.native.tsx +6 -0
- package/template/src/app-state/useNoiseSupression.tsx +17 -0
- package/template/src/auth/AuthProvider.tsx +145 -8
- package/template/src/auth/IDPAuth.electron.tsx +2 -1
- package/template/src/auth/IDPAuth.tsx +8 -2
- package/template/src/auth/openIDPURL.native.tsx +14 -3
- package/template/src/auth/useTokenAuth.tsx +7 -1
- package/template/src/components/Controls.tsx +2 -1
- package/template/src/components/DeviceConfigure.tsx +67 -17
- package/template/src/components/Precall.tsx +21 -0
- package/template/src/components/RTMConfigure.tsx +188 -24
- package/template/src/components/SettingsView.tsx +2 -0
- package/template/src/components/Share.tsx +11 -0
- package/template/src/components/StorageContext.tsx +32 -2
- package/template/src/components/chat-messages/useChatMessages.tsx +65 -5
- package/template/src/components/contexts/WaitingRoomContext.tsx +5 -1
- package/template/src/components/precall/joinCallBtn.tsx +6 -0
- package/template/src/components/precall/usePreCall.tsx +18 -2
- package/template/src/components/room-info/useRoomInfo.tsx +28 -25
- package/template/src/components/useUserPreference.tsx +13 -2
- package/template/src/components/useWakeLock.tsx +18 -4
- package/template/src/components/virtual-background/VBCard.tsx +40 -1
- package/template/src/components/virtual-background/VButils.native.ts +24 -5
- package/template/src/components/virtual-background/VButils.ts +29 -5
- package/template/src/components/virtual-background/VideoPreview.tsx +11 -1
- package/template/src/components/virtual-background/useVB.native.tsx +19 -3
- package/template/src/components/whiteboard/WhiteboardConfigure.tsx +32 -5
- package/template/src/components/whiteboard/WhiteboardToolBox.tsx +38 -8
- package/template/src/components/whiteboard/WhiteboardView.native.tsx +37 -13
- package/template/src/language/useLanguage.tsx +10 -4
- package/template/src/logger/AppBuilderLogger.tsx +215 -0
- package/template/src/logger/constants.ts +18 -0
- package/template/src/logger/transports/agora-transport.native.ts +58 -0
- package/template/src/logger/transports/agora-transport.ts +28 -0
- package/template/src/logger/transports/customer-transport.ts +115 -0
- package/template/src/pages/Create.tsx +27 -2
- package/template/src/pages/Endcall.tsx +6 -1
- package/template/src/pages/Join.tsx +31 -4
- package/template/src/pages/VideoCall.tsx +20 -56
- package/template/src/pages/video-call/DefaultLayouts.ts +11 -3
- package/template/src/pages/video-call/SidePanelHeader.tsx +12 -2
- package/template/src/pages/video-call/VideoCallScreen.tsx +8 -0
- package/template/src/pages/video-call/VideoRenderer.tsx +6 -0
- package/template/src/rtm/RTMEngine.ts +5 -0
- package/template/src/rtm-events-api/Events.ts +70 -16
- package/template/src/subComponents/LayoutIconDropdown.tsx +6 -0
- package/template/src/subComponents/LocalAudioMute.tsx +13 -3
- package/template/src/subComponents/LocalEndCall.tsx +8 -3
- package/template/src/subComponents/LocalVideoMute.tsx +15 -1
- package/template/src/subComponents/SelectDevice.tsx +111 -3
- package/template/src/subComponents/caption/CaptionContainer.tsx +17 -2
- package/template/src/subComponents/caption/useSTTAPI.tsx +62 -20
- package/template/src/subComponents/caption/useTranscriptDownload.native.ts +35 -5
- package/template/src/subComponents/caption/useTranscriptDownload.ts +12 -2
- package/template/src/subComponents/chat/ChatParticipants.tsx +6 -0
- package/template/src/subComponents/recording/useRecording.tsx +102 -15
- package/template/src/subComponents/screenshare/ScreenshareConfigure.native.tsx +33 -2
- package/template/src/subComponents/screenshare/ScreenshareConfigure.tsx +18 -2
- package/template/src/subComponents/waiting-rooms/useWaitingRoomAPI.ts +26 -0
- package/template/src/utils/axiomLogger.ts +2 -1
- package/template/src/utils/useCreateRoom.ts +30 -0
- package/template/src/utils/useFindActiveSpeaker.ts +43 -0
- package/template/src/utils/useFocus.tsx +8 -3
- package/template/src/utils/useIsLocalUserSpeaking.ts +19 -3
- package/template/src/utils/useJoinRoom.ts +27 -0
- package/template/src/utils/useLayout.tsx +9 -3
- package/template/src/utils/useSidePanel.tsx +14 -3
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
information visit https://appbuilder.agora.io.
|
|
10
10
|
*********************************************
|
|
11
11
|
*/
|
|
12
|
-
import React, {createContext, useContext, useEffect} from 'react';
|
|
12
|
+
import React, {createContext, useContext, useEffect, useState} from 'react';
|
|
13
13
|
import {createHook} from 'customization-implementation';
|
|
14
14
|
import {ApolloError} from '@apollo/client';
|
|
15
15
|
import {SdkApiContext} from '../SdkApiContext';
|
|
@@ -55,6 +55,22 @@ const PreCallProvider = (props: PreCallProviderProps) => {
|
|
|
55
55
|
const roomInfo = useRoomInfo();
|
|
56
56
|
const {deviceList} = useContext(DeviceContext);
|
|
57
57
|
const setUsername = useSetName();
|
|
58
|
+
const [isCameraAvailable, setCameraAvailable] = useState(false);
|
|
59
|
+
const [isMicAvailable, setMicAvailable] = useState(false);
|
|
60
|
+
const [isSpeakerAvailable, setSpeakerAvailable] = useState(false);
|
|
61
|
+
const [isPermissionRequested, setIsPermissionRequested] = useState(false);
|
|
62
|
+
|
|
63
|
+
const value = {
|
|
64
|
+
...props.value,
|
|
65
|
+
setCameraAvailable,
|
|
66
|
+
isCameraAvailable,
|
|
67
|
+
isMicAvailable,
|
|
68
|
+
setMicAvailable,
|
|
69
|
+
isSpeakerAvailable,
|
|
70
|
+
setSpeakerAvailable,
|
|
71
|
+
isPermissionRequested,
|
|
72
|
+
setIsPermissionRequested,
|
|
73
|
+
};
|
|
58
74
|
|
|
59
75
|
useEffect(() => {
|
|
60
76
|
if (join.initialized && join.phrase) {
|
|
@@ -79,7 +95,7 @@ const PreCallProvider = (props: PreCallProviderProps) => {
|
|
|
79
95
|
}, []);
|
|
80
96
|
|
|
81
97
|
return (
|
|
82
|
-
<PreCallContext.Provider value={
|
|
98
|
+
<PreCallContext.Provider value={value}>
|
|
83
99
|
{props.children}
|
|
84
100
|
</PreCallContext.Provider>
|
|
85
101
|
);
|
|
@@ -21,33 +21,36 @@ export enum WaitingRoomStatus {
|
|
|
21
21
|
APPROVED = 3,
|
|
22
22
|
REJECTED = 4,
|
|
23
23
|
}
|
|
24
|
+
|
|
25
|
+
export interface RoomData {
|
|
26
|
+
isHost: boolean;
|
|
27
|
+
meetingTitle: string;
|
|
28
|
+
roomId: {
|
|
29
|
+
attendee: string;
|
|
30
|
+
host?: string;
|
|
31
|
+
};
|
|
32
|
+
pstn?: {
|
|
33
|
+
number: string;
|
|
34
|
+
pin: string;
|
|
35
|
+
};
|
|
36
|
+
whiteboard?: {
|
|
37
|
+
room_uuid: string;
|
|
38
|
+
room_token: string;
|
|
39
|
+
};
|
|
40
|
+
isSeparateHostLink: boolean;
|
|
41
|
+
channel?: string;
|
|
42
|
+
uid?: UidType;
|
|
43
|
+
token?: string;
|
|
44
|
+
rtmToken?: string;
|
|
45
|
+
encryptionSecret?: string;
|
|
46
|
+
encryptionSecretSalt?: Uint8Array;
|
|
47
|
+
screenShareUid?: string;
|
|
48
|
+
screenShareToken?: string;
|
|
49
|
+
}
|
|
50
|
+
|
|
24
51
|
export interface RoomInfoContextInterface {
|
|
25
52
|
isJoinDataFetched?: boolean;
|
|
26
|
-
data?:
|
|
27
|
-
isHost: boolean;
|
|
28
|
-
meetingTitle: string;
|
|
29
|
-
roomId: {
|
|
30
|
-
attendee: string;
|
|
31
|
-
host?: string;
|
|
32
|
-
};
|
|
33
|
-
pstn?: {
|
|
34
|
-
number: string;
|
|
35
|
-
pin: string;
|
|
36
|
-
};
|
|
37
|
-
whiteboard?: {
|
|
38
|
-
room_uuid: string;
|
|
39
|
-
room_token: string;
|
|
40
|
-
};
|
|
41
|
-
isSeparateHostLink: boolean;
|
|
42
|
-
channel?: string;
|
|
43
|
-
uid?: UidType;
|
|
44
|
-
token?: string;
|
|
45
|
-
rtmToken?: string;
|
|
46
|
-
encryptionSecret?: string;
|
|
47
|
-
encryptionSecretSalt?: Uint8Array;
|
|
48
|
-
screenShareUid?: string;
|
|
49
|
-
screenShareToken?: string;
|
|
50
|
-
};
|
|
53
|
+
data?: RoomData;
|
|
51
54
|
isInWaitingRoom?: boolean;
|
|
52
55
|
waitingRoomStatus?: WaitingRoomStatus;
|
|
53
56
|
isWhiteBoardOn?: boolean;
|
|
@@ -31,6 +31,7 @@ import {
|
|
|
31
31
|
} from '../language/default-labels/videoCallScreenLabels';
|
|
32
32
|
import {useLanguage} from '../language/useLanguage';
|
|
33
33
|
import {useScreenContext} from '../components/contexts/ScreenShareContext';
|
|
34
|
+
import {LogSource, logger} from '../logger/AppBuilderLogger';
|
|
34
35
|
|
|
35
36
|
interface UserPreferenceContextInterface {
|
|
36
37
|
displayName: string;
|
|
@@ -104,10 +105,20 @@ const UserPreferenceProvider = (props: {children: React.ReactNode}) => {
|
|
|
104
105
|
name,
|
|
105
106
|
},
|
|
106
107
|
}).catch(error => {
|
|
107
|
-
|
|
108
|
+
logger.error(
|
|
109
|
+
LogSource.Internals,
|
|
110
|
+
'NAME',
|
|
111
|
+
'ERROR, could not save the name',
|
|
112
|
+
error,
|
|
113
|
+
);
|
|
108
114
|
});
|
|
109
115
|
} catch (error) {
|
|
110
|
-
|
|
116
|
+
logger.error(
|
|
117
|
+
LogSource.Internals,
|
|
118
|
+
'NAME',
|
|
119
|
+
'ERROR, could not save the name',
|
|
120
|
+
error,
|
|
121
|
+
);
|
|
111
122
|
}
|
|
112
123
|
}
|
|
113
124
|
};
|
|
@@ -2,6 +2,7 @@ import NoSleep from 'nosleep.js';
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import isMobileOrTablet from '../utils/isMobileOrTablet';
|
|
4
4
|
import {isWebInternal} from '../utils/common';
|
|
5
|
+
import {LogSource, logger} from '../logger/AppBuilderLogger';
|
|
5
6
|
|
|
6
7
|
const useWakeLock = () => {
|
|
7
8
|
if (isMobileOrTablet() && isWebInternal()) {
|
|
@@ -12,18 +13,31 @@ const useWakeLock = () => {
|
|
|
12
13
|
noSleep
|
|
13
14
|
.enable()
|
|
14
15
|
.then(() => {
|
|
15
|
-
|
|
16
|
+
logger.debug(
|
|
17
|
+
LogSource.Internals,
|
|
18
|
+
'VIDEO_CALL_ROOM',
|
|
19
|
+
'enabled sleep successfully',
|
|
20
|
+
);
|
|
16
21
|
set(noSleep.isEnabled);
|
|
17
22
|
})
|
|
18
|
-
.catch(
|
|
19
|
-
|
|
23
|
+
.catch(e => {
|
|
24
|
+
logger.error(
|
|
25
|
+
LogSource.Internals,
|
|
26
|
+
'VIDEO_CALL_ROOM',
|
|
27
|
+
'error enabling sleep',
|
|
28
|
+
e,
|
|
29
|
+
);
|
|
20
30
|
});
|
|
21
31
|
}, []);
|
|
22
32
|
|
|
23
33
|
const release = React.useCallback(() => {
|
|
24
34
|
noSleep.disable();
|
|
25
35
|
set(noSleep.isEnabled);
|
|
26
|
-
|
|
36
|
+
logger.debug(
|
|
37
|
+
LogSource.Internals,
|
|
38
|
+
'VIDEO_CALL_ROOM',
|
|
39
|
+
'disabled sleep successfully',
|
|
40
|
+
);
|
|
27
41
|
}, []);
|
|
28
42
|
|
|
29
43
|
return {
|
|
@@ -17,6 +17,7 @@ import {
|
|
|
17
17
|
vbPanelImageUploadErrorToastHeading,
|
|
18
18
|
vbPanelImageUploadErrorToastSubHeading,
|
|
19
19
|
} from '../../../src/language/default-labels/videoCallScreenLabels';
|
|
20
|
+
import {LogSource, logger} from '../../logger/AppBuilderLogger';
|
|
20
21
|
|
|
21
22
|
interface VBCardProps {
|
|
22
23
|
type: VBMode;
|
|
@@ -79,21 +80,49 @@ const VBCard: React.FC<VBCardProps> = ({
|
|
|
79
80
|
const fileInputRef = useRef<HTMLInputElement | null>(null);
|
|
80
81
|
|
|
81
82
|
const handleFileUpload = (e: React.ChangeEvent<HTMLInputElement>) => {
|
|
83
|
+
logger.log(
|
|
84
|
+
LogSource.Internals,
|
|
85
|
+
'VIRTUAL_BACKGROUND',
|
|
86
|
+
'User wants to upload custom background',
|
|
87
|
+
);
|
|
82
88
|
const selectedFile = e.target.files && e.target.files[0];
|
|
83
|
-
|
|
89
|
+
logger.log(
|
|
90
|
+
LogSource.Internals,
|
|
91
|
+
'VIRTUAL_BACKGROUND',
|
|
92
|
+
`User selected a file ${e?.target?.files[0]?.name || 'none'}`,
|
|
93
|
+
);
|
|
84
94
|
if (selectedFile) {
|
|
85
95
|
// check if file size (less than 1MB)
|
|
96
|
+
logger.log(
|
|
97
|
+
LogSource.Internals,
|
|
98
|
+
'VIRTUAL_BACKGROUND',
|
|
99
|
+
'check if file is less than 1MB amd type is image/jpeg or image/png',
|
|
100
|
+
{
|
|
101
|
+
size: selectedFile.size,
|
|
102
|
+
type: selectedFile.type,
|
|
103
|
+
},
|
|
104
|
+
);
|
|
86
105
|
if (selectedFile.size <= 1024 * 1024 * 1) {
|
|
87
106
|
// check image format
|
|
88
107
|
if (
|
|
89
108
|
selectedFile.type === 'image/jpeg' ||
|
|
90
109
|
selectedFile.type === 'image/png'
|
|
91
110
|
) {
|
|
111
|
+
logger.log(
|
|
112
|
+
LogSource.Internals,
|
|
113
|
+
'VIRTUAL_BACKGROUND',
|
|
114
|
+
'file uploaded satisfies the above constraint. Convert the file to base64',
|
|
115
|
+
);
|
|
92
116
|
convertBlobToBase64(URL.createObjectURL(selectedFile))
|
|
93
117
|
.then((base64Data: string) => {
|
|
94
118
|
if (
|
|
95
119
|
options.filter(option => option.path === base64Data).length > 0
|
|
96
120
|
) {
|
|
121
|
+
logger.log(
|
|
122
|
+
LogSource.Internals,
|
|
123
|
+
'VIRTUAL_BACKGROUND',
|
|
124
|
+
'file is already uploaded',
|
|
125
|
+
);
|
|
97
126
|
Toast.show({
|
|
98
127
|
leadingIconName: 'alert',
|
|
99
128
|
type: 'error',
|
|
@@ -116,6 +145,11 @@ const VBCard: React.FC<VBCardProps> = ({
|
|
|
116
145
|
updatedOptions.splice(3, 0, newCard);
|
|
117
146
|
return updatedOptions;
|
|
118
147
|
});
|
|
148
|
+
logger.log(
|
|
149
|
+
LogSource.Internals,
|
|
150
|
+
'VIRTUAL_BACKGROUND',
|
|
151
|
+
'file uploaded successfully and storing to indexDB',
|
|
152
|
+
);
|
|
119
153
|
saveImagesToIndexDB(base64Data);
|
|
120
154
|
})
|
|
121
155
|
.catch(error => {
|
|
@@ -143,6 +177,11 @@ const VBCard: React.FC<VBCardProps> = ({
|
|
|
143
177
|
};
|
|
144
178
|
|
|
145
179
|
const handleClick = () => {
|
|
180
|
+
logger.log(
|
|
181
|
+
LogSource.Internals,
|
|
182
|
+
'VIRTUAL_BACKGROUND',
|
|
183
|
+
`User selected a virtual background type - ${type}`,
|
|
184
|
+
);
|
|
146
185
|
setSaveVB(false);
|
|
147
186
|
setVBmode(type);
|
|
148
187
|
if (path) {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import AsyncStorage from '@react-native-async-storage/async-storage';
|
|
2
|
+
import {LogSource, logger} from '../../logger/AppBuilderLogger';
|
|
2
3
|
|
|
3
4
|
export const saveImagesToAsyncStorage = async (
|
|
4
5
|
base64Data: string,
|
|
@@ -8,10 +9,18 @@ export const saveImagesToAsyncStorage = async (
|
|
|
8
9
|
const key = `image_${timestampId}`;
|
|
9
10
|
|
|
10
11
|
await AsyncStorage.setItem(key, base64Data);
|
|
11
|
-
|
|
12
|
-
|
|
12
|
+
logger.debug(
|
|
13
|
+
LogSource.Internals,
|
|
14
|
+
'VIRTUAL_BACKGROUND',
|
|
15
|
+
`Image saved to AsyncStorage with key - ${key}`,
|
|
16
|
+
);
|
|
13
17
|
} catch (error) {
|
|
14
|
-
|
|
18
|
+
logger.error(
|
|
19
|
+
LogSource.Internals,
|
|
20
|
+
'VIRTUAL_BACKGROUND',
|
|
21
|
+
'Error saving image to AsyncStorage',
|
|
22
|
+
error,
|
|
23
|
+
);
|
|
15
24
|
}
|
|
16
25
|
};
|
|
17
26
|
|
|
@@ -28,10 +37,20 @@ export const retrieveImagesFromAsyncStorage = async (): Promise<string[]> => {
|
|
|
28
37
|
}),
|
|
29
38
|
);
|
|
30
39
|
|
|
31
|
-
|
|
40
|
+
logger.debug(
|
|
41
|
+
LogSource.Internals,
|
|
42
|
+
'VIRTUAL_BACKGROUND',
|
|
43
|
+
'Retrieved images from AsyncStorage:',
|
|
44
|
+
retrievedImages,
|
|
45
|
+
);
|
|
32
46
|
return retrievedImages;
|
|
33
47
|
} catch (error) {
|
|
34
|
-
|
|
48
|
+
logger.error(
|
|
49
|
+
LogSource.Internals,
|
|
50
|
+
'VIRTUAL_BACKGROUND',
|
|
51
|
+
'IError retrieving image from AsyncStorage',
|
|
52
|
+
error,
|
|
53
|
+
);
|
|
35
54
|
throw error;
|
|
36
55
|
}
|
|
37
56
|
};
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import {LogSource, logger} from '../../logger/AppBuilderLogger';
|
|
2
|
+
|
|
1
3
|
interface ImageItem {
|
|
2
4
|
id: number;
|
|
3
5
|
data: string;
|
|
@@ -48,12 +50,25 @@ export const saveImagesToIndexDB = async (
|
|
|
48
50
|
store.add(item);
|
|
49
51
|
|
|
50
52
|
tx.oncomplete = () => {
|
|
51
|
-
|
|
53
|
+
logger.debug(
|
|
54
|
+
LogSource.Internals,
|
|
55
|
+
'VIRTUAL_BACKGROUND',
|
|
56
|
+
'Transaction completed',
|
|
57
|
+
);
|
|
52
58
|
};
|
|
53
59
|
|
|
54
|
-
|
|
60
|
+
logger.debug(
|
|
61
|
+
LogSource.Internals,
|
|
62
|
+
'VIRTUAL_BACKGROUND',
|
|
63
|
+
'Added images to the store!',
|
|
64
|
+
);
|
|
55
65
|
} catch (error) {
|
|
56
|
-
|
|
66
|
+
logger.error(
|
|
67
|
+
LogSource.Internals,
|
|
68
|
+
'VIRTUAL_BACKGROUND',
|
|
69
|
+
'Error saving images to IndexedDB',
|
|
70
|
+
error,
|
|
71
|
+
);
|
|
57
72
|
}
|
|
58
73
|
};
|
|
59
74
|
|
|
@@ -74,12 +89,21 @@ export const retrieveImagesFromIndexDB = async (): Promise<string[]> => {
|
|
|
74
89
|
retrievedImages.push(cursor.value.data);
|
|
75
90
|
cursor.continue();
|
|
76
91
|
} else {
|
|
77
|
-
|
|
92
|
+
logger.debug(
|
|
93
|
+
LogSource.Internals,
|
|
94
|
+
'VIRTUAL_BACKGROUND',
|
|
95
|
+
'Successfully retrieved images from IndexedDB!',
|
|
96
|
+
);
|
|
78
97
|
resolve(retrievedImages);
|
|
79
98
|
}
|
|
80
99
|
};
|
|
81
100
|
} catch (error) {
|
|
82
|
-
|
|
101
|
+
logger.error(
|
|
102
|
+
LogSource.Internals,
|
|
103
|
+
'VIRTUAL_BACKGROUND',
|
|
104
|
+
'Error retrieving images from IndexedDB',
|
|
105
|
+
error,
|
|
106
|
+
);
|
|
83
107
|
reject(error);
|
|
84
108
|
}
|
|
85
109
|
});
|
|
@@ -10,6 +10,7 @@ import {isMobileUA} from '../../utils/common';
|
|
|
10
10
|
import InlineNotification from '../../atoms/InlineNotification';
|
|
11
11
|
import {useString} from '../../utils/useString';
|
|
12
12
|
import {vbPanelInfo} from '../../language/default-labels/precallScreenLabels';
|
|
13
|
+
import {LogSource, logger} from '../../logger/AppBuilderLogger';
|
|
13
14
|
interface VideoPreviewProps {
|
|
14
15
|
isLocalVideoON?: boolean;
|
|
15
16
|
}
|
|
@@ -43,12 +44,21 @@ const VideoPreview = ({isLocalVideoON}: VideoPreviewProps) => {
|
|
|
43
44
|
let localVideo = null;
|
|
44
45
|
const initialize = async () => {
|
|
45
46
|
localVideo = await createCameraTrack();
|
|
47
|
+
logger.log(
|
|
48
|
+
LogSource.Internals,
|
|
49
|
+
isLocalVideoON ? 'VIRTUAL_BACKGROUND' : 'PRECALL_SCREEN',
|
|
50
|
+
'creating canera track for local preview',
|
|
51
|
+
);
|
|
46
52
|
};
|
|
47
53
|
|
|
48
54
|
initialize();
|
|
49
55
|
return () => {
|
|
50
|
-
console.log('cleanup local preview');
|
|
51
56
|
if (localVideo) {
|
|
57
|
+
logger.debug(
|
|
58
|
+
LogSource.Internals,
|
|
59
|
+
isLocalVideoON ? 'VIRTUAL_BACKGROUND' : 'PRECALL_SCREEN',
|
|
60
|
+
'cleaning up local video preview',
|
|
61
|
+
);
|
|
52
62
|
localVideo.stop();
|
|
53
63
|
localVideo.close();
|
|
54
64
|
setPreviewVideoTrack(null);
|
|
@@ -14,6 +14,7 @@ import RNFS from 'react-native-fs';
|
|
|
14
14
|
import {ImageSourcePropType} from 'react-native/types';
|
|
15
15
|
import imagePathsArray from './imagePaths';
|
|
16
16
|
import getUniqueID from '../../../src/utils/getUniqueID';
|
|
17
|
+
import {LogSource, logger} from '../../logger/AppBuilderLogger';
|
|
17
18
|
|
|
18
19
|
export type VBMode = 'blur' | 'image' | 'custom' | 'none';
|
|
19
20
|
|
|
@@ -65,7 +66,12 @@ const downloadBase64Image = async (base64Data, filename) => {
|
|
|
65
66
|
await RNFS.writeFile(filePath, extractData, 'base64');
|
|
66
67
|
return filePath;
|
|
67
68
|
} catch (error) {
|
|
68
|
-
|
|
69
|
+
logger.error(
|
|
70
|
+
LogSource.Internals,
|
|
71
|
+
'VIRTUAL_BACKGROUND',
|
|
72
|
+
'Error saving base64 image',
|
|
73
|
+
error,
|
|
74
|
+
);
|
|
69
75
|
return null;
|
|
70
76
|
}
|
|
71
77
|
};
|
|
@@ -88,7 +94,12 @@ const VBProvider: React.FC = ({children}) => {
|
|
|
88
94
|
const fetchData = async () => {
|
|
89
95
|
try {
|
|
90
96
|
const customImages = await retrieveImagesFromAsyncStorage();
|
|
91
|
-
|
|
97
|
+
logger.debug(
|
|
98
|
+
LogSource.Internals,
|
|
99
|
+
'VIRTUAL_BACKGROUND',
|
|
100
|
+
'retrived from async storage',
|
|
101
|
+
customImages,
|
|
102
|
+
);
|
|
92
103
|
setOptions((prevOptions: Option[]) => [
|
|
93
104
|
...prevOptions,
|
|
94
105
|
...(customImages?.map(
|
|
@@ -102,7 +113,12 @@ const VBProvider: React.FC = ({children}) => {
|
|
|
102
113
|
) || []),
|
|
103
114
|
]);
|
|
104
115
|
} catch (error) {
|
|
105
|
-
|
|
116
|
+
logger.error(
|
|
117
|
+
LogSource.Internals,
|
|
118
|
+
'VIRTUAL_BACKGROUND',
|
|
119
|
+
'Error fetching data',
|
|
120
|
+
error,
|
|
121
|
+
);
|
|
106
122
|
}
|
|
107
123
|
};
|
|
108
124
|
|
|
@@ -17,6 +17,7 @@ import useUserName from '../../utils/useUserName';
|
|
|
17
17
|
import {DefaultLayouts} from '../../pages/video-call/DefaultLayouts';
|
|
18
18
|
import events, {PersistanceLevel} from '../../rtm-events-api';
|
|
19
19
|
import {EventNames} from '../../rtm-events';
|
|
20
|
+
import {LogSource, logger} from '../../logger/AppBuilderLogger';
|
|
20
21
|
|
|
21
22
|
export const whiteboardPaper = isWebInternal()
|
|
22
23
|
? document.createElement('div')
|
|
@@ -162,7 +163,12 @@ const WhiteboardConfigure: React.FC<WhiteboardPropsInterface> = props => {
|
|
|
162
163
|
}
|
|
163
164
|
}
|
|
164
165
|
} catch (error) {
|
|
165
|
-
|
|
166
|
+
logger.error(
|
|
167
|
+
LogSource.Internals,
|
|
168
|
+
'WHITEBOARD',
|
|
169
|
+
'error on whiteboard setWritable',
|
|
170
|
+
error,
|
|
171
|
+
);
|
|
166
172
|
}
|
|
167
173
|
}, [currentLayout, isHost, whiteboardRoomState, activeUids, pinnedUid]);
|
|
168
174
|
|
|
@@ -325,6 +331,9 @@ const WhiteboardConfigure: React.FC<WhiteboardPropsInterface> = props => {
|
|
|
325
331
|
try {
|
|
326
332
|
const index = randomIntFromInterval(0, 9);
|
|
327
333
|
setWhiteboardRoomState(RoomPhase.Connecting);
|
|
334
|
+
logger.log(LogSource.Internals, 'WHITEBOARD', 'Trying to join room', {
|
|
335
|
+
data: {},
|
|
336
|
+
});
|
|
328
337
|
whiteWebSdkClient.current
|
|
329
338
|
.joinRoom({
|
|
330
339
|
cursorAdapter: cursorAdapter,
|
|
@@ -340,6 +349,14 @@ const WhiteboardConfigure: React.FC<WhiteboardPropsInterface> = props => {
|
|
|
340
349
|
},
|
|
341
350
|
})
|
|
342
351
|
.then(room => {
|
|
352
|
+
logger.log(
|
|
353
|
+
LogSource.Internals,
|
|
354
|
+
'WHITEBOARD',
|
|
355
|
+
'Join room successful',
|
|
356
|
+
{
|
|
357
|
+
data: {},
|
|
358
|
+
},
|
|
359
|
+
);
|
|
343
360
|
whiteboardRoom.current = room;
|
|
344
361
|
cursorAdapter.setRoom(room);
|
|
345
362
|
whiteboardRoom.current?.setViewMode(ViewMode.Freedom);
|
|
@@ -353,11 +370,16 @@ const WhiteboardConfigure: React.FC<WhiteboardPropsInterface> = props => {
|
|
|
353
370
|
})
|
|
354
371
|
.catch(err => {
|
|
355
372
|
setWhiteboardRoomState(InitState);
|
|
356
|
-
|
|
373
|
+
logger.error(
|
|
374
|
+
LogSource.Internals,
|
|
375
|
+
'WHITEBOARD',
|
|
376
|
+
'Join room error',
|
|
377
|
+
err,
|
|
378
|
+
);
|
|
357
379
|
});
|
|
358
380
|
} catch (err) {
|
|
359
381
|
setWhiteboardRoomState(InitState);
|
|
360
|
-
|
|
382
|
+
logger.error(LogSource.Internals, 'WHITEBOARD', 'Join room error', err);
|
|
361
383
|
}
|
|
362
384
|
};
|
|
363
385
|
|
|
@@ -374,11 +396,16 @@ const WhiteboardConfigure: React.FC<WhiteboardPropsInterface> = props => {
|
|
|
374
396
|
})
|
|
375
397
|
.catch(err => {
|
|
376
398
|
setWhiteboardRoomState(InitState);
|
|
377
|
-
|
|
399
|
+
logger.error(
|
|
400
|
+
LogSource.Internals,
|
|
401
|
+
'WHITEBOARD',
|
|
402
|
+
'leave room error',
|
|
403
|
+
err,
|
|
404
|
+
);
|
|
378
405
|
});
|
|
379
406
|
} catch (err) {
|
|
380
407
|
setWhiteboardRoomState(InitState);
|
|
381
|
-
|
|
408
|
+
logger.error(LogSource.Internals, 'WHITEBOARD', 'leave room error', err);
|
|
382
409
|
}
|
|
383
410
|
};
|
|
384
411
|
|
|
@@ -41,6 +41,7 @@ import {
|
|
|
41
41
|
whiteboardToolboxUploadText,
|
|
42
42
|
whiteboardToolboxWidthLabel,
|
|
43
43
|
} from '../../language/default-labels/videoCallScreenLabels';
|
|
44
|
+
import {LogSource, logger} from '../../logger/AppBuilderLogger';
|
|
44
45
|
|
|
45
46
|
const supportedDocTypes = [
|
|
46
47
|
'application/msword',
|
|
@@ -336,13 +337,23 @@ const WhiteboardToolBox = ({whiteboardRoom}) => {
|
|
|
336
337
|
body: body,
|
|
337
338
|
})
|
|
338
339
|
.then(res2 => {
|
|
339
|
-
|
|
340
|
+
logger.debug(
|
|
341
|
+
LogSource.NetworkRest,
|
|
342
|
+
'whiteboard_fileconvert',
|
|
343
|
+
'file convert success',
|
|
344
|
+
res2,
|
|
345
|
+
);
|
|
340
346
|
//updating upload flag as true
|
|
341
347
|
//once we got RTM message we will proceed to insert image into whiteboard
|
|
342
348
|
setUploadRef();
|
|
343
349
|
})
|
|
344
350
|
.catch(err2 => {
|
|
345
|
-
|
|
351
|
+
logger.error(
|
|
352
|
+
LogSource.NetworkRest,
|
|
353
|
+
'whiteboard_fileconvert',
|
|
354
|
+
'file convert failed',
|
|
355
|
+
err2,
|
|
356
|
+
);
|
|
346
357
|
Toast.show({
|
|
347
358
|
type: 'error',
|
|
348
359
|
text1: whiteboardFileUploadErrorToastHeadingTT('File'),
|
|
@@ -358,7 +369,7 @@ const WhiteboardToolBox = ({whiteboardRoom}) => {
|
|
|
358
369
|
});
|
|
359
370
|
});
|
|
360
371
|
} else {
|
|
361
|
-
|
|
372
|
+
logger.debug(LogSource.Internals, 'WHITEBOARD', 'upload url is empty');
|
|
362
373
|
Toast.show({
|
|
363
374
|
type: 'error',
|
|
364
375
|
text1: whiteboardFileUploadErrorToastHeadingTT('File'),
|
|
@@ -401,10 +412,20 @@ const WhiteboardToolBox = ({whiteboardRoom}) => {
|
|
|
401
412
|
const imageUrl = jsonData?.url?.replaceAll('\u0026', '&');
|
|
402
413
|
insertImageIntoWhiteboard(imageUrl);
|
|
403
414
|
}
|
|
404
|
-
|
|
415
|
+
logger.debug(
|
|
416
|
+
LogSource.NetworkRest,
|
|
417
|
+
'whiteboard_image',
|
|
418
|
+
'image upload success',
|
|
419
|
+
res2,
|
|
420
|
+
);
|
|
405
421
|
})
|
|
406
422
|
.catch(err2 => {
|
|
407
|
-
|
|
423
|
+
logger.error(
|
|
424
|
+
LogSource.NetworkRest,
|
|
425
|
+
'whiteboard_image',
|
|
426
|
+
'Failed to get image URL',
|
|
427
|
+
err2,
|
|
428
|
+
);
|
|
408
429
|
Toast.show({
|
|
409
430
|
type: 'error',
|
|
410
431
|
text1: whiteboardFileUploadErrorToastHeadingTT('Image'),
|
|
@@ -420,7 +441,11 @@ const WhiteboardToolBox = ({whiteboardRoom}) => {
|
|
|
420
441
|
});
|
|
421
442
|
});
|
|
422
443
|
} else {
|
|
423
|
-
|
|
444
|
+
logger.debug(
|
|
445
|
+
LogSource.Internals,
|
|
446
|
+
'WHITEBOARD',
|
|
447
|
+
'image upload url is empty',
|
|
448
|
+
);
|
|
424
449
|
Toast.show({
|
|
425
450
|
type: 'error',
|
|
426
451
|
text1: whiteboardFileUploadErrorToastHeadingTT('Image'),
|
|
@@ -469,7 +494,12 @@ const WhiteboardToolBox = ({whiteboardRoom}) => {
|
|
|
469
494
|
}
|
|
470
495
|
})
|
|
471
496
|
.catch(err => {
|
|
472
|
-
|
|
497
|
+
logger.error(
|
|
498
|
+
LogSource.NetworkRest,
|
|
499
|
+
'whiteboard_upload',
|
|
500
|
+
'upload api failed',
|
|
501
|
+
err,
|
|
502
|
+
);
|
|
473
503
|
Toast.show({
|
|
474
504
|
type: 'error',
|
|
475
505
|
text1: whiteboardFileUploadErrorToastHeadingTT('File'),
|
|
@@ -477,7 +507,7 @@ const WhiteboardToolBox = ({whiteboardRoom}) => {
|
|
|
477
507
|
});
|
|
478
508
|
});
|
|
479
509
|
} else {
|
|
480
|
-
|
|
510
|
+
logger.error(LogSource.Internals, 'WHITEBOARD', 'unsupported file');
|
|
481
511
|
Toast.show({
|
|
482
512
|
type: 'error',
|
|
483
513
|
text1: whiteboardFileUploadTypeErrorToastHeadingTT,
|