simplify video stuff
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
---
|
||||
// src/components/Video.astro - SIMPLE wrapper component
|
||||
// src/components/Video.astro - SIMPLE responsive video component
|
||||
export interface Props {
|
||||
src: string;
|
||||
title?: string;
|
||||
@@ -8,6 +8,7 @@ export interface Props {
|
||||
muted?: boolean;
|
||||
loop?: boolean;
|
||||
aspectRatio?: '16:9' | '4:3' | '1:1';
|
||||
preload?: 'none' | 'metadata' | 'auto';
|
||||
}
|
||||
|
||||
const {
|
||||
@@ -17,17 +18,21 @@ const {
|
||||
autoplay = false,
|
||||
muted = false,
|
||||
loop = false,
|
||||
aspectRatio = '16:9'
|
||||
aspectRatio = '16:9',
|
||||
preload = 'metadata'
|
||||
} = Astro.props;
|
||||
|
||||
const aspectClass = `aspect-${aspectRatio.replace(':', '-')}`;
|
||||
---
|
||||
|
||||
<div class={`video-container aspect-${aspectRatio}`}>
|
||||
<div class={`video-container ${aspectClass}`}>
|
||||
<video
|
||||
src={src}
|
||||
controls={controls}
|
||||
autoplay={autoplay}
|
||||
muted={muted}
|
||||
loop={loop}
|
||||
preload={preload}
|
||||
style="width: 100%; height: 100%;"
|
||||
data-video-title={title}
|
||||
>
|
||||
|
||||
Reference in New Issue
Block a user