AMBIENT MODE GLOW FOR HTML VIDEO Let the <video/> light the page.
videolighting reads the colors along a video's edges, on every frame, and turns them into a glow, an ambient background or a themed interface.
This video runs on Video.js 10.
- React or plain JS, one call per effect
- Every frame read, off the main thread
- 3.8 ms on Chrome, 4K, measured
We read the edges.
We don't copy the picture.
YouTube's ambient mode blurs a copy of the frame behind the player, and an Ambilight TV lights the wall from the edges of the screen. videolighting does the second, in the browser: one color per edge zone, read on every frame.
12 zones on the long sides, 7 on the short ones: the same size everywhere, read on every frame.
Install it, pick an effect, done.
Add an ambient glow to an HTML video in a few lines. Halo lights the edges of the player, Ambient the page background, Theme the colors of your interface, and useColors hands you the raw colors. One read of the video is shared by every effect, and each one is a React component and a plain JavaScript function.
Works on any video your page can read: same-origin, or served with CORS headers.
Install
No dependencies. Works with any bundler, or without one.
Pick an effect
Each effect lights a different part of your page, and comes in two variants: "vibrant", the default, plays the video's strongest colors with their saturation pushed; "natural" keeps the video's own colors, drawn softly. These previews run on the real plugin, driven by the video above.
It measures your browser instead of guessing.
Browsers and machines disagree about what is fastest: reading a frame on the GPU wins on one, on the CPU on another, and a laptop under load is not the machine it was a minute ago. So videolighting tests, decides, and checks again, for as long as the video plays.
- 01
Measure
The same frames read both ways, through the GPU (WebGL) and the CPU (canvas), inside a worker.
- 02
Pick
Keep the faster path, only when it wins clearly, so it does not flip-flop between two near-equal paths.
- 03
Watch
Re-check when the machine slows down or speeds up, when the picture changes size, and on a timer. Then measure again.
No browser sniffing and no hard-coded list, so nothing goes stale when a browser updates. Where workers are not available, videolighting falls back to the main thread.
From the frame to the colors, in a few milliseconds.
Bars share one scale: 12 ms = full width. Median latency, measured on 2026-11-20 on a MacBook Pro (Apple M1 Pro, macOS 27.0.1) with Chrome 157 and the Firefox and WebKit builds of Playwright, and on 2026-11-21 on an iPhone 16e (Safari 27.2). Method and full table.
Off the main thread
Frames are handed to a worker, so scrolling and input stay smooth.
Every frame
Each presented frame is read: 25 out of 25 per second on a 1080p video, in our end-to-end tests on Chrome, Firefox and WebKit.
Before you add it to your player.
How is it different from YouTube's ambient mode?
YouTube's ambient mode blurs a copy of the frame behind the player. videolighting reads one color per zone along the video's edges, in a worker, and hands them to you: a glow around the player, an ambient background, or CSS variables for your interface.
Does it work with YouTube or Vimeo embeds?
No. videolighting reads the pixels of a <video> element, and a browser does not let a page read inside an iframe from another site. It works with video you host, MP4 or HLS. DRM-protected video is not supported either.
Why is the glow blank on my video?
The browser must be allowed to read the pixels: same origin, or CORS headers plus crossorigin="anonymous" on the <video>. Pass onError to be told when reading is refused.
Does it work with Video.js?
Yes, this page runs on Video.js 10. Wrap the player in <Halo>, or call halo(element) on the element that contains it: videolighting finds the <video> inside. It only needs that element, so another player that exposes it should work; Video.js 10 is the one we have tested so far.
Do I need React?
No. Each effect is a plain JavaScript function: halo(video), ambient(video), theme(video) and watch(video). The React components live in videolighting/react (React 18 or later, React 19 tested).
Will it slow my page down?
The reading runs in a worker, off the main thread, and the engine picks the faster of GPU and CPU for each browser. See the measured figures above.