No longer actively maintained.

Overview

NPM version Bower version Travis Vide

No longer actively maintained. I am not interested to maintain jQuery plugins anymore. If you have some fixes, feel free to make PR.

Easy as hell jQuery plugin for video backgrounds.

Notes

  • All modern desktop browsers are supported.
  • IE9+
  • iOS plays video from a browser only in the native player. So video for iOS is disabled, only fullscreen poster will be used.
  • Some android devices play video, some not — go figure. So video for android is disabled, only fullscreen poster will be used.

Instructions

Download it from GitHub or via Bower: bower install vide

Include plugin: <script src="js/jquery.vide.min.js"></script>

Prepare your video in several formats like '.webm', '.mp4' for cross browser compatibility, also add a poster with .jpg, .png or .gif extension:

path/
├── to/
│   ├── video.mp4
│   ├── video.ogv
│   ├── video.webm
│   └── video.jpg

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 automatically.

<div style="width: 1000px; height: 500px;"
  data-vide-bg="path/to/video" data-vide-options="loop: false, muted: false, position: 0% 0%">
</div>

Also you can set extended path:

<div style="width: 1000px; height: 500px;"
  data-vide-bg="mp4: path/to/video1, webm: path/to/video2, ogv: path/to/video3, poster: path/to/poster"
  data-vide-options="posterType: jpg, loop: false, muted: false, position: 0% 0%">
</div>

In some situations it can be helpful to initialize it with JS because Vide doesn't have mutation observers:

$('#myBlock').vide('path/to/video');
$('#myBlock').vide('path/to/video', {
...options...
});
$('#myBlock').vide({
  mp4: path/to/video1,
  webm: path/to/video2,
  ogv: path/to/video3,
  poster: path/to/poster
}, {
...options...
});
$('#myBlock').vide('extended path as a string', 'options as a string');

Easy as hell.

Options

Below is a complete list of options and matching default values:

{
  volume: 1,
  playbackRate: 1,
  muted: true,
  loop: true,
  autoplay: true,
  position: '50% 50%', // Similar to the CSS `background-position` property.
  posterType: 'detect', // Poster image type. "detect" — auto-detection; "none" — no poster; "jpg", "png", "gif",... - extensions.
  resizing: true, // Auto-resizing, read: https://github.com/VodkaBears/Vide#resizing
  bgColor: 'transparent', // Allow custom background-color for Vide div,
  className: '' // Add custom CSS class to Vide div
}

Methods

Below is a complete list of methods:

// 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();

Resizing

The Vide plugin resizes if the window resizes. If you will use something like https://github.com/cowboy/jquery-resize, it will resize automatically when the container resizes. Or simply use resize() method whenever you need.

Set the resizing option to false to disable auto-resizing.

Encoding video

http://diveintohtml5.info/video.html#miro

Meteor

Install

meteor add vodkabears:vide

Usage

Because of how meteor renders templates reactively you will need to initialize manually for the templates you want to use vide in.

Template.templateName.onRendered(function() {
  this.$('#elementName').vide('fileNameWithoutExtension');
});

Meteor integration by zimme.

Ruby Gem

Vider by Islam Wazery.

License

The MIT License (MIT)

Copyright (c) 2015 Ilya Makarov

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Comments
  • working with meteor?

    working with meteor?

    I'm trying to use this with Meteor and am not getting any video showing up.

    in a video template-- <div id="video"> <div style="width: 500px; height: 500px;" data-vide-bg="woot/warthundervid" data-vide-options="loop: false, muted: false, position: 0% 0%"> </div> </div>

    then ive tried both using this:

    Template.video.onRendered( function() { this.$('#video').vide('woot/warthundervid'); });

    which is whats recommended in the meteor package, and then doing it the "normal" way with just the jquery by itself

    `$( document ).ready(function() {

        $('#video').vide('woot/warthundervid');
    
    });`
    

    havent got either to work yet. Any problems with that code? Do you have any working examples using Meteor?

    question 
    opened by Orbyt 11
  • Android Chrome Background Image Loads Then Disappears

    Android Chrome Background Image Loads Then Disappears

    Hi, first, thanks for the excellent work! I'm having and issues on my Nexus 7 (Android 5.1, Build LMY470) in Google Chrome (42.0.2311.111). The background image seems to load but then it disappears. I'm using the following code. Please let me know if you have any questions and thanks in advance for your help!

    <div id="video-box">
        <div id="header">
            <h1>Headline</h1>
        </div>
        <div id="video-overlay"></div>
        <div id="overlay-text">
            Body Text
        </div>
        <div id="feature-video"></div>
    </div>
    
    $(document).ready(function () {
        jQuery("#overlay-text").fitText(1.5);
        $('#feature-video').vide('/img/header-video',{
            muted: true,
            loop: true,
            autoplay: true,
            resizing: true
        });
    });
    
    #video-box {
        position: relative; 
        #feature-video {
            z-index: 1; 
        }
        #feature-video, #video-box {
            width: 100%; 
            height: 500px;
        }
        #header {
            z-index: 3;
            background: #000000;
            color: #ffffff;
            text-align: center;
            position: absolute;
            top: 0;
            right: 0;
            left: 0;
            height: 80px;
            opacity: .7;
            h1 {
                margin: 0;
                padding: 0;
                font-size: 200%;
                font-weight: normal;
                line-height: 80px;
            }
        }
        #video-overlay {
            z-index: 2;
            position: absolute;
            top: 80px;
            right: 0;
            bottom: 0;
            left: 0;
            background: url(/img/pattern.png);
            opacity: 1;
        }
        #overlay-text {
            z-index: 4;
            position: absolute;
            top: 80px;
            right: 0;
            bottom: 0;
            left: 0;
            color: #2bb4b2;
            line-height: 100%;
            text-align: center;
            margin-top: 125px;
            text-shadow: 0 0 10px #ffffff, 0 0 10px #ffffff, 0 0 10px #ffffff;
        }
    }
    
    bug help wanted 
    opened by tomvonpcc 11
  • Toggle Audio

    Toggle Audio

    Hello,

    I am trying to create an audio toggle button for my background video using your plugin. Using methods such as

    .prop('muted', true)
    

    and

    .setVolume(0);
    

    and

    .mute();
    

    via an onclick function but no joy. Any suggestions to help me along the way?

    question 
    opened by NathanKTC 11
  • There is some bug with detect some type of file.

    There is some bug with detect some type of file.

    When I want to use video background and I didn't upload some type of file ( .jpg, .png ,....) . There is some bug notification on browser dedug. Please help me. Thanks you ! Jack Bui

    question 
    opened by jackbui 10
  • findPoster throwing 'file not found' on all image extensions that aren't available.

    findPoster throwing 'file not found' on all image extensions that aren't available.

    Typically you'd only need one type of fallback image, so you'd never need to load multiple formats (plus it's unlikely anyone would save out multiple background formats for the same poster image).

    Ideally you'd want to pull whatever poster image source format is specified and load only that one, regardless of the extension, so Vide doesn't try to find and load images that don't exist.

    enhancement 
    opened by MindSculpt 9
  • Push video in local storage

    Push video in local storage

    Is there anyway to make the video that is requested to use localstorage? I've notice that if the video is set to loop that it will continually make a request to the server and keep loading the video over and over again which can stack up over time.

    question 
    opened by ghost 8
  • Video eventually dies in glorious fashion

    Video eventually dies in glorious fashion

    Not sure if this is an encoding issue on my side or if this is a plugin issue, but eventually, a video looping will end up in an explosion of pastel digital coolness (except, that's not what the client ordered ;) )

    screen_shot_2015-07-07_at_4 35 36_pm

    Live at: www.cargosense.com

    question 
    opened by jathayde 6
  • z-index issue

    z-index issue

    The first div created by the plugin that has z-index: -1 seems to be causing an issue for me. If I change the z-index to zero then the video shows, but if I leave it at negative one then the video is completely hidden.

    There is nothing in the div aside from the code being written by the plugin to display the video.

    Thoughts?

    question 
    opened by andywarren 6
  • webkit-playsinline

    webkit-playsinline

    iOS 10 supports webkit-playsinline. Videos can be played inline and videos with no sound or sound disabled can autoplay. No need to disable video in iOS anymore.

    opened by dimisdas 5
  • Full height video for page

    Full height video for page

    How do I detect screen size and set height to 100% if position: relative is set?

    I'm using bootstrap

    <div class="row">
      <div id="video" data-vide-bg="assets/video">
     </div>
    </div>
    

    the following doesn't help, because position is relative

    #video {
      background-size: cover;
      height: 100%;
    }
    
    
    question 
    opened by rstormsf 5
  • 404 issues

    404 issues

    I specify my posterType, but I still get 404s for all the other types.

    $('.topHeader').vide({
          mp4: 'headerResources/light.mp4',
          poster: 'headerResources/light.jpg',
          posterType: 'jpg'
        });
    
    GET http://localhost:9000/headerResources/light.gif 404 (Not Found)
    GET http://localhost:9000/headerResources/light.jpeg 404 (Not Found)
    GET http://localhost:9000/headerResources/light.png 404 (Not Found)
    

    Can you make it stop looking for other ones, when the poster is defined please?

    question 
    opened by rwwagner90 5
  • Can't autoplay video with sound in Chrome

    Can't autoplay video with sound in Chrome

    $('#bgv').vide({mp4:'/public/static/video/xxx.mp4'},{ muted: true, loop: false, autoplay: true }); If I set 'muted: false', video will not autoplay. I knew since Chrome 66, Google not allowed autoplay video with sound. But can VIDE slove this problem?

    opened by 1vanLuo 2
Releases(0.5.1)
A Mattermost Plugin which actively listens (and prohibits) for language with racist, ableist, sexist, or other exclusionary histories

Mattermost Gender Inclusive Language Plugin The gender-inclusive-language is a Mattermost Plugin which actively listens (and prohibits) for language w

Ademílson F. Tonato 2 Jun 22, 2022
Marquee is a VS Code extension designed to naturally integrate with your development flow, so that you will no longer lose track of your thoughts while you're coding

Marquee Stay organized with minimal context switching, all inside your Visual Studio Code. Marquee is a VS Code extension designed to naturally integr

stateful 60 Dec 13, 2022
"Longer in Twitter" est une extension Chrome affichant les TwitLonger directement dans un tweet.

Longer in Twitter "Longer in Twitter" est une extension Chrome affichant les TwitLonger directement dans un tweet. Installation Longer in Twitter ne f

Johan le stickman 4 Sep 22, 2022
CloudSecWiki is a cloud security oriented knowledge base maintained by HuoCorp.

CloudSecWiki CloudSecWiki is a cloud security oriented knowledge base maintained by HuoCorp. CloudSecWiki web address:cloudsec.huoxian.cn Local Deploy

HuoCorp 26 Dec 4, 2022
🚌 • community maintained APIs for Poland's public transport

?? Poland's Public Transport API Simple, open and community-maintained REST API you can use in your project limitlessly. ?? Let's talk · ?? Contribute

Jan Szymański 17 Dec 24, 2022
This repository is exclusive to javascript bootcamp, organized at GDSC TIU. Maintained by Gourav Ghosal

JAVASCRIPT BOOTCAMP This repository is exclusive to javascript bootcamp, organized at GDSC TIU. An introductory resource by Gourav Ghosal, Chapter Lea

DSC TIU 15 Nov 26, 2022
No longer actively maintained.

Vide No longer actively maintained. I am not interested to maintain jQuery plugins anymore. If you have some fixes, feel free to make PR. Easy as hell

Ilya Caulfield 3.3k Dec 20, 2022
No longer actively maintained.

Remodal No longer actively maintained. I am not interested to maintain jQuery plugins anymore. If you have some fixes, feel free to make PR. Responsiv

Ilya Caulfield 2.8k Dec 11, 2022
Easy-to-use , actively maintained discord bot written in dJS V13 with customizable features

Multi-purpose discord bot Found a bug? Notes There are some modules missing, you can still start the bot but there are some things within the source t

locus 7 Nov 28, 2022
A JSON polyfill. No longer maintained.

?? Unmaintained ?? JSON 3 is **deprecated** and **no longer maintained**. Please don't use it in new projects, and migrate existing projects to use th

BestieJS Modules 1k Dec 24, 2022
⚠️ [Deprecated] No longer maintained, please use https://github.com/fengyuanchen/jquery-cropper

Cropper A simple jQuery image cropping plugin. As of v4.0.0, the core code of Cropper is replaced with Cropper.js. Demo Cropper.js - JavaScript image

Fengyuan Chen 7.8k Dec 27, 2022
No longer maintained, superseded by JS Cookie:

IMPORTANT! This project was moved to https://github.com/js-cookie/js-cookie, check the discussion. New issues should be opened at https://github.com/j

Klaus Hartl 8.6k Jan 5, 2023
⚠️ [Deprecated] No longer maintained, please use https://github.com/fengyuanchen/jquery-viewer

Viewer A simple jQuery image viewing plugin. As of v1.0.0, the core code of Viewer is replaced with Viewer.js. Demo Viewer.js - JavaScript image viewe

Fengyuan Chen 1k Dec 19, 2022
A Mattermost Plugin which actively listens (and prohibits) for language with racist, ableist, sexist, or other exclusionary histories

Mattermost Gender Inclusive Language Plugin The gender-inclusive-language is a Mattermost Plugin which actively listens (and prohibits) for language w

Ademílson F. Tonato 2 Jun 22, 2022
Marquee is a VS Code extension designed to naturally integrate with your development flow, so that you will no longer lose track of your thoughts while you're coding

Marquee Stay organized with minimal context switching, all inside your Visual Studio Code. Marquee is a VS Code extension designed to naturally integr

stateful 60 Dec 13, 2022
"Longer in Twitter" est une extension Chrome affichant les TwitLonger directement dans un tweet.

Longer in Twitter "Longer in Twitter" est une extension Chrome affichant les TwitLonger directement dans un tweet. Installation Longer in Twitter ne f

Johan le stickman 4 Sep 22, 2022
⚠️ This project is not maintained anymore! Please go to https://github.com/visjs

vis.js (deprecated!) ❗ This project is not maintained anymore! (See Issue #4259 for details) We welcome you to use the libraries from the visjs commun

null 7.9k Dec 27, 2022
An aggregator for communities of Boilers, maintained and developed by Purdue students

Boiler Bulletin An aggregator for communities of Boilers, maintained and developed by Purdue students. Users can: Post links to online communities for

Kai Tinkess 2 Jan 23, 2022
CloudSecWiki is a cloud security oriented knowledge base maintained by HuoCorp.

CloudSecWiki CloudSecWiki is a cloud security oriented knowledge base maintained by HuoCorp. CloudSecWiki web address:cloudsec.huoxian.cn Local Deploy

HuoCorp 26 Dec 4, 2022