Skip to content

Latest commit

 

History

History
11 lines (7 loc) · 972 Bytes

README.md

File metadata and controls

11 lines (7 loc) · 972 Bytes

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 :)