This commit is contained in:
1 parent
80fde5a94b
commit
e5e26222ce
2 files changed
+7
-32
No files matched your search
@@ -12,26 +12,17 @@ if (!video) return new Response(null, { status: 404 });
|
||||
const metadata = await getVideoMetadata(video);
|
||||
if (!metadata) return new Response(null, { status: 404 });
|
||||
|
||||
const { title, description, width, height, duration } = metadata;
|
||||
const { title, description } = metadata;
|
||||
const streamUrl = siteUrl(`video/${encodeURIComponent(video.name)}/stream`);
|
||||
const thumbnailUrl = siteUrl(`video/${encodeURIComponent(video.name)}/thumbnail.jpg`);
|
||||
const thumbnailWidth = 1280;
|
||||
const thumbnailHeight = width && Math.round((height / width) * thumbnailWidth);
|
||||
---
|
||||
|
||||
<WebsiteLayout title={`${title} - Video`} description={description ?? undefined} openGraph="minimal">
|
||||
<Fragment slot="head">
|
||||
<meta property="og:type" content="video.other" />
|
||||
<meta property="og:type" content="website" />
|
||||
<meta property="og:image" content={thumbnailUrl} />
|
||||
<meta property="og:image:type" content="image/jpeg" />
|
||||
<meta property="og:image:width" content={thumbnailWidth.toString()} />
|
||||
<meta property="og:image:height" content={thumbnailHeight.toString()} />
|
||||
<meta property="og:video" content={streamUrl} />
|
||||
{streamUrl.startsWith('https') && <meta property="og:video:secure_url" content={streamUrl} />}
|
||||
<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()} />}
|
||||
{duration && <meta property="og:video:duration" content={duration.toString()} />}
|
||||
<meta property="og:image:alt" content={title} />
|
||||
</Fragment>
|
||||
|
||||
<section class="mx-auto flex w-full max-w-6xl flex-col gap-5 px-4 py-8 lg:py-12">
|
||||
|
||||
Reference in new issue
Block a user