From a111ab0c9cc1ef029659e54b6c23dba1d34c2aa3 Mon Sep 17 00:00:00 2001 From: Richie McIlroy <33632126+richiemcilroy@users.noreply.github.com> Date: Mon, 19 May 2025 17:09:17 +0100 Subject: [PATCH] Use mp4 links for social embeds --- apps/web/app/s/[videoId]/page.tsx | 58 +++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) diff --git a/apps/web/app/s/[videoId]/page.tsx b/apps/web/app/s/[videoId]/page.tsx index ae3b9a6a63f..0029893df16 100644 --- a/apps/web/app/s/[videoId]/page.tsx +++ b/apps/web/app/s/[videoId]/page.tsx @@ -80,6 +80,31 @@ export async function generateMetadata( height: 630, }, ], + videos: [ + { + url: new URL( + `/api/playlist?userId=${video.ownerId}&videoId=${video.id}`, + buildEnv.NEXT_PUBLIC_WEB_URL + ).toString(), + width: 1280, + height: 720, + type: "video/mp4", + }, + ], + }, + twitter: { + card: "player", + player: new URL( + `/s/${videoId}`, + buildEnv.NEXT_PUBLIC_WEB_URL + ).toString(), + playerWidth: 1280, + playerHeight: 720, + playerStream: new URL( + `/api/playlist?userId=${video.ownerId}&videoId=${video.id}`, + buildEnv.NEXT_PUBLIC_WEB_URL + ).toString(), + playerStreamContentType: "video/mp4", }, }; } @@ -98,6 +123,39 @@ export async function generateMetadata( height: 630, }, ], + videos: [ + { + url: new URL( + `/api/playlist?userId=${video.ownerId}&videoId=${video.id}`, + buildEnv.NEXT_PUBLIC_WEB_URL + ).toString(), + width: 1280, + height: 720, + type: "video/mp4", + }, + ], + }, + twitter: { + card: "player", + player: new URL( + `/s/${videoId}`, + buildEnv.NEXT_PUBLIC_WEB_URL + ).toString(), + playerWidth: 1280, + playerHeight: 720, + playerStream: new URL( + `/api/playlist?userId=${video.ownerId}&videoId=${video.id}`, + buildEnv.NEXT_PUBLIC_WEB_URL + ).toString(), + playerStreamContentType: "video/mp4", + title: video.name + " | Cap Recording", + description: "Watch this video on Cap", + images: [ + new URL( + `/api/video/og?videoId=${videoId}`, + buildEnv.NEXT_PUBLIC_WEB_URL + ).toString(), + ], }, }; }