Highlight speaker on group calls

This commit is contained in:
Alvaro 2023-02-28 13:01:52 -07:00 committed by GitHub
parent 3d4248e070
commit 23cbd2c8b3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 80 additions and 25 deletions

View file

@ -40,11 +40,15 @@ import { NeedsScreenRecordingPermissionsModal } from './NeedsScreenRecordingPerm
import { missingCaseError } from '../util/missingCaseError';
import * as KeyboardLayout from '../services/keyboardLayout';
import { useActivateSpeakerViewOnPresenting } from '../hooks/useActivateSpeakerViewOnPresenting';
import { CallingAudioIndicator } from './CallingAudioIndicator';
import {
CallingAudioIndicator,
SPEAKING_LINGER_MS,
} from './CallingAudioIndicator';
import {
useActiveCallShortcuts,
useKeyboardShortcuts,
} from '../hooks/useKeyboardShortcuts';
import { useValueAtFixedRate } from '../hooks/useValueAtFixedRate';
export type PropsType = {
activeCall: ActiveCallType;
@ -155,6 +159,11 @@ export function CallScreen({
showParticipantsList,
} = activeCall;
const isSpeaking = useValueAtFixedRate(
localAudioLevel > 0,
SPEAKING_LINGER_MS
);
useActivateSpeakerViewOnPresenting({
remoteParticipants,
switchToPresentationView,
@ -536,6 +545,7 @@ export function CallScreen({
<CallingAudioIndicator
hasAudio={hasLocalAudio}
audioLevel={localAudioLevel}
shouldShowSpeaking={isSpeaking}
/>
</div>
</div>