Giter Club home page Giter Club logo

vidbg's Introduction

Vidbg.js

HTML5 jQuery Video Background plugin.

Working With Wordpress

If you plan on using Vidbg.js with Wordpress, make your life a little bit easier and download the plugin I made on the Wordpress Repo.

Compatibility

  • All modern web browsers
  • IE9+
  • Video will play on desktops and laptops and will resort to the fallback image (poster) on mobile devices (tablets, phones, etc.)

Instructions

To get started, download the script. Once you have downloaded the script, include it in your project:

<script src="vidbg.min.js"></script>

Initializing the Script

There is two ways to initialize the script; from HTML, and from javascript. Both methods will be shown below.

Initialized from HTML

<div class="vidbg-box" style="width: 650px; height: 338px;"
  data-vidbg-bg="mp4: http://example.com/video.mp4, webm: path/to/video.webm, poster: path/to/poster.jpg"
  data-vidbg-options="loop: true, muted: true, overlay: true">
</div>

Initialized from Javascript

$('.vidbg-box').vidbg({
  'mp4': 'http://example.com/video.mp4',
  'webm': 'path/to/video.webm',
  'poster': 'path/to/fallback-image.png',
}, {
  // options
});

It is important to note that supplying both .webm and .mp4 will highly increase browser compatibility and it is highly recommended.

Options

{
  volume: 1,
  playbackRate: 1,
  muted: true,
  loop: true,
  position: '50% 50%',
  resizing: true,
  overlay: false,
}

Resizing

When resizing is set to true (default) the video will resize automatically when the window is expanded or compressed.

Overlay

Setting overlay to true will add a faint pattern over your video. This is helpful when your video is primarily white and you have white text on top. overlay is set to false by default.

License

Vidbg.js is licensed under The MIT License. You can view it here.

vidbg's People

Contributors

blakewilson avatar

Watchers

James Cloos avatar Noel Chavez avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.