r/reactjs • u/digital-goat • 13h ago
Show /r/reactjs I built a sci-fi HUD video player for React
https://astro.digitalgoat.space/I've been working on ASTRO, an open-source video player skin for React, built on Video.js v10.
The look is a game-style visor HUD: controls sit on curved rails at the edges and fade out while you watch. Under the hood I tried to keep it a normal, practical player: full keyboard support, ARIA labels, prefers-reduced-motion, and HLS with real quality switching.
A few things I had fun building:
- Time Warp: → doesn't jump 10 s. It plays the next 10 s at 10× and lands without a loading pause.
- Reverse Warp: ← plays the last 10 s backwards, using frames the player has already shown (requestVideoFrameCallback + OffscreenCanvas, with WebCodecs to fill gaps).
- Mini player: a draggable corner window that keeps playing while you scroll.
- Container queries: the layout follows the player's own size, not the viewport.
Usage is just:
tsx
<AstroPlayer media={{ id: 'intro', src: '/media/intro.m3u8' }} />MIT licensed. Repo: [Astro-player] · Demo: [astro.digitalgoat.space]
I'd really like feedback on the API and on how it feels to use. What would stop you from putting it in a real project?
2
u/AshutoshKS 10h ago
Looks cool, I'll give you that
1
u/Some-Kitchen8332 2h ago
playing the skip at 10x instead of jumping is a nice change. running it backwards from frames already on screen is the part i haven't seen in a player skin.