Reuse html element for local preview visuals
This commit is contained in:
parent
bb69f81b9f
commit
17c908bbf4
14 changed files with 86 additions and 109 deletions
|
@ -420,11 +420,6 @@ type StartCallLinkLobbyPayloadType = {
|
|||
callLinkRootKey: string;
|
||||
};
|
||||
|
||||
// eslint-disable-next-line local-rules/type-alias-readonlydeep
|
||||
export type SetLocalPreviewType = {
|
||||
element: React.RefObject<HTMLVideoElement> | undefined;
|
||||
};
|
||||
|
||||
// eslint-disable-next-line local-rules/type-alias-readonlydeep
|
||||
export type SetRendererCanvasType = {
|
||||
element: React.RefObject<HTMLCanvasElement> | undefined;
|
||||
|
@ -1835,14 +1830,6 @@ function setIsCallActive(
|
|||
};
|
||||
}
|
||||
|
||||
function setLocalPreview(
|
||||
payload: SetLocalPreviewType
|
||||
): ThunkAction<void, RootStateType, unknown, never> {
|
||||
return () => {
|
||||
calling.videoCapturer.setLocalPreview(payload.element);
|
||||
};
|
||||
}
|
||||
|
||||
function setRendererCanvas(
|
||||
payload: SetRendererCanvasType
|
||||
): ThunkAction<void, RootStateType, unknown, never> {
|
||||
|
@ -2661,7 +2648,6 @@ export const actions = {
|
|||
setGroupCallVideoRequest,
|
||||
setIsCallActive,
|
||||
setLocalAudio,
|
||||
setLocalPreview,
|
||||
setLocalVideo,
|
||||
setOutgoingRing,
|
||||
setRendererCanvas,
|
||||
|
@ -3802,8 +3788,7 @@ export function reducer(
|
|||
}
|
||||
|
||||
return {
|
||||
...state,
|
||||
capturerBaton: undefined,
|
||||
...(action.payload == null ? abortCapturer(state) : state),
|
||||
activeCallState: {
|
||||
...activeCallState,
|
||||
presentingSource: action.payload,
|
||||
|
|
|
@ -116,6 +116,10 @@ async function notifyForCall(
|
|||
});
|
||||
}
|
||||
|
||||
function setLocalPreviewContainer(container: HTMLDivElement | null): void {
|
||||
callingService.setLocalPreviewContainer(container);
|
||||
}
|
||||
|
||||
const playRingtone = callingTones.playRingtone.bind(callingTones);
|
||||
const stopRingtone = callingTones.stopRingtone.bind(callingTones);
|
||||
|
||||
|
@ -449,7 +453,6 @@ export const SmartCallManager = memo(function SmartCallManager() {
|
|||
setIsCallActive,
|
||||
setLocalAudio,
|
||||
setLocalVideo,
|
||||
setLocalPreview,
|
||||
setOutgoingRing,
|
||||
setRendererCanvas,
|
||||
switchToPresentationView,
|
||||
|
@ -509,7 +512,7 @@ export const SmartCallManager = memo(function SmartCallManager() {
|
|||
setGroupCallVideoRequest={setGroupCallVideoRequest}
|
||||
setIsCallActive={setIsCallActive}
|
||||
setLocalAudio={setLocalAudio}
|
||||
setLocalPreview={setLocalPreview}
|
||||
setLocalPreviewContainer={setLocalPreviewContainer}
|
||||
setLocalVideo={setLocalVideo}
|
||||
setOutgoingRing={setOutgoingRing}
|
||||
setRendererCanvas={setRendererCanvas}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue