simplify video stuff

This commit is contained in:
overcuriousity
2025-08-12 22:13:14 +02:00
parent b291492e2d
commit 27b94edcfa
8 changed files with 202 additions and 629 deletions

View File

@@ -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}
>