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.
Files changed (89) hide show
  1. package/package.json +1 -1
  2. package/template/_package-lock.json +82 -0
  3. package/template/android/app/build.gradle +8 -0
  4. package/template/android/build.gradle +3 -0
  5. package/template/bridge/rtc/webNg/RtcEngine.ts +581 -31
  6. package/template/bridge/rtc/webNg/RtcSurfaceView.tsx +2 -1
  7. package/template/bridge/rtm/web/index.ts +2 -1
  8. package/template/customization-api/customize.ts +29 -10
  9. package/template/customization-api/sub-components.ts +2 -3
  10. package/template/customization-api/types.ts +1 -2
  11. package/template/index.js +17 -1
  12. package/template/index.web.js +2 -2
  13. package/template/package.json +3 -0
  14. package/template/src/SDKAppWrapper.tsx +44 -2
  15. package/template/src/app-state/useNoiseSupression.native.tsx +6 -0
  16. package/template/src/app-state/useNoiseSupression.tsx +17 -0
  17. package/template/src/auth/AuthProvider.tsx +145 -8
  18. package/template/src/auth/IDPAuth.electron.tsx +2 -1
  19. package/template/src/auth/IDPAuth.tsx +8 -2
  20. package/template/src/auth/openIDPURL.native.tsx +14 -3
  21. package/template/src/auth/useTokenAuth.tsx +7 -1
  22. package/template/src/components/Controls.tsx +6 -3
  23. package/template/src/components/DeviceConfigure.tsx +67 -17
  24. package/template/src/components/EventsConfigure.tsx +2 -2
  25. package/template/src/components/Precall.tsx +21 -0
  26. package/template/src/components/RTMConfigure.tsx +188 -24
  27. package/template/src/components/SettingsView.tsx +2 -0
  28. package/template/src/components/Share.tsx +11 -0
  29. package/template/src/components/StorageContext.tsx +32 -2
  30. package/template/src/components/chat-messages/useChatMessages.tsx +65 -5
  31. package/template/src/components/contexts/WaitingRoomContext.tsx +5 -1
  32. package/template/src/components/livestream/LiveStreamContext.tsx +2 -2
  33. package/template/src/components/participants/UserActionMenuOptions.tsx +2 -2
  34. package/template/src/components/popups/StartScreenSharePopup.native.tsx +2 -2
  35. package/template/src/components/popups/StopScreenSharePopup.native.tsx +2 -2
  36. package/template/src/components/precall/joinCallBtn.tsx +6 -0
  37. package/template/src/components/precall/usePreCall.tsx +18 -2
  38. package/template/src/components/room-info/useRoomInfo.tsx +28 -25
  39. package/template/src/components/useUserPreference.tsx +13 -2
  40. package/template/src/components/useWakeLock.tsx +18 -4
  41. package/template/src/components/virtual-background/VBCard.tsx +40 -1
  42. package/template/src/components/virtual-background/VButils.native.ts +24 -5
  43. package/template/src/components/virtual-background/VButils.ts +29 -5
  44. package/template/src/components/virtual-background/VideoPreview.tsx +11 -1
  45. package/template/src/components/virtual-background/useVB.native.tsx +19 -3
  46. package/template/src/components/whiteboard/WhiteboardConfigure.tsx +32 -5
  47. package/template/src/components/whiteboard/WhiteboardToolBox.tsx +38 -8
  48. package/template/src/components/whiteboard/WhiteboardView.native.tsx +37 -13
  49. package/template/src/language/useLanguage.tsx +10 -4
  50. package/template/src/logger/AppBuilderLogger.tsx +215 -0
  51. package/template/src/logger/constants.ts +18 -0
  52. package/template/src/logger/transports/agora-transport.native.ts +58 -0
  53. package/template/src/logger/transports/agora-transport.ts +28 -0
  54. package/template/src/logger/transports/customer-transport.ts +115 -0
  55. package/template/src/pages/Create.tsx +27 -2
  56. package/template/src/pages/Endcall.tsx +6 -1
  57. package/template/src/pages/Join.tsx +31 -4
  58. package/template/src/pages/VideoCall.tsx +20 -56
  59. package/template/src/pages/video-call/DefaultLayouts.ts +11 -3
  60. package/template/src/pages/video-call/SidePanelHeader.tsx +12 -2
  61. package/template/src/pages/video-call/VideoCallScreen.tsx +8 -0
  62. package/template/src/pages/video-call/VideoRenderer.tsx +7 -1
  63. package/template/src/rtm/RTMEngine.ts +5 -0
  64. package/template/src/rtm-events-api/Events.ts +70 -16
  65. package/template/src/subComponents/LayoutIconDropdown.tsx +6 -0
  66. package/template/src/subComponents/LocalAudioMute.tsx +13 -3
  67. package/template/src/subComponents/LocalEndCall.tsx +10 -5
  68. package/template/src/subComponents/LocalVideoMute.tsx +15 -1
  69. package/template/src/subComponents/ScreenShareNotice.tsx +2 -2
  70. package/template/src/subComponents/SelectDevice.tsx +111 -3
  71. package/template/src/subComponents/caption/CaptionContainer.tsx +17 -2
  72. package/template/src/subComponents/caption/useSTTAPI.tsx +62 -20
  73. package/template/src/subComponents/caption/useTranscriptDownload.native.ts +35 -5
  74. package/template/src/subComponents/caption/useTranscriptDownload.ts +12 -2
  75. package/template/src/subComponents/chat/ChatParticipants.tsx +6 -0
  76. package/template/src/subComponents/recording/useRecording.tsx +102 -15
  77. package/template/src/subComponents/screenshare/ScreenshareButton.tsx +3 -3
  78. package/template/src/subComponents/screenshare/ScreenshareConfigure.native.tsx +37 -6
  79. package/template/src/subComponents/screenshare/ScreenshareConfigure.tsx +22 -6
  80. package/template/src/subComponents/screenshare/useScreenshare.tsx +4 -4
  81. package/template/src/subComponents/waiting-rooms/useWaitingRoomAPI.ts +26 -0
  82. package/template/src/utils/axiomLogger.ts +2 -1
  83. package/template/src/utils/useCreateRoom.ts +30 -0
  84. package/template/src/utils/useFindActiveSpeaker.ts +43 -0
  85. package/template/src/utils/useFocus.tsx +8 -3
  86. package/template/src/utils/useIsLocalUserSpeaking.ts +19 -3
  87. package/template/src/utils/useJoinRoom.ts +27 -0
  88. package/template/src/utils/useLayout.tsx +9 -3
  89. package/template/src/utils/useSidePanel.tsx +14 -3
@@ -10,7 +10,7 @@
10
10
  *********************************************
11
11
  */
12
12
 
13
- import React, {SetStateAction} from 'react';
13
+ import React, {SetStateAction, useState} from 'react';
14
14
  import {createHook} from 'customization-implementation';
15
15
 
16
16
  export interface currentFocus {
@@ -27,12 +27,17 @@ const FocusContext = React.createContext<FocusContextInterface>({
27
27
  });
28
28
 
29
29
  interface FocusProviderProps {
30
- value: FocusContextInterface;
31
30
  children: React.ReactNode;
32
31
  }
33
32
  const FocusProvider = (props: FocusProviderProps) => {
33
+ const [currentFocus, setFocus] = useState<currentFocus>({
34
+ editName: false,
35
+ });
36
+
37
+ const value = {currentFocus, setFocus};
38
+
34
39
  return (
35
- <FocusContext.Provider value={{...props.value}}>
40
+ <FocusContext.Provider value={value}>
36
41
  {props.children}
37
42
  </FocusContext.Provider>
38
43
  );
@@ -5,6 +5,7 @@ import {useAsyncEffect} from './useAsyncEffect';
5
5
  import LocalEventEmitter, {
6
6
  LocalEventsEnum,
7
7
  } from '../rtm-events-api/LocalEvents';
8
+ import {LogSource, logger} from '../logger/AppBuilderLogger';
8
9
  import {useIsRecordingBot} from '../subComponents/recording/useIsRecordingBot';
9
10
 
10
11
  const useIsLocalUserSpeaking = () => {
@@ -60,7 +61,12 @@ const useIsLocalUserSpeaking = () => {
60
61
  audioTrackRef.current[0]?.stop();
61
62
  }
62
63
  } catch (error) {
63
- log(' Error on stopping the hark', error);
64
+ logger.error(
65
+ LogSource.Internals,
66
+ 'ACTIVE_SPEAKER',
67
+ 'Error on stopping the hark',
68
+ error,
69
+ );
64
70
  }
65
71
  try {
66
72
  //detect local user speaking or not
@@ -75,7 +81,12 @@ const useIsLocalUserSpeaking = () => {
75
81
  speechRef.current.on('speaking', speakingCallBack);
76
82
  speechRef.current.on('stopped_speaking', stoppedSpeakingCallBack);
77
83
  } catch (error) {
78
- log(' Error on starting the hark', error);
84
+ logger.error(
85
+ LogSource.Internals,
86
+ 'ACTIVE_SPEAKER',
87
+ 'Error on starting the hark',
88
+ error,
89
+ );
79
90
  }
80
91
  };
81
92
 
@@ -92,7 +103,12 @@ const useIsLocalUserSpeaking = () => {
92
103
  audioTrackRef.current[0]?.stop &&
93
104
  audioTrackRef.current[0]?.stop();
94
105
  } catch (error) {
95
- console.log('error couldnt stop the track');
106
+ logger.error(
107
+ LogSource.Internals,
108
+ 'ACTIVE_SPEAKER',
109
+ 'couldnt stop the track',
110
+ error,
111
+ );
96
112
  }
97
113
  };
98
114
  }
@@ -7,6 +7,7 @@ import {GraphQLContext} from '../components/GraphQLProvider';
7
7
  import useGetName from './useGetName';
8
8
  import useWaitingRoomAPI from '../subComponents/waiting-rooms/useWaitingRoomAPI';
9
9
  import {base64ToUint8Array} from '../utils';
10
+ import {LogSource, logger} from '../logger/AppBuilderLogger';
10
11
 
11
12
  const JOIN_CHANNEL_PHRASE_AND_GET_USER = gql`
12
13
  query JoinChannel($passphrase: String!) {
@@ -85,11 +86,21 @@ export default function useJoinRoom() {
85
86
  try {
86
87
  let response = null;
87
88
  if (isWaitingRoomEnabled) {
89
+ logger.log(
90
+ LogSource.NetworkRest,
91
+ 'channel_join_request',
92
+ 'API channel_join_request. Trying request to join channel as waiting room is enabled',
93
+ );
88
94
  response = await requestToJoin({
89
95
  meetingPhrase: phrase,
90
96
  send_event: false,
91
97
  });
92
98
  } else {
99
+ logger.log(
100
+ LogSource.NetworkRest,
101
+ 'joinChannel',
102
+ 'API joinChannel. Trying to join channel. Waiting room is disabled',
103
+ );
93
104
  response = await client.query({
94
105
  query:
95
106
  store.token === null
@@ -102,10 +113,26 @@ export default function useJoinRoom() {
102
113
  });
103
114
  }
104
115
  if (response?.error) {
116
+ logger.error(
117
+ LogSource.NetworkRest,
118
+ `${isWaitingRoomEnabled ? 'channel_join_request' : 'joinChannel'}`,
119
+ `API ${
120
+ isWaitingRoomEnabled ? 'channel_join_request' : 'joinChannel'
121
+ } failed.`,
122
+ response?.error,
123
+ );
105
124
  throw response.error;
106
125
  } else {
107
126
  if ((response && response.data) || isWaitingRoomEnabled) {
108
127
  let data = isWaitingRoomEnabled ? response : response.data;
128
+ logger.log(
129
+ LogSource.NetworkRest,
130
+ `${isWaitingRoomEnabled ? 'channel_join_request' : 'joinChannel'}`,
131
+ `API to ${
132
+ isWaitingRoomEnabled ? 'channel_join_request' : 'joinChannel'
133
+ } successful.`,
134
+ phrase,
135
+ );
109
136
  let roomInfo: Partial<RoomInfoContextInterface['data']> = {};
110
137
 
111
138
  if (data?.joinChannel?.channel || data?.channel) {
@@ -10,8 +10,10 @@
10
10
  *********************************************
11
11
  */
12
12
 
13
- import React, {SetStateAction} from 'react';
13
+ import React, {SetStateAction, useState} from 'react';
14
14
  import {createHook} from 'customization-implementation';
15
+ import useLayoutsData from '../pages/video-call/useLayoutsData';
16
+ import {isArray} from './common';
15
17
 
16
18
  export interface LayoutContextInterface {
17
19
  currentLayout: string;
@@ -24,12 +26,16 @@ const LayoutContext = React.createContext<LayoutContextInterface>({
24
26
  });
25
27
 
26
28
  interface LayoutProviderProps {
27
- value: LayoutContextInterface;
28
29
  children: React.ReactNode;
29
30
  }
30
31
  const LayoutProvider = (props: LayoutProviderProps) => {
32
+ const layouts = useLayoutsData();
33
+ const defaultLayoutName = isArray(layouts) ? layouts[0].name : '';
34
+ const [currentLayout, setLayout] = useState(defaultLayoutName);
35
+
36
+ const value = {currentLayout, setLayout};
31
37
  return (
32
- <LayoutContext.Provider value={{...props.value}}>
38
+ <LayoutContext.Provider value={value}>
33
39
  {props.children}
34
40
  </LayoutContext.Provider>
35
41
  );
@@ -10,9 +10,10 @@
10
10
  *********************************************
11
11
  */
12
12
 
13
- import React, {SetStateAction} from 'react';
13
+ import React, {useState, SetStateAction, useEffect} from 'react';
14
14
  import {SidePanelType} from '../subComponents/SidePanelEnum';
15
15
  import {createHook} from 'customization-implementation';
16
+ import {LogSource, logger} from '../logger/AppBuilderLogger';
16
17
 
17
18
  export interface SidePanelContextInterface {
18
19
  sidePanel: SidePanelType;
@@ -25,12 +26,22 @@ const SidePanelContext = React.createContext<SidePanelContextInterface>({
25
26
  });
26
27
 
27
28
  interface SidePanelProviderProps {
28
- value: SidePanelContextInterface;
29
29
  children: React.ReactNode;
30
30
  }
31
31
  const SidePanelProvider = (props: SidePanelProviderProps) => {
32
+ const [sidePanel, setSidePanel] = useState<SidePanelType>(SidePanelType.None);
33
+
34
+ useEffect(() => {
35
+ logger.log(
36
+ LogSource.Internals,
37
+ 'CONTROLS',
38
+ `Side panel changed to -> ${SidePanelType[sidePanel]}`,
39
+ );
40
+ }, [sidePanel]);
41
+
42
+ const value = {sidePanel, setSidePanel};
32
43
  return (
33
- <SidePanelContext.Provider value={{...props.value}}>
44
+ <SidePanelContext.Provider value={value}>
34
45
  {props.children}
35
46
  </SidePanelContext.Provider>
36
47
  );