Skip to content

Standalone JavaScript for fluid YouTube/Vimeo iframe embeds. Add more custom/responsive players easily.

Notifications You must be signed in to change notification settings

dt10111/fluidvids

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FluidVids.js Build Status

FluidVids is a raw JavaScript solution for responsive and fluid YouTube and Vimeo video embeds. It's extremely lightweight, and comes with a minified version for production environments. FluidVids comes preconfigured to make YouTube and Vimeo videos fluid, but you can add more as you please. You don't need to call FluidVids, it will just work its magic on video embeds automatically.

Demo

Check out a demo of FluidVids.

Options

Add the script just before the closing </body> tag, and initialise the module:

<body>
  <!-- html content above -->
  <script src="dist/fluidvids.js"></script>
  <script>
  Fluidvids.init({
    selector: 'iframe',
    players: ['www.youtube.com', 'player.vimeo.com']
  });
  </script>
</body>

selector

Type: String Default: iframe

Give your fluidvids a custom selector if needed, this selector will be passed into a querySelectorAll().

players

Type: Array Default: ['www.youtube.com', 'player.vimeo.com']

To add more players, specify the domains that you need FluidVids to check against, be sure to include the subdomain for any videos that have a src with a subdomain.

Installing with Bower

To install FluidVids into your project using Bower, use the GitHub repository hook:

bower install https://github.com/toddmotto/fluidvids.git

Scaffolding

Project files and folder structure.

├── dist/
│   ├── fluidvids.js
│   └── fluidvids.min.js
├── src/
│   └── fluidvids.js
├── .editorconfig
├── .gitignore
├── .jshintrc
├── .travis.yml
├── Gruntfile.js
├── config.json
└── package.json

License

MIT license

About

Standalone JavaScript for fluid YouTube/Vimeo iframe embeds. Add more custom/responsive players easily.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published