jQuery Plugin to Make Embed Video Responsive – Fluidify

jQuery Plugin to Make Embed Video Responsive - Fluidify
Code Snippet:Fluidify
Author: Chris Hammond
Published: January 17, 2024
Last Updated: January 22, 2024
Downloads: 1,941
License: MIT
Edit Code online: View on CodePen
Read More

Here is a cross-browser, cross-platform plugin for jQuery to make iframe based (i.e YouTube, Vimeo & DailyMotion) embed videos responsive. Fluidify is a jQuery plugin to make embed video responsive. It gets the available device screen size and resizes the video iframe according to it.

How to Make Embed Video Responsive

1. Embed a YouTube video in your HTML document with the following div wrapper.

<div class="video-container" style="max-width: 800px; margin: 80px auto;">
        <iframe width="560" height="315" src="https://www.youtube.com/embed/732wAf4ExYk" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
</div>

2. Load the jQuery and Fluidify‘s JavaScript file into your HTML document to make your embedded video responsive.

<!-- jQuery -->
<script src="https://code.jquery.com/jquery-3.4.1.min.js"></script>

<!-- Fluidify Js -->
<script src="dist/fluidify.js"></script>
The jQuery plugin to make embed video responsive will auto initialized after loading on your page.

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.

About CodeHim

Free Web Design Code & Scripts - CodeHim is one of the BEST developer websites that provide web designers and developers with a simple way to preview and download a variety of free code & scripts. All codes published on CodeHim are open source, distributed under OSD-compliant license which grants all the rights to use, study, change and share the software in modified and unmodified form. Before publishing, we test and review each code snippet to avoid errors, but we cannot warrant the full correctness of all content. All trademarks, trade names, logos, and icons are the property of their respective owners... find out more...

Please Rel0ad/PressF5 this page if you can't click the download/preview link

X