Fixes to voice notes playback

This commit is contained in:
Alvaro 2023-02-28 06:07:40 -07:00 committed by GitHub
parent fad0529080
commit 3d4248e070
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 285 additions and 274 deletions

View file

@ -18,7 +18,8 @@ export type Props = Readonly<{
i18n: LocalizerType;
title: string;
currentTime: number;
duration: number;
// not available until audio has loaded
duration: number | undefined;
playbackRate: number;
state: PlayerState;
onPlay: () => void;
@ -91,11 +92,13 @@ export function MiniPlayer({
<div className="MiniPlayer__state">
<Emojify text={title} />
<span className="MiniPlayer__middot">&middot;</span>
<span>
{durationToPlaybackText(
state === PlayerState.loading ? duration : currentTime
)}
</span>
{duration !== undefined && (
<span>
{durationToPlaybackText(
state === PlayerState.loading ? duration : currentTime
)}
</span>
)}
</div>
<PlaybackRateButton