Skip to content

Commit

Permalink
Add note on videos
Browse files Browse the repository at this point in the history
  • Loading branch information
healeycodes committed Nov 22, 2023
1 parent fa5e1e7 commit 14460a7
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions notes/1700564268239.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
In [`9542c6da`](https://github.com/healeycodes/healeycodes.com/commit/9542c6da0a387b275c25b8f979c63c9688d8cbee) I added video support in posts on this website!

My use-case is small looping .mp4 files without controls (without sound, so they can autoplay).

```tsx
<video
style={{ display: 'block', margin: '0 auto', maxWidth: '100%' }}
key={props.src}
controls={false}
autoPlay
playsInline
loop
muted
width={videoMetadata[props.src].width}
height={videoMetadata[props.src].height}>
<source src={`/posts/${id}/${props.src}`} type="video/mp4"></source>
</video>
```

I get the video metadata from a library called [mp4box](https://www.npmjs.com/package/mp4box) during my build step.

1 comment on commit 14460a7

@vercel
Copy link

@vercel vercel bot commented on 14460a7 Nov 22, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.