Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/doesdev/jquery-video-lightning

Turn any element into a lightbox or popover link for Youtube and Vimeo videos.
https://github.com/doesdev/jquery-video-lightning

Last synced: about 20 hours ago
JSON representation

Turn any element into a lightbox or popover link for Youtube and Vimeo videos.

Awesome Lists containing this project

README

        

![alt text](http://doesdev.github.io/jquery-video-lightning/images/JqueryVideoLightningIcon45.png "Video Lightning Logo") Video Lightning [![Build Status](https://travis-ci.org/doesdev/jquery-video-lightning.png)](https://travis-ci.org/doesdev/jquery-video-lightning) [![Pinkie Pie Approval Status](http://dosowisko.net/pinkiepieapproved.svg)](https://www.youtube.com/watch?v=FULyN9Ai-A0)
======================

Turn any element into a lightbox or popover link for Youtube and Vimeo videos.

Repo name is for posterity, Video Lightning is standalone so jQuery is optional.

### Table of Contents
- [Why](#why)
- [How](#how)
- [Features](#features)
- [Demos](#demos)
- [Docs](#docs)
- [Getting Started](#getting-started)
- [Passing in Options](#passing-in-options)
- [Available Options](#available-options)
- [Changes](#changes)
- [Alternate Builds](#alternate-builds)
- [Contributing](#contributing)

Why?
----
Lots of reasons. The main one, and the reason we built it, is for quick video explainers in the appropriate places. This little plugin bootstraps getting those helpful little videos in place.

How?
----
Simple. Add the js your project, initialize with target and options and enjoy your video lightbox enhanced element!

Features
----
- Simple access to all embed API options for both providers
- Lots of options to customize and beautify your lightboxes
- Intelligent popover auto positioning gravitates to page center
- Preview videos on hover, pin if you want them to stick around
- Lazy loading of videos prevents slow page load due to video embeds
- Rick Roll with ease (don't pass video id, add rick_roll option to prevent closing)

Demos
----
Check the [GH Project Page](http://doesdev.github.io/jquery-video-lightning/) for demos.

Docs
----

### Getting Started
**i.** Add script where you desire *(bottom of body is recommended)*

```html

```

**ii.** Initialize it on the desired elements with any options you please *(options can also be passed as data attributes)*

#### Native initialization:

```html

videoLightning({
elements: [
{
".video-link": {
id: "y-PKffm2uI4dk",
autoplay: true,
color: "white"
}
}
]
});

```

#### jQuery flavored initialization:

```html

$(function() {
$(".video-link").jqueryVideoLightning({
id: "y-PKffm2uI4dk",
autoplay: true,
color: "white"
});
});

```

Alternatively, for a simple setup you could initialize on a class, set your options globally, and add video id to each el.

```html