Skip to content

Commit 44a3e86

Browse files
committed
feat: Add play-always property to Video component
1 parent 2dc53bf commit 44a3e86

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/components/Video.astro

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
11
---
22
interface Props {
33
src: string;
4+
"play-always": boolean;
45
}
56
6-
const { src } = Astro.props;
7+
const props: Props = Astro.props;
8+
9+
const src = props.src;
10+
const always = props["play-always"] ?? false;
711
---
812

9-
<video width="100%" muted loop controls data-pagefind-ignore>
13+
<video width="100%" muted loop controls={!always} data-pagefind-ignore autoplay={always}>
1014
<source {src} type="video/mp4" />
1115
Your device does not support video playback.
1216
</video>

0 commit comments

Comments
 (0)