Moving link previews for my sites with og:video

When you share a link to one of my sites, the preview plays a short video. This page shows how the og:video tag does this.

2 min readworklog

TIL about the og:video Open Graph tag. With it, a link preview can play a short video. I added it to my sites. Now, when I share a link to one of my sites, the preview shows a short video with no sound.

Live demo

This is a mockup of a Messages chat. Scroll the chat to see all the cards. Each card plays the real video from that site.

The resume card uses these tags on resume.rr2.dev:

<meta property="og:image" content="https://resume.rr2.dev/og.png"> <meta property="og:video" content="https://resume.rr2.dev/og-video.mp4"> <meta property="og:video:type" content="video/mp4"> <meta property="og:video:width" content="1280"> <meta property="og:video:height" content="720">

To test a preview, send a URL such as https://rr2.dev/?v=1 in a chat. The ?v=1 part stops the app from using an old preview.

Apps that play the video

Each site has an og:video tag for the chat apps. Each site also has an og:image tag for all other apps.

How I made the videos

All videos are 1280×720 and have no sound. The sizes are from 132 KB (rr2.dev) to 3.3 MB (Reading Room).