Skip to content

Instantly share code, notes, and snippets.

@brutaldesign
Last active December 6, 2017 21:42
Show Gist options
  • Save brutaldesign/9774304 to your computer and use it in GitHub Desktop.
Save brutaldesign/9774304 to your computer and use it in GitHub Desktop.
Fluid Video JS
jQuery( function( $ ) {
var videoSelectors = [
'iframe[src*="player.vimeo.com"]',
'iframe[src*="youtube.com"]',
'iframe[src*="youtube-nocookie.com"]',
'iframe[src*="kickstarter.com"][src*="video.html"]',
'iframe[src*="screenr.com"]',
'iframe[src*="blip.tv"]',
'iframe[src*="dailymotion.com"]',
'iframe[src*="viddler.com"]',
'iframe[src*="qik.com"]',
'iframe[src*="revision3.com"]',
'iframe[src*="hulu.com"]',
'iframe[src*="funnyordie.com"]',
'iframe[src*="flickr.com"]',
'embed[src*="v.wordpress.com"]'
// add more selectors here
];
var allVideos = videoSelectors.join( ',' );
$( allVideos ).wrap( '<span class="fluid-video" />' ); // wrap them all!
} ) ;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment