Voice notes mini-player
This commit is contained in:
parent
b5849f872a
commit
0e655ceeed
45 changed files with 1599 additions and 487 deletions
|
@ -34,6 +34,7 @@ export type PropsType = {
|
|||
saveAttachment: SaveAttachmentActionCreatorType;
|
||||
selectedIndex?: number;
|
||||
toggleForwardMessageModal: (messageId: string) => unknown;
|
||||
onMediaPlaybackStart: () => void;
|
||||
};
|
||||
|
||||
const ZOOM_SCALE = 3;
|
||||
|
@ -60,6 +61,7 @@ export function Lightbox({
|
|||
saveAttachment,
|
||||
selectedIndex: initialSelectedIndex = 0,
|
||||
toggleForwardMessageModal,
|
||||
onMediaPlaybackStart,
|
||||
}: PropsType): JSX.Element | null {
|
||||
const [root, setRoot] = React.useState<HTMLElement | undefined>();
|
||||
const [selectedIndex, setSelectedIndex] =
|
||||
|
@ -204,11 +206,12 @@ export function Lightbox({
|
|||
}
|
||||
|
||||
if (videoElement.paused) {
|
||||
onMediaPlaybackStart();
|
||||
void videoElement.play();
|
||||
} else {
|
||||
videoElement.pause();
|
||||
}
|
||||
}, [videoElement]);
|
||||
}, [videoElement, onMediaPlaybackStart]);
|
||||
|
||||
useEffect(() => {
|
||||
const div = document.createElement('div');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue