fix: duration for audio/video and disappears in debug right panel

pull/3206/head
Audric Ackermann 7 months ago
parent db7b4b5f6d
commit aa4d024d30

@ -44,7 +44,7 @@ export const AttachmentInfo = (props: Props) => {
/>
<LabelWithInfo
label={window.i18n('attachmentsDuration')}
info={attachment?.duration ? attachment?.duration : window.i18n('attachmentsNa')}
info={attachment?.duration ? attachment.duration : window.i18n('attachmentsNa')}
/>
</StyledLabelContainer>
</Flex>

@ -110,7 +110,7 @@ const DebugMessageInfo = ({ messageId }: { messageId: string }) => {
{expirationTimestamp ? (
<LabelWithInfo
label={`Disappears:`}
info={formatTimeDistanceToNow(expirationTimestamp * 1000)}
info={formatTimeDistanceToNow(Math.floor(expirationTimestamp / 1000))}
/>
) : null}
</>

@ -120,7 +120,7 @@ export async function getVideoDuration({
const video = document.createElement('video');
video.addEventListener('loadedmetadata', () => {
const duration = formatTimeDuration(video.duration / 1000, { unit: 'second' });
const duration = formatTimeDuration(video.duration * 1000, { unit: 'second' });
resolve(duration);
});
@ -153,7 +153,7 @@ export async function getAudioDuration({
const audio = document.createElement('audio');
audio.addEventListener('loadedmetadata', () => {
const duration = formatTimeDuration(audio.duration / 1000, { unit: 'second' });
const duration = formatTimeDuration(audio.duration * 1000, { unit: 'second' });
resolve(duration);
});

Loading…
Cancel
Save