FitVids.js is a lightweight jQuery plugin for making embedded videos scale fluidly inside responsive layouts. It automates the intrinsic-ratio technique so video players preserve their aspect ratio while adapting to the width of their container. The plugin wraps supported embeds in a responsive element and handles sizing through percentage-based CSS after initialization. Native support includes services such as YouTube and Vimeo, along with several older video platforms. Developers can add other providers through a custom selector when their markup is compatible. FitVids requires jQuery 1.7 or later and is designed to solve one focused responsive-design problem with minimal code. It became a widely used early solution for responsive video embeds before native aspect-ratio CSS became common.
Features
- Responsive fluid-width video embeds
- Automatic aspect-ratio preservation
- YouTube and Vimeo support
- Custom video provider selectors
- Percentage-based responsive CSS output
- Simple jQuery initialization