Voice notes mini-player

This commit is contained in:
Alvaro 2023-02-24 16:18:57 -07:00 committed by GitHub
parent b5849f872a
commit 0e655ceeed
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
45 changed files with 1599 additions and 487 deletions

View file

@ -35,6 +35,7 @@ export type PropsType = {
readonly moduleClassName?: string;
readonly queueStoryDownload: (storyId: string) => unknown;
readonly storyId: string;
readonly onMediaPlaybackStart: () => void;
};
export function StoryImage({
@ -50,6 +51,7 @@ export function StoryImage({
moduleClassName,
queueStoryDownload,
storyId,
onMediaPlaybackStart,
}: PropsType): JSX.Element | null {
const shouldDownloadAttachment =
(!isDownloaded(attachment) && !isDownloading(attachment)) ||
@ -72,9 +74,10 @@ export function StoryImage({
if (isPaused) {
videoRef.current.pause();
} else {
onMediaPlaybackStart();
void videoRef.current.play();
}
}, [isPaused]);
}, [isPaused, onMediaPlaybackStart]);
useEffect(() => {
setHasImgError(false);