Introducing instant-video

An open-source hover player for the web. With a mouse, the first frame is decoded before the pointer arrives. Hold and drag to scrub, and click to keep watching in the full player.

Hover to play, hold and drag to scrub, click to openTap to open the player

L’Arroseur arrosé, Lumière, 1895. Public domain, and the first prank on film. Source on Wikimedia Commons

Hover. Scrub. Open.

Three gestures on one thumbnail, and no loading state between them.

Decoded early

Warmed cards are ready before you hover.

Predicts the pointer

With a mouse, warms the card you’re heading to.

Hold to scrub

Press and drag through the clip.

Click to open

Keeps playing in the full player.

40 KB warm-up

The encoder budgets each video head for fast starts.

Works on any host

Upload static, content-addressed files anywhere.

Adapts to the network

Slow links get smaller video; data saver gets a poster.

Full player included

Quality, captions, PiP and fullscreen. No runtime deps.

One command. Any host.

Point the encoder at a folder of videos and upload what comes out. No storage account needed.

# encode a folder into your static files
npx instant-video encode ./clips --out ./public/media --base-url /media

// drop it on any card
import { InstantVideoElement, type InstantSource } from 'instant-video'

const card = document.querySelector('.card')
const el = card?.querySelector('instant-video')
if (!card || !(el instanceof InstantVideoElement)) throw new Error('missing card')

el.source = await fetch('/media/clip.json').then((r) => r.json()) as InstantSource
card.onpointerenter = () => { el.active = true }
card.onpointerleave = () => { el.active = false }

Or let your agent do it.

Paste this into your coding agent. It reads the skill, encodes your clips and wires the cards.

Add instant-video hover previews to this project.

1. Read the skill first: https://github.com/max-pantom/instant-video/blob/main/.agents/skills/instant-video/SKILL.md
2. Install it: npm i github:max-pantom/instant-video (the encoder needs ffmpeg with libx264 and libsvtav1)
3. Encode my clips: npx instant-video encode ./clips --out ./public/media --base-url /media (adjust the paths)
4. Put <instant-video> on my video cards: poster from the manifest, play on hover, click opens the player.

Then check it in the running page.

Make your next hover instant.

Star on GitHub