The modern web is fully responsive and more designers are realizing this every day. But there’s one pesky challenge when it comes to responsive design: embedded content.
Every video site from YouTube to Vimeo has a default embed code fixed to a certain size. This means developers need to use other solutions to create fully responsive videos.
This plugin solves two problems at once. All embedded videos will stretch to fill the main container, while also being flexible enough to resize based on the browser window.
The best part is that SuperEmbed.js requires no extra code, so you can just embed the files and let them run. This JS library takes care of the rest by targeting embedded elements from certain sites.
All videos maintain their specific aspect ratios, so you don’t need to worry about wonky dimensions. And SuperEmbed works as a vanilla JS library with no dependencies such as jQuery.
Right now, SuperEmbed supports 15+ video embeds from sites such as YouTube, Vimeo, Kickstarter, DailyMotion, Facebook, Vid.me, and Archive.org (among many others). This list is still growing, so expect more video streaming services to be added over time.
To get this tool working, you just need to download the library and add it to your site’s header like so:
You can download a fully copy from the GitHub repo which also includes specs for supported video sites and current browser support.
For the most part, SuperEmbed supports all modern browsers from FireFox 3.5+, Chrome 4+, and versions of Internet Explorer 9 or higher.