diff --git a/src/layouts/BaseLayout.astro b/src/layouts/BaseLayout.astro index fe7f024..e662f81 100644 --- a/src/layouts/BaseLayout.astro +++ b/src/layouts/BaseLayout.astro @@ -28,9 +28,9 @@ const { title, description, keywords, openGraph, viewTransition } = Astro.props; <> {description && } - + - + )} diff --git a/src/pages/video/[name].astro b/src/pages/video/[name].astro index f6f3992..8f5134a 100644 --- a/src/pages/video/[name].astro +++ b/src/pages/video/[name].astro @@ -2,6 +2,7 @@ import WebsiteLayout from '@layouts/website/WebsiteLayout.astro'; import VideoPlayer from '@app/website/video/VideoPlayer.svelte'; import { getVideoMetadata, resolveVideo } from '@util/video.ts'; +import { BASE_PATH } from 'astro:env/server'; const { name } = Astro.params; @@ -12,16 +13,13 @@ const metadata = await getVideoMetadata(video); if (!metadata) return new Response(null, { status: 404 }); const { title, description, width, height, duration } = metadata; -const basePath = import.meta.env.BASE_URL.replace(/\/$/, ''); -const streamPath = `${basePath}/video/${encodeURIComponent(video.name)}/stream`; -const streamUrl = new URL(streamPath, Astro.url); +const streamPath = `${BASE_PATH}/video/${encodeURIComponent(video.name)}/stream`; --- - + - - {streamUrl.href.startsWith('https://') && } + {width && } {height && }