Live Photo
<LivePhoto> works like a Live Photo on iPhone: it shows the photo, and plays the video when you press and hold it or click the badge.
Pair a photo with a short video (usually about 3 seconds). The photo is shown with a Live badge in the top-left corner:
- Press and hold the photo: the video plays from the start, stops when you let go, and fades back to the photo.
- Click the badge: plays the video once; click again to stop. You can also focus the badge with the keyboard and press Enter or Space.
<LivePhoto src="/assets/media/live.jpg" video="/assets/media/live.mp4" alt="A fractal slowly zooming in" />
Take the photo from a frame in the middle of the video so the fade back at the end looks natural. The video loads as the component scrolls near, so it plays the moment you press. If the browser doesn't allow playback with sound, it plays muted.