Chroma: A Video.js Player That Adapts Its UI to Each SceneChroma: A Video.js Player That Adapts Its UI to Each Scene
The network for creativity
Join 1.25M professional creatives like you
Connect with clients, get discovered, and run your business 100% commission-free
Creatives on Contra have earned over $150M and we are just getting started
Chroma: the skin is the film. Almost every video player picks one accent colour and hopes it works over whatever plays. Chroma doesn't pick. About once a second it samples a 24x24 copy of the current frame, bins the colours by hue, ignores greys, blacks and blown highlights, and takes the scene's dominant colour. Then it repaints the seek fill, playhead, tally lower-third, running timecode, volume meter, active menu row, focus ring and the glow around the player to match. A sunset scene gets a warm amber player, a rainy neon street gets blue. The tricky part is readability, so there's a contrast guard. Before any colour is used, it's lightened until it hits 7:1 against black. Black text on it and it on black both pass WCAG AA no matter what the footage does. Colour eases over about a second so hard cuts don't flash, and with reduced motion on it changes in one step and never animates. Under the colour sits a flat broadcast layout: a ruler seek bar, on-air timecode, title-safe marks, 40 to 44px targets and full keyboard control with Esc to close menus. Built on Video.js v10 (HTML + CSS from the Scaffold skin) plus one small script that only writes CSS custom properties, so the skin still works if the frame can't be read. It plays my own videos hosted on Mux. Switch feeds on the page to watch it re-theme.
Post image
Denis's avatar
Sampling the frame by hue and ignoring greys and blown highlights, so the skin is the film. Great approach.
Back to feed
The network for creativity
Join 1.25M professional creatives like you
Connect with clients, get discovered, and run your business 100% commission-free
Creatives on Contra have earned over $150M and we are just getting started