mrchimp / videopopup

Show a video in a popup. Simple.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Video Popup

A jQuery plugin for opening Vimeo and Youtube videos in a modal window.

  • Configurable embed settings.
  • Stylable with LESS (or CSS, whatever).

Setup

Include jQuery and the videopopup js and css files in your HTML.

Make some links and add some video codes.

	<a href="#" class="my-video-links" data-vimeo="84215473">Vimeo</a>
	<a href="#" class="my-video-links" data-youtube="ppZzR-z8RqE">Youtube</a>

Do something like the following to make your links work:

$('.my-video-links').videopopup({
	autoplay: true,
	color: '#f00'
});

Options

All options are optional. Defaults are shown below. Most options affect either Vimeo or Youtube links but you can specify them all together - it won't cause problems.

Options for both

  • autoplay (true)

Options for Vimeo Links

  • title (false)
  • byline (false)
  • portrait (false)
  • color (#00adef)

Options for Youtube links

  • controls (true)
  • showinfo (false)

Events

You can use events like so:

$('.my-link').videopopup().on('video:show', function() {
  console.log('This video is now showing.');
});

Available events:

  • video:show
  • video:hide

About

Show a video in a popup. Simple.


Languages

Language:JavaScript 74.2%Language:HTML 14.1%Language:CSS 11.7%