[FIX] Video and Audio not skipping forward (#19866)

* [FIX] Video and Audio not skipping forward

* chore: add preload attr to video attachement

Co-authored-by: Tasso Evangelista <tasso.evangelista@rocket.chat>
Co-authored-by: dougfabris <devfabris@gmail.com>
pull/24256/head^2
Martin Schoeler 4 years ago committed by GitHub
parent 08755082fe
commit f8a68e0bfa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      client/components/Message/Attachments/Files/AudioAttachment.tsx
  2. 4
      client/components/Message/Attachments/Files/VideoAttachment.tsx

@ -29,7 +29,7 @@ export const AudioAttachment: FC<AudioAttachmentProps> = ({
</Attachment.Row>
{!collapsed && (
<Attachment.Content border='none'>
<audio controls>
<audio controls preload='metadata'>
<source src={getURL(url)} type={type} />
</audio>
</Attachment.Content>

@ -18,8 +18,8 @@ export const VideoAttachment: FC<VideoAttachmentProps> = ({
title_link_download: hasDownload,
}) => {
const [collapsed, collapse] = useCollapse(collapsedDefault);
// useTranslation();
const getURL = useMediaUrl();
return (
<Attachment>
<Attachment.Row>
@ -30,7 +30,7 @@ export const VideoAttachment: FC<VideoAttachmentProps> = ({
</Attachment.Row>
{!collapsed && (
<Attachment.Content width='full'>
<Box is='video' width='full' controls>
<Box is='video' width='full' controls preload='metadata'>
<source src={getURL(url)} type={type} />
</Box>
{description && (

Loading…
Cancel
Save