Skip to content

armgit / Cap

Public Imported from GitHub
0

Open source Loom alternative. Beautiful, shareable screen recordings.

Use mp4 links for social embeds (#555)

Richie McIlroydfd4e230b97a
diff --git a/apps/web/app/s/[videoId]/page.tsx b/apps/web/app/s/[videoId]/page.tsx
index ae3b9a6a6..0029893df 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(),
+ ],
},
};
}