From 27b94edcfa5bdc1b6b930c3194462b52390e30a4 Mon Sep 17 00:00:00 2001 From: overcuriousity Date: Tue, 12 Aug 2025 22:13:14 +0200 Subject: [PATCH] simplify video stuff --- src/components/Video.astro | 11 +- src/content/knowledgebase/tool-misp.md | 4 +- .../knowledgebase/tool-velociraptor.md | 2 + src/layouts/BaseLayout.astro | 31 + src/pages/api/video/cached/[...path].ts | 142 ----- src/pages/api/video/process.ts | 43 -- src/utils/remarkVideoPlugin.ts | 61 +- src/utils/videoUtils.ts | 537 ++++-------------- 8 files changed, 202 insertions(+), 629 deletions(-) delete mode 100644 src/pages/api/video/cached/[...path].ts delete mode 100644 src/pages/api/video/process.ts diff --git a/src/components/Video.astro b/src/components/Video.astro index 6a0be33..4e16902 100644 --- a/src/components/Video.astro +++ b/src/components/Video.astro @@ -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(':', '-')}`; --- -
+