angular-video-background
Advanced tools
Comparing version
{ | ||
"name": "angular-video-background", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "use any video as background for your html pages with many options", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
# angular-video-background | ||
light module for using any video as background with many options | ||
The idea came when I needed to use a video as background for one website and looking around on the web I saw: [Vide](https://github.com/VodkaBears/Vide) and it works very good, but uses jQuery and I didn't like the code too much so I decided to write my own. | ||
## [DEMO](http://www.codekraft.it/demos/angular-video-background/) | ||
## Getting started: | ||
Download the package using npm package manager: | ||
```bash | ||
npm install angular-video-background | ||
``` | ||
or clone it from github. | ||
Add the script to your html page. | ||
```html | ||
<script type="text/javascript" src="video-background.module.js"></script> | ||
``` | ||
and than add the module to your application dependencies: | ||
```javascript | ||
angular.module('app', ['video-background']) | ||
``` | ||
and you can start to use the directive __video-background__ it in your application. | ||
--- | ||
## Basic usage: | ||
The directive most important attribute that must be specified in order to work correctly. The attribute is __source__, that specify the object with the source/s of the video in the format __type__: "source". | ||
```javascript | ||
// example source object | ||
myVideo = { | ||
mp4: public/myvideo.mp4, | ||
ogg: public/myvideo.ogg | ||
} | ||
``` | ||
__Note:__ you should pass a object to the attribute. | ||
```html | ||
<video-background source="myVideo"></video-background> | ||
``` | ||
--- | ||
## Directive attributes: | ||
* __source__: the object containing the video source/s | ||
* __autoplay__: set the video auto play attribute (default true) | ||
* __on-firstplay__: a callback to run when the video play for the first time | ||
* __on-firstend__: a callback to run when the video ends for the first time | ||
Coming soon many customization examples.. |
@@ -0,0 +0,0 @@ angular.module('video-background', []) |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
462962
0.27%52
1633.33%6
-14.29%2046
-0.29%