September 16, 2014

Auto-play and muted YouTube Video Background

I needed a reliable way to use video as a background element, and HTML5 video requires too much up front work. For instance, you have to edit a base mp4, and convert it to atleast 2 other types (WebM and OGG) for proper browser support. Obviously, uploading a video to YouTube makes that so much easier, as they deal with the browser support part of things for us. Using this script makes things so much easier, just replace the Playlist and videoId variables, and you’re set, the YouTube API does the rest.

Menu