Activate speaker view when screensharing, even while in PiP
This commit is contained in:
parent
1f4a3851bf
commit
a363c6c0ea
3 changed files with 11 additions and 0 deletions
|
@ -271,6 +271,7 @@ const ActiveCallManager: React.FC<ActiveCallManagerPropsType> = ({
|
|||
setLocalPreview={setLocalPreview}
|
||||
setRendererCanvas={setRendererCanvas}
|
||||
togglePip={togglePip}
|
||||
toggleSpeakerView={toggleSpeakerView}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
|
|
@ -66,6 +66,7 @@ const createProps = (overrideProps: Partial<PropsType> = {}): PropsType => ({
|
|||
setLocalPreview: action('set-local-preview'),
|
||||
setRendererCanvas: action('set-renderer-canvas'),
|
||||
togglePip: action('toggle-pip'),
|
||||
toggleSpeakerView: action('toggleSpeakerView'),
|
||||
});
|
||||
|
||||
const story = storiesOf('Components/CallingPip', module);
|
||||
|
|
|
@ -13,6 +13,7 @@ import {
|
|||
SetRendererCanvasType,
|
||||
} from '../state/ducks/calling';
|
||||
import { missingCaseError } from '../util/missingCaseError';
|
||||
import { useActivateSpeakerViewOnPresenting } from '../hooks/useActivateSpeakerViewOnPresenting';
|
||||
|
||||
enum PositionMode {
|
||||
BeingDragged,
|
||||
|
@ -58,6 +59,7 @@ export type PropsType = {
|
|||
setLocalPreview: (_: SetLocalPreviewType) => void;
|
||||
setRendererCanvas: (_: SetRendererCanvasType) => void;
|
||||
togglePip: () => void;
|
||||
toggleSpeakerView: () => void;
|
||||
};
|
||||
|
||||
const PIP_HEIGHT = 156;
|
||||
|
@ -75,6 +77,7 @@ export const CallingPip = ({
|
|||
setLocalPreview,
|
||||
setRendererCanvas,
|
||||
togglePip,
|
||||
toggleSpeakerView,
|
||||
}: PropsType): JSX.Element | null => {
|
||||
const videoContainerRef = React.useRef<null | HTMLDivElement>(null);
|
||||
const localVideoRef = React.useRef(null);
|
||||
|
@ -86,6 +89,12 @@ export const CallingPip = ({
|
|||
offsetY: PIP_TOP_MARGIN,
|
||||
});
|
||||
|
||||
useActivateSpeakerViewOnPresenting(
|
||||
activeCall.remoteParticipants,
|
||||
activeCall.isInSpeakerView,
|
||||
toggleSpeakerView
|
||||
);
|
||||
|
||||
React.useEffect(() => {
|
||||
setLocalPreview({ element: localVideoRef });
|
||||
}, [setLocalPreview]);
|
||||
|
|
Loading…
Add table
Reference in a new issue