npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

angular-video-background

v1.0.3

Published

use any video as background for your html pages with many options

Downloads

30

Readme

angular-video-background

light module for using any video as background with many options

DEMO

Getting started:

Download the module using npm package manager:

npm install angular-video-background

with bower package manager:

bower install --save angular-videos-background

or download it directly from GitHub.

Add the style to your header:

<link rel="stylesheet" href="angular-video-background.min.css">

Add the script to your body:

<script type="text/javascript" src="angular-video-background.min.js"></script>

and than add the module to your application dependencies:

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

// example source object
$scope.myVideo = {
  mp4: "public/myvideo.mp4",
  ogg: "public/myvideo.ogg"
}

Note: you must pass a object to the source attribute.

<video-background source="myVideo"></video-background>
<video-background source="{ mp4: 'path/to/video.mp4' }"></video-background>

You can optionally bind keyboard press to video controls by using key-controls attribute.


Directive attributes:

  • source: the object containing the video source/s
  • autoplay: set the video auto play attribute (default true)
  • volume: an number value from 0 to 1 to set the initial volume
  • autopause: autopause the video in case of seeking
  • key-controls: if the attribute is specified will bind keyboard controls
  • show-time: enable or disable the current time view
  • 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
  • start-time: specify a custom start time for the video (expressed in int/float es: 1.50)
  • end-time: specify a custom end time for the video (expressed in int/float es: 17.25)

Examples:

source

The object containing the source/s of the video to show. This attribute is necessary for the directive to work.

<video-background source="{
  mp4: 'mySource.mp4',
  ogg: 'mySource.ogg',
  webm: 'mySource.webm'
}"></video-background>

auto-play

The autoplay attribute will start the video when it's ready to play. (like the normal html autoplay attribute)

start-time

Specify a custom start time for the video, pass a number, can be a float.

<video-background source="myVideo" start-time="3.75"></video-background>

end-time

Specify a custom end time for the video, pass a number, can be a float.

<video-background source="myVideo" end-time="15.35"></video-background>

initial volume

Start the video with initial volume of 0

<video-background source="myVideo" volume="0"></video-background>

autoplay & autopause

Specify a custom end time for the video, pass a number, can be a float.

<video-background source="myVideo" autoplay autopause></video-background>

enable keyboard controls

Specify a custom end time for the video, pass a number, can be a float.

<video-background source="myVideo" key-controls="true"></video-background>