Skip to content

Instantly share code, notes, and snippets.

@DaveVoyles
Created May 29, 2015 15:59
Show Gist options
  • Save DaveVoyles/59df1832a959ea1cb950 to your computer and use it in GitHub Desktop.
Save DaveVoyles/59df1832a959ea1cb950 to your computer and use it in GitHub Desktop.
Change CSS filters on video
// changeCssFiltersOnVid() - Cycle through CSS filters applied to the video stream
// 1. Grab a reference to the video tag
// 2. Keep the original CSS classes while still adding the filters
// 3. Loop through all of the filters
var changeCssFilterOnVid = function () {
var el = document.getElementById('videoTag');
el.className = 'view--video__video';
var effect = filters[index++ % filters.length]
if (effect) {
el.classList.add(effect);
console.log(el.classList);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment