agora-appbuilder-core 4.1.19-beta.4 → 4.1.20

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 (34) hide show
  1. package/package.json +1 -1
  2. package/template/bridge/rtc/webNg/RtcEngine.ts +320 -83
  3. package/template/customization-api/atoms.ts +0 -2
  4. package/template/customization-api/customEvents.ts +1 -4
  5. package/template/customization-api/index.ts +0 -1
  6. package/template/customization-api/typeDefinition.ts +1 -6
  7. package/template/defaultConfig.js +2 -2
  8. package/template/src/components/Controls.tsx +3 -1
  9. package/template/src/components/CustomSidePanel.tsx +13 -13
  10. package/template/src/components/RTMConfigure.tsx +0 -13
  11. package/template/src/components/livestream/LiveStreamContext.tsx +6 -2
  12. package/template/src/components/participants/UserActionMenuOptions.tsx +2 -29
  13. package/template/src/pages/Create.tsx +19 -31
  14. package/template/src/pages/video-call/ActionSheet.native.tsx +0 -2
  15. package/template/src/pages/video-call/ActionSheet.tsx +0 -2
  16. package/template/src/pages/video-call/ActionSheetHandle.tsx +0 -1
  17. package/template/src/pages/video-call/SidePanelHeader.tsx +1 -3
  18. package/template/src/pages/video-call/VideoCallScreen.tsx +0 -3
  19. package/template/src/pages/video-call/VideoRenderer.tsx +0 -4
  20. package/template/src/subComponents/LocalEndCall.tsx +1 -1
  21. package/template/src/subComponents/ScreenShareNotice.tsx +1 -1
  22. package/template/src/subComponents/SidePanelHeader.tsx +2 -16
  23. package/template/src/subComponents/recording/__tests__/recordingJourney.test.ts +25 -0
  24. package/template/src/subComponents/recording/__tests__/recordingLayoutResponse.test.ts +56 -0
  25. package/template/src/subComponents/recording/recordingJourney.ts +12 -0
  26. package/template/src/subComponents/recording/recordingLayoutResponse.ts +67 -0
  27. package/template/src/subComponents/recording/useRecording.tsx +28 -12
  28. package/template/src/subComponents/recording/useRecordingLayoutQuery.tsx +35 -45
  29. package/template/src/subComponents/screenshare/ScreenshareButton.tsx +1 -1
  30. package/template/src/subComponents/screenshare/ScreenshareConfigure.tsx +483 -31
  31. package/template/src/subComponents/screenshare/__tests__/screenshareJourney.test.ts +63 -0
  32. package/template/src/subComponents/screenshare/screenshareJourney.ts +43 -0
  33. package/template/src/subComponents/screenshare/useScreenshare.tsx +18 -2
  34. package/template/customization-api/ai-agent.ts +0 -4
@@ -5,6 +5,7 @@ import {UidType} from '../../../agora-rn-uikit';
5
5
  import {logger, LogSource} from '../../logger/AppBuilderLogger';
6
6
  import getUniqueID from '../../utils/getUniqueID';
7
7
  import StorageContext from '../../components/StorageContext';
8
+ import {parseRecordingLayoutResponse} from './recordingLayoutResponse';
8
9
 
9
10
  const RECORDING_LAYOUT_URL = `${$config.BACKEND_ENDPOINT}/v1/recording/layout/update`;
10
11
 
@@ -39,32 +40,28 @@ function useRecordingLayoutQuery() {
39
40
  },
40
41
  body: payload,
41
42
  });
42
- const response = await res.json();
43
-
44
- if (response?.error) {
45
- throw response?.error;
46
- } else {
47
- const endReqTs = Date.now();
48
- logger.log(
49
- LogSource.Internals,
50
- 'RECORDING',
51
- 'setPresenterQuery success',
52
- {
53
- responseData: res,
54
- startReqTs,
55
- endReqTs,
56
- latency: endReqTs - startReqTs,
57
- requestId,
58
- },
59
- );
60
- }
43
+ const response = await parseRecordingLayoutResponse(res);
44
+ const endReqTs = Date.now();
45
+ logger.log(
46
+ LogSource.Internals,
47
+ 'RECORDING',
48
+ 'setPresenterQuery success',
49
+ {
50
+ responseData: response,
51
+ httpStatus: res.status,
52
+ startReqTs,
53
+ endReqTs,
54
+ latency: endReqTs - startReqTs,
55
+ requestId,
56
+ },
57
+ );
61
58
  } catch (error) {
62
59
  const endReqTs = Date.now();
63
60
  logger.error(
64
61
  LogSource.Internals,
65
62
  'RECORDING',
66
63
  'setPresenterQuery failure',
67
- JSON.stringify(error || {}),
64
+ error,
68
65
  {
69
66
  startReqTs,
70
67
  endReqTs,
@@ -72,6 +69,7 @@ function useRecordingLayoutQuery() {
72
69
  requestId,
73
70
  },
74
71
  );
72
+ throw error;
75
73
  }
76
74
  };
77
75
 
@@ -94,37 +92,28 @@ function useRecordingLayoutQuery() {
94
92
  },
95
93
  body: payload,
96
94
  });
97
- const response = await res.json();
98
-
99
- if (response?.error) {
100
- throw response?.error;
101
- } else {
102
- const endReqTs = Date.now();
103
- logger.log(
104
- LogSource.Internals,
105
- 'RECORDING',
106
- 'executeNormalQuery success',
107
- {
108
- responseData: res,
109
- startReqTs,
110
- endReqTs,
111
- latency: endReqTs - startReqTs,
112
- requestId,
113
- },
114
- );
115
- // Once the backend sucessfuly stops recording,
116
- // send a control message to everbody in the channel indicating that cloud recording is now inactive.
117
- // sendControlMessage(controlMessageEnum.cloudRecordingUnactive);
118
- // set the local recording state to false to update the UI
119
- // setScreenshareActive(false);
120
- }
95
+ const response = await parseRecordingLayoutResponse(res);
96
+ const endReqTs = Date.now();
97
+ logger.log(
98
+ LogSource.Internals,
99
+ 'RECORDING',
100
+ 'executeNormalQuery success',
101
+ {
102
+ responseData: response,
103
+ httpStatus: res.status,
104
+ startReqTs,
105
+ endReqTs,
106
+ latency: endReqTs - startReqTs,
107
+ requestId,
108
+ },
109
+ );
121
110
  } catch (error) {
122
111
  const endReqTs = Date.now();
123
112
  logger.error(
124
113
  LogSource.Internals,
125
114
  'RECORDING',
126
115
  'executeNormalQuery failure',
127
- JSON.stringify(error || {}),
116
+ error,
128
117
  {
129
118
  startReqTs,
130
119
  endReqTs,
@@ -132,6 +121,7 @@ function useRecordingLayoutQuery() {
132
121
  requestId,
133
122
  },
134
123
  );
124
+ throw error;
135
125
  }
136
126
  };
137
127
 
@@ -55,7 +55,7 @@ const ScreenshareButton = (props: ScreenshareButtonProps) => {
55
55
  const lstooltip = useString<boolean>(livestreamingShareTooltipText);
56
56
  const onPress = () => {
57
57
  if (isScreenshareActive) {
58
- stopScreenshare();
58
+ stopScreenshare('toolbar');
59
59
  } else {
60
60
  if (isAndroid() || isIOS()) {
61
61
  //native screen we need to ask user to stop all coming video before proceeding the screenshare