Embed html videos with correct background color.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


Matching HTML5 videos to a background color

This is an example on how to handle the color derivation bug concerning html5 videos that should be inserted seamlessly into a website. I use this mostly for big videos that integrate into the landing page. The full explanation on how it works can be read here.

drivation bug Live Demo here

Basically it renders the video onto a canvas and keeps it in sync with the hidden video. Simultaneously it picks up the background color of the video frame and adjusts the websites color.

The original solution comes from Feng. I added retina support and a fallback for browsers with blocked autoplay (thanks safari mobile).

Feel free to improve :)