New Post has been published on Html Use
New Post has been published on http://www.htmluse.com/vide-video-backgrounds/
Vide - Video backgrounds
Download Demo
Vide is a easy as hell jQuery plugin for video backgrounds. Minified version size: ~3.6kb
Notes
All modern desktop browsers are supported.
IE9+
iOS plays video from browser only in the native player. So video for iOS is disabled, only fullscreen poster will be.
Some android devices plays video, some — no, go figure. So video for android is disabled, only fullscreen poster will be.
1. INCLUDE JS FILES
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> <script src="../src/jquery.vide.js"></script>
2. HTML
<div id="block" data-vide-bg="video/ocean" data-vide-options="position: 0% 50%"></div>
Prepare your video in several formats like ‘.webm’, ‘.mp4′ for cross browser compability, also add a poster image:
Add data-vide-bg attribute with a path to the video and poster without extension, video and poster must have the same name. Add data-vide-options to pass vide options, if you need it. By default video is muted, looped and starts automaticly.
Or you can initialize it with JS, in some situations it can be helpful, because Vide doesn’t have mutation observers, they are on you own:
$("#block").vide("path/to/video"); $("#block").vide("path/to/video", ...options... );
3. OPTIONS
Below a complete list of options and matching default values:
$("#yourElement").vide( volume: 1, playbackRate: 1, muted: true, loop: true, autoplay: true, position: "50% 50%" // Alignment );
4. METHODS
Below a complete list of medhods:
// Get instance of the plugin var instance = $("#yourElement").data("vide"); // Get video element of the background. Do what you want. instance.getVideoObject(); // Resize video background. // It calls automatically, if window resize (or element, if you will use something like https://github.com/cowboy/jquery-resize). instance.resize(); // Destroy plugin instance instance.destroy();















