1 parent
30c76a10ab
commit
45b5af9254
2 files changed
+6
-8
No files matched your search
@@ -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`;
|
||||
---
|
||||
|
||||
<WebsiteLayout title={`${title} – Video`} description={description ?? undefined}>
|
||||
<WebsiteLayout title={`${title} - Video`} description={description ?? undefined}>
|
||||
<Fragment slot="head">
|
||||
<meta property="og:type" content="video" />
|
||||
<meta property="og:video" content={streamUrl.href} />
|
||||
{streamUrl.href.startsWith('https://') && <meta property="og:video:secure_url" content={streamUrl.href} />}
|
||||
<meta property="og:video" content={streamPath} />
|
||||
<meta property="og:video:type" content={video.contentType} />
|
||||
{width && <meta property="og:video:width" content={width.toString()} />}
|
||||
{height && <meta property="og:video:height" content={height.toString()} />}
|
||||
|
||||
Reference in new issue
Block a user