Speaking indicator for group calls
Co-authored-by: Peter Thatcher <peter@signal.org> Co-authored-by: Jim Gustafson <jim@signal.org> Co-authored-by: Josh Perez <60019601+josh-signal@users.noreply.github.com>
This commit is contained in:
parent
cb5131420f
commit
5ce26eb91a
35 changed files with 482 additions and 42 deletions
30
ts/components/CallingAudioIndicator.tsx
Normal file
30
ts/components/CallingAudioIndicator.tsx
Normal file
|
@ -0,0 +1,30 @@
|
|||
// Copyright 2022 Signal Messenger, LLC
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import type { ReactElement } from 'react';
|
||||
import React from 'react';
|
||||
import animationData from '../../images/lottie-animations/CallingSpeakingIndicator.json';
|
||||
import { Lottie } from './Lottie';
|
||||
|
||||
export function CallingAudioIndicator({
|
||||
hasRemoteAudio,
|
||||
isSpeaking,
|
||||
}: Readonly<{
|
||||
hasRemoteAudio: boolean;
|
||||
isSpeaking: boolean;
|
||||
}>): ReactElement {
|
||||
if (!hasRemoteAudio) {
|
||||
return (
|
||||
<div className="CallingAudioIndicator CallingAudioIndicator--muted" />
|
||||
);
|
||||
}
|
||||
|
||||
if (isSpeaking) {
|
||||
return (
|
||||
<Lottie animationData={animationData} className="CallingAudioIndicator" />
|
||||
);
|
||||
}
|
||||
|
||||
// Render an empty spacer so that names don't move around.
|
||||
return <div className="CallingAudioIndicator" />;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue