Skip to content

Commit

Permalink
✨ : preload the video
Browse files Browse the repository at this point in the history
  • Loading branch information
hsunpei committed Oct 20, 2024
1 parent d2f863c commit d0e5125
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/video/src/components/Video.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ export interface VideoProps {

// TODO:
// - thumbnail
// - preload
// - loadedmetadata

export const Video = ({ src, srcWebm, width, height, ratio = 0, className }: VideoProps) => {
const videoRef = useRef<VideoRef>(null);
Expand Down Expand Up @@ -88,6 +86,8 @@ export const VideoWithImperativeHandle = React.memo(
disableRemotePlayback
playsInline
controls={false}
// preload the video
preload="auto"
>
{srcWebm && <source src={srcWebm} type="video/webm" />}
<source src={src} type="video/mp4" />
Expand Down

0 comments on commit d0e5125

Please sign in to comment.