show video thumbnail on link
This commit is contained in:
parent
24389ee0a7
commit
20fef9d176
2 changed files with 13 additions and 1 deletions
|
|
@ -86,6 +86,10 @@ const VideoList: NextPage = () => {
|
||||||
<title>
|
<title>
|
||||||
{video?.title ?? "Snapify | The Open Source Loom Alternative"}
|
{video?.title ?? "Snapify | The Open Source Loom Alternative"}
|
||||||
</title>
|
</title>
|
||||||
|
<meta property="og:image" content={video?.thumbnailUrl} />
|
||||||
|
<meta property="og:image:type" content="image/png" />
|
||||||
|
<meta property="og:image:width" content="1200" />
|
||||||
|
<meta property="og:image:height" content="600" />
|
||||||
<meta
|
<meta
|
||||||
name="description"
|
name="description"
|
||||||
content="Share high-quality videos asynchronously and collaborate on your own schedule"
|
content="Share high-quality videos asynchronously and collaborate on your own schedule"
|
||||||
|
|
|
||||||
|
|
@ -93,7 +93,15 @@ export const videoRouter = createTRPCRouter({
|
||||||
|
|
||||||
const signedUrl = await getSignedUrl(s3, getObjectCommand);
|
const signedUrl = await getSignedUrl(s3, getObjectCommand);
|
||||||
|
|
||||||
return { ...video, video_url: signedUrl };
|
const thumbnailUrl = await getSignedUrl(
|
||||||
|
s3,
|
||||||
|
new GetObjectCommand({
|
||||||
|
Bucket: env.AWS_BUCKET_NAME,
|
||||||
|
Key: video.userId + "/" + video.id + "-thumbnail",
|
||||||
|
})
|
||||||
|
);
|
||||||
|
|
||||||
|
return { ...video, video_url: signedUrl, thumbnailUrl };
|
||||||
}),
|
}),
|
||||||
getUploadUrl: protectedProcedure
|
getUploadUrl: protectedProcedure
|
||||||
.input(z.object({ key: z.string() }))
|
.input(z.object({ key: z.string() }))
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue