agora-appbuilder-core 4.0.7 → 4.0.8-beta-01
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/customization-api/sub-components.ts +2 -3
- package/template/customization-api/types.ts +1 -2
- 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 +6 -3
- package/template/src/components/DeviceConfigure.tsx +67 -17
- package/template/src/components/EventsConfigure.tsx +2 -2
- 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/livestream/LiveStreamContext.tsx +2 -2
- package/template/src/components/participants/UserActionMenuOptions.tsx +2 -2
- package/template/src/components/popups/StartScreenSharePopup.native.tsx +2 -2
- package/template/src/components/popups/StopScreenSharePopup.native.tsx +2 -2
- 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 +7 -1
- 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 +10 -5
- package/template/src/subComponents/LocalVideoMute.tsx +15 -1
- package/template/src/subComponents/ScreenShareNotice.tsx +2 -2
- 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/ScreenshareButton.tsx +3 -3
- package/template/src/subComponents/screenshare/ScreenshareConfigure.native.tsx +37 -6
- package/template/src/subComponents/screenshare/ScreenshareConfigure.tsx +22 -6
- package/template/src/subComponents/screenshare/useScreenshare.tsx +4 -4
- 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
|
@@ -78,7 +78,7 @@ export default function UserActionMenuOptionsOptions(
|
|
|
78
78
|
const [showVideoMuteModal, setShowVideoMuteModal] = useState(false);
|
|
79
79
|
const [isPosCalculated, setIsPosCalculated] = useState(false);
|
|
80
80
|
const {setFocus} = useFocus();
|
|
81
|
-
const {
|
|
81
|
+
const {stopUserScreenShare} = useScreenshare();
|
|
82
82
|
const remoteEndScreenshare = useRemoteEndScreenshare();
|
|
83
83
|
const [removeScreensharePopupVisible, setRemoveScreensharePopupVisible] =
|
|
84
84
|
useState(false);
|
|
@@ -379,7 +379,7 @@ export default function UserActionMenuOptionsOptions(
|
|
|
379
379
|
setActionMenuVisible(false);
|
|
380
380
|
//for local user directly stop the screenshare
|
|
381
381
|
if (localuid === user.parentUid) {
|
|
382
|
-
|
|
382
|
+
stopUserScreenShare();
|
|
383
383
|
}
|
|
384
384
|
//for remote user show popup and then user will use cta to stop screenshare
|
|
385
385
|
else {
|
|
@@ -24,7 +24,7 @@ const StartScreenSharePopup = () => {
|
|
|
24
24
|
const {showStartScreenSharePopup, setShowStartScreenSharePopup} =
|
|
25
25
|
useVideoCall();
|
|
26
26
|
const {video} = useLocalUserInfo();
|
|
27
|
-
const {
|
|
27
|
+
const {startUserScreenshare, isScreenshareActive} = useScreenshare();
|
|
28
28
|
const isDesktop = useIsDesktop()('popup');
|
|
29
29
|
const cancelLabel = useString(cancelText)();
|
|
30
30
|
const proceedLabel = useString(nativeScreensharePopupPrimaryBtnText)();
|
|
@@ -42,7 +42,7 @@ const StartScreenSharePopup = () => {
|
|
|
42
42
|
const doStartScreenShare = () => {
|
|
43
43
|
if (!isScreenshareActive) {
|
|
44
44
|
//@ts-ignore native only we will have argument
|
|
45
|
-
|
|
45
|
+
startUserScreenshare && startUserScreenshare(shareAudio);
|
|
46
46
|
setShowStartScreenSharePopup(false);
|
|
47
47
|
}
|
|
48
48
|
};
|
|
@@ -24,7 +24,7 @@ import {cancelText} from '../../language/default-labels/commonLabels';
|
|
|
24
24
|
const StopScreenSharePopup = () => {
|
|
25
25
|
const {showStopScreenSharePopup, setShowStopScreenSharePopup} =
|
|
26
26
|
useVideoCall();
|
|
27
|
-
const {
|
|
27
|
+
const {stopUserScreenShare, isScreenshareActive} = useScreenshare();
|
|
28
28
|
const isDesktop = useIsDesktop()('popup');
|
|
29
29
|
const localMute = useMuteToggleLocal();
|
|
30
30
|
const screenshareLabelHeading = useString(
|
|
@@ -43,7 +43,7 @@ const StopScreenSharePopup = () => {
|
|
|
43
43
|
if (isScreenshareActive) {
|
|
44
44
|
//true means keep the video enabled and stop only the screenshare
|
|
45
45
|
//@ts-ignore
|
|
46
|
-
|
|
46
|
+
stopUserScreenShare(true);
|
|
47
47
|
setShowStopScreenSharePopup(false);
|
|
48
48
|
}
|
|
49
49
|
};
|
|
@@ -26,6 +26,7 @@ import isMobileOrTablet from '../../utils/isMobileOrTablet';
|
|
|
26
26
|
import {isWebInternal} from '../../utils/common';
|
|
27
27
|
import useSetName from '../../utils/useSetName';
|
|
28
28
|
import {useUserPreference} from '../useUserPreference';
|
|
29
|
+
import {LogSource, logger} from '../../logger/AppBuilderLogger';
|
|
29
30
|
|
|
30
31
|
const audio = new Audio(
|
|
31
32
|
'https://dl.dropboxusercontent.com/s/1cdwpm3gca9mlo0/kick.mp3',
|
|
@@ -59,6 +60,11 @@ const JoinCallBtn = (props: PreCallJoinCallBtnProps) => {
|
|
|
59
60
|
);
|
|
60
61
|
|
|
61
62
|
const onSubmit = () => {
|
|
63
|
+
logger.log(
|
|
64
|
+
LogSource.Internals,
|
|
65
|
+
'PRECALL_SCREEN',
|
|
66
|
+
'User clicked on join call button. setting call active to true',
|
|
67
|
+
);
|
|
62
68
|
setUsername(username.trim());
|
|
63
69
|
setCallActive(true);
|
|
64
70
|
//updating name in the backend
|
|
@@ -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
|
|