agora-appbuilder-core 4.0.29-beta-9 → 4.0.29-beta-13
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/customization-api/action-library.ts +1 -4
- package/template/customization-api/app-state.ts +2 -0
- package/template/src/components/ChatContext.ts +5 -5
- package/template/src/pages/video-call/VideoCallMobileView.tsx +88 -71
- package/template/src/utils/useGetHostUids.ts +6 -0
package/package.json
CHANGED
|
@@ -7,7 +7,4 @@ export {default as useRemoteEndcall} from '../src/utils/useRemoteEndCall';
|
|
|
7
7
|
//switch camera
|
|
8
8
|
export {default as useSwitchCamera} from '../src/utils/useSwitchCamera';
|
|
9
9
|
|
|
10
|
-
export {
|
|
11
|
-
controlMessageEnum,
|
|
12
|
-
useChatContext,
|
|
13
|
-
} from '../src/components/ChatContext';
|
|
10
|
+
export {controlMessageEnum} from '../src/components/ChatContext';
|
|
@@ -61,3 +61,5 @@ export type {ChatUIControlsInterface} from '../src/components/chat-ui/useChatUIC
|
|
|
61
61
|
export {useVirtualBackground} from '../src/app-state/useVirtualBackground';
|
|
62
62
|
export {useBeautyEffects} from '../src/app-state/useBeautyEffects';
|
|
63
63
|
export {useLiveStreamDataContext} from '../src/components/contexts/LiveStreamDataContext';
|
|
64
|
+
export {useRtm} from '../src/components/ChatContext';
|
|
65
|
+
export {useGetHostIds} from '../src/utils/useGetHostUids';
|
|
@@ -61,7 +61,7 @@ export enum messageActionType {
|
|
|
61
61
|
Normal = '1',
|
|
62
62
|
}
|
|
63
63
|
|
|
64
|
-
export interface
|
|
64
|
+
export interface RtmContextInterface {
|
|
65
65
|
hasUserJoinedRTM: boolean;
|
|
66
66
|
rtmInitTimstamp: number;
|
|
67
67
|
engine: RtmEngine;
|
|
@@ -81,9 +81,9 @@ export enum controlMessageEnum {
|
|
|
81
81
|
kickScreenshare = '9',
|
|
82
82
|
}
|
|
83
83
|
|
|
84
|
-
const
|
|
84
|
+
const RtmContext = createContext(null as unknown as RtmContextInterface);
|
|
85
85
|
|
|
86
|
-
const
|
|
86
|
+
const useRtm = createHook(RtmContext);
|
|
87
87
|
|
|
88
|
-
export {
|
|
89
|
-
export default
|
|
88
|
+
export {useRtm};
|
|
89
|
+
export default RtmContext;
|
|
@@ -184,87 +184,100 @@ const VideoCallMobileView = props => {
|
|
|
184
184
|
|
|
185
185
|
const VideoCallView = React.memo(() => {
|
|
186
186
|
//toolbar changes
|
|
187
|
-
const {
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
187
|
+
const {
|
|
188
|
+
BottombarComponent,
|
|
189
|
+
BottombarProps,
|
|
190
|
+
TopbarComponent,
|
|
191
|
+
TopbarProps,
|
|
192
|
+
VideocallWrapper,
|
|
193
|
+
} = useCustomization(data => {
|
|
194
|
+
let components: {
|
|
195
|
+
BottombarComponent: React.ComponentType<any>;
|
|
196
|
+
BottombarProps?: ToolbarPresetProps['items'];
|
|
197
|
+
TopbarComponent: React.ComponentType<NavbarProps>;
|
|
198
|
+
TopbarProps?: ToolbarPresetProps['items'];
|
|
199
|
+
VideocallWrapper?: React.ComponentType;
|
|
200
|
+
} = {
|
|
201
|
+
BottombarComponent: ActionSheet,
|
|
202
|
+
BottombarProps: {},
|
|
203
|
+
TopbarComponent: NavbarMobile,
|
|
204
|
+
TopbarProps: {},
|
|
205
|
+
VideocallWrapper: ContainerView,
|
|
206
|
+
};
|
|
207
|
+
if (
|
|
208
|
+
data?.components?.videoCall &&
|
|
209
|
+
typeof data?.components?.videoCall === 'object'
|
|
210
|
+
) {
|
|
200
211
|
if (
|
|
201
|
-
data?.components?.videoCall &&
|
|
202
|
-
typeof data?.components?.videoCall
|
|
212
|
+
data?.components?.videoCall?.bottomToolBar &&
|
|
213
|
+
typeof data?.components?.videoCall.bottomToolBar !== 'object' &&
|
|
214
|
+
isValidReactComponent(data?.components?.videoCall.bottomToolBar)
|
|
203
215
|
) {
|
|
204
|
-
|
|
205
|
-
data?.components?.videoCall
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
typeof data?.components?.videoCall?.bottomToolBar === 'object' &&
|
|
215
|
-
Object.keys(data?.components?.videoCall.bottomToolBar)?.length
|
|
216
|
-
) {
|
|
217
|
-
components.BottombarProps = data?.components?.videoCall.bottomToolBar;
|
|
218
|
-
}
|
|
216
|
+
components.BottombarComponent =
|
|
217
|
+
data?.components?.videoCall.bottomToolBar;
|
|
218
|
+
}
|
|
219
|
+
if (
|
|
220
|
+
data?.components?.videoCall?.bottomToolBar &&
|
|
221
|
+
typeof data?.components?.videoCall?.bottomToolBar === 'object' &&
|
|
222
|
+
Object.keys(data?.components?.videoCall.bottomToolBar)?.length
|
|
223
|
+
) {
|
|
224
|
+
components.BottombarProps = data?.components?.videoCall.bottomToolBar;
|
|
225
|
+
}
|
|
219
226
|
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
+
if (
|
|
228
|
+
data?.components?.videoCall?.topToolBar &&
|
|
229
|
+
typeof data?.components?.videoCall?.topToolBar !== 'object' &&
|
|
230
|
+
isValidReactComponent(data?.components?.videoCall.topToolBar)
|
|
231
|
+
) {
|
|
232
|
+
components.TopbarComponent = data?.components?.videoCall.topToolBar;
|
|
233
|
+
}
|
|
227
234
|
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
+
if (
|
|
236
|
+
data?.components?.videoCall?.topToolBar &&
|
|
237
|
+
typeof data?.components?.videoCall?.topToolBar === 'object' &&
|
|
238
|
+
Object.keys(data?.components?.videoCall.topToolBar).length
|
|
239
|
+
) {
|
|
240
|
+
components.TopbarProps = data?.components?.videoCall.topToolBar;
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
if (
|
|
244
|
+
data?.components?.videoCall?.wrapper &&
|
|
245
|
+
typeof data?.components?.videoCall?.wrapper !== 'object' &&
|
|
246
|
+
isValidReactComponent(data?.components?.videoCall.wrapper)
|
|
247
|
+
) {
|
|
248
|
+
components.VideocallWrapper = data?.components?.videoCall.wrapper;
|
|
235
249
|
}
|
|
250
|
+
}
|
|
236
251
|
|
|
237
|
-
|
|
238
|
-
|
|
252
|
+
return components;
|
|
253
|
+
});
|
|
239
254
|
|
|
240
255
|
return (
|
|
241
|
-
<
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
{
|
|
245
|
-
|
|
256
|
+
<VideocallWrapper>
|
|
257
|
+
<ToolbarProvider value={{position: ToolbarPosition.top}}>
|
|
258
|
+
{Object.keys(TopbarProps)?.length ? (
|
|
259
|
+
<TopbarComponent items={TopbarProps} includeDefaultItems={false} />
|
|
260
|
+
) : (
|
|
261
|
+
<TopbarComponent />
|
|
262
|
+
)}
|
|
263
|
+
</ToolbarProvider>
|
|
264
|
+
<View style={styles.videoView}>
|
|
265
|
+
<VideoComponent />
|
|
266
|
+
<CaptionContainer />
|
|
267
|
+
</View>
|
|
268
|
+
<ToolbarProvider value={{position: ToolbarPosition.bottom}}>
|
|
269
|
+
<ActionSheetProvider>
|
|
270
|
+
{Object.keys(BottombarProps)?.length ? (
|
|
271
|
+
<BottombarComponent
|
|
272
|
+
items={BottombarProps}
|
|
273
|
+
includeDefaultItems={false}
|
|
274
|
+
/>
|
|
246
275
|
) : (
|
|
247
|
-
<
|
|
276
|
+
<BottombarComponent />
|
|
248
277
|
)}
|
|
249
|
-
</
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
<CaptionContainer />
|
|
253
|
-
</View>
|
|
254
|
-
<ToolbarProvider value={{position: ToolbarPosition.bottom}}>
|
|
255
|
-
<ActionSheetProvider>
|
|
256
|
-
{Object.keys(BottombarProps)?.length ? (
|
|
257
|
-
<BottombarComponent
|
|
258
|
-
items={BottombarProps}
|
|
259
|
-
includeDefaultItems={false}
|
|
260
|
-
/>
|
|
261
|
-
) : (
|
|
262
|
-
<BottombarComponent />
|
|
263
|
-
)}
|
|
264
|
-
</ActionSheetProvider>
|
|
265
|
-
</ToolbarProvider>
|
|
266
|
-
</>
|
|
267
|
-
</View>
|
|
278
|
+
</ActionSheetProvider>
|
|
279
|
+
</ToolbarProvider>
|
|
280
|
+
</VideocallWrapper>
|
|
268
281
|
);
|
|
269
282
|
});
|
|
270
283
|
|
|
@@ -297,3 +310,7 @@ const styles = StyleSheet.create({
|
|
|
297
310
|
flexDirection: 'row',
|
|
298
311
|
},
|
|
299
312
|
});
|
|
313
|
+
|
|
314
|
+
const ContainerView = props => {
|
|
315
|
+
return <View style={styles.container}>{props.children}</View>;
|
|
316
|
+
};
|