jQuery Plugin For Fluid Width Youtube Videos - ModernTube

File Size: 5.29 KB
Views Total: 1289
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
   
jQuery Plugin For Fluid Width Youtube Videos - ModernTube

ModernTube is a really simple jQuery plugin for dynamically resizing YouTube iframes to make your embedded Youtube videos responsive across all browsers and devices.

See also:

How to use it:

1. Download and load the jQuery moderntube plugin after you have jQuery library loaded.

<script src="//code.jquery.com/jquery-2.1.4.min.js"></script>
<script src="/path/to/ModernTube.js"></script>

2. Embed an Youtube video iframe into your web page.

<div id="container">
  <iframe width="853" height="480" src="https://www.youtube.com/embed/_0WPQ6oP1aY" frameborder="0" allowfullscreen></iframe>
</div>

3. Call the plugin to automatically adjust the width / height of your Youtube video according to the size of its parent container.

$('#container').moderntube();

This awesome jQuery plugin is developed by midoghrane. For more Advanced Usages, please check the demo page or visit the official website.