Dynamic audio level indicator

This commit is contained in:
Fedor Indutny 2022-05-18 20:28:51 -07:00 committed by GitHub
parent ac59dec5aa
commit e6223b6a11
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
24 changed files with 323 additions and 123 deletions

View file

@ -24,7 +24,7 @@ type PropsType = {
isVisible: boolean
) => unknown;
overflowedParticipants: ReadonlyArray<GroupCallRemoteParticipantType>;
speakingDemuxIds: Set<number>;
remoteAudioLevels: Map<number, number>;
};
export const GroupCallOverflowArea: FC<PropsType> = ({
@ -33,7 +33,7 @@ export const GroupCallOverflowArea: FC<PropsType> = ({
i18n,
onParticipantVisibilityChanged,
overflowedParticipants,
speakingDemuxIds,
remoteAudioLevels,
}) => {
const overflowRef = useRef<HTMLDivElement | null>(null);
const [overflowScrollTop, setOverflowScrollTop] = useState(0);
@ -116,7 +116,7 @@ export const GroupCallOverflowArea: FC<PropsType> = ({
getFrameBuffer={getFrameBuffer}
getGroupCallVideoFrameSource={getGroupCallVideoFrameSource}
i18n={i18n}
isSpeaking={speakingDemuxIds.has(remoteParticipant.demuxId)}
audioLevel={remoteAudioLevels.get(remoteParticipant.demuxId) ?? 0}
onVisibilityChanged={onParticipantVisibilityChanged}
width={OVERFLOW_PARTICIPANT_WIDTH}
height={Math.floor(