Skip to content

Show a frame of the video when a share link is pasted - #32

Open
pallaoro wants to merge 4 commits into
mainfrom
share-preview-image
Open

pallaoro wants to merge 4 commits into
mainfrom
share-preview-image

Conversation

@pallaoro

@pallaoro pallaoro commented Oct 7, 2026

Copy link
Copy Markdown
Member

A share link pasted into Slack, WhatsApp, iMessage, LinkedIn or X now unfurls with a still from the video instead of a bare title. The share page's player also shows that still before it plays.

  • Every export asks the edit service for a poster: the output's middle frame, cut from the finished MP4, so it shows what viewers will see (crop, text and fades included). It is kept beside the render (renders/<name>.jpg) and served at /s/<token>/poster.jpg, with the same pin rule as the video. A stale v gets a 404, and turning the link off ends it.
  • The share page carries og:image (absolute, as unfurlers require), og:image:type, og:image:alt and twitter:card=summary_large_image, but only when the export has a poster. Exports made before this, or on a service without posters, keep today's page.
  • The poster is best-effort. A failed copy never fails an export.
  • Deleting a project removes each export's poster along with its render.

Needs the edit-service half deployed before posters appear. Until then the field is ignored and nothing changes, so the merge order doesn't matter.

Checked: tsc, vitest (89 tests, including new ones for the meta tags and the poster key) and vite build. Locally under wrangler dev against a mock edit service, three cases: an export with a poster (the share page has the tags, the poster is served byte-identical, a stale v gets 404, HEAD gets 200, and deleting the project removes both objects); an export without a poster (no tags, poster route 404, video 200); and a poster URL that fails to download (export still completes, no tags).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant