1 parent
30c76a10ab
commit
45b5af9254
2 files changed
+6
-8
No files matched your search
@@ -28,9 +28,9 @@ const { title, description, keywords, openGraph, viewTransition } = Astro.props;
|
|||||||
<>
|
<>
|
||||||
<meta property="og:title" content={title} />
|
<meta property="og:title" content={title} />
|
||||||
{description && <meta property="og:description" content={description} />}
|
{description && <meta property="og:description" content={description} />}
|
||||||
<meta property="og:url" content={Astro.url.href} />
|
<meta property="og:url" content={Astro.url.pathname} />
|
||||||
<meta property="og:type" content="website" />
|
<meta property="og:type" content="website" />
|
||||||
<meta property="og:image" content={new URL(logo512.src, Astro.url).href} />
|
<meta property="og:image" content={logo512.src} />
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
<slot name="head" />
|
<slot name="head" />
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
import WebsiteLayout from '@layouts/website/WebsiteLayout.astro';
|
import WebsiteLayout from '@layouts/website/WebsiteLayout.astro';
|
||||||
import VideoPlayer from '@app/website/video/VideoPlayer.svelte';
|
import VideoPlayer from '@app/website/video/VideoPlayer.svelte';
|
||||||
import { getVideoMetadata, resolveVideo } from '@util/video.ts';
|
import { getVideoMetadata, resolveVideo } from '@util/video.ts';
|
||||||
|
import { BASE_PATH } from 'astro:env/server';
|
||||||
|
|
||||||
const { name } = Astro.params;
|
const { name } = Astro.params;
|
||||||
|
|
||||||
@@ -12,16 +13,13 @@ const metadata = await getVideoMetadata(video);
|
|||||||
if (!metadata) return new Response(null, { status: 404 });
|
if (!metadata) return new Response(null, { status: 404 });
|
||||||
|
|
||||||
const { title, description, width, height, duration } = metadata;
|
const { title, description, width, height, duration } = metadata;
|
||||||
const basePath = import.meta.env.BASE_URL.replace(/\/$/, '');
|
const streamPath = `${BASE_PATH}/video/${encodeURIComponent(video.name)}/stream`;
|
||||||
const streamPath = `${basePath}/video/${encodeURIComponent(video.name)}/stream`;
|
|
||||||
const streamUrl = new URL(streamPath, Astro.url);
|
|
||||||
---
|
---
|
||||||
|
|
||||||
<WebsiteLayout title={`${title} – Video`} description={description ?? undefined}>
|
<WebsiteLayout title={`${title} - Video`} description={description ?? undefined}>
|
||||||
<Fragment slot="head">
|
<Fragment slot="head">
|
||||||
<meta property="og:type" content="video" />
|
<meta property="og:type" content="video" />
|
||||||
<meta property="og:video" content={streamUrl.href} />
|
<meta property="og:video" content={streamPath} />
|
||||||
{streamUrl.href.startsWith('https://') && <meta property="og:video:secure_url" content={streamUrl.href} />}
|
|
||||||
<meta property="og:video:type" content={video.contentType} />
|
<meta property="og:video:type" content={video.contentType} />
|
||||||
{width && <meta property="og:video:width" content={width.toString()} />}
|
{width && <meta property="og:video:width" content={width.toString()} />}
|
||||||
{height && <meta property="og:video:height" content={height.toString()} />}
|
{height && <meta property="og:video:height" content={height.toString()} />}
|
||||||
|
|||||||
Reference in new issue
Block a user