-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
fa5e1e7
commit 14460a7
Showing
1 changed file
with
20 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
14460a7
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
healeycodes – ./
healeycodes.vercel.app
healeycodes-healeycodes.vercel.app
healeycodes-git-main-healeycodes.vercel.app
www.healeycodes.com
healeycodes.com