GithubHelp home page GithubHelp logo

imclab / vimy Goto Github PK

View Code? Open in Web Editor NEW

This project forked from michael-lynch/vimy

0.0 1.0 0.0 160 KB

A simple, lightweight jQuery plugin used to display videos from a Vimeo account.

License: MIT License

CSS 17.05% JavaScript 82.95%

vimy's Introduction

#Vimy

A simple, lightweight jQuery plugin used to display videos from a Vimeo account.

The plugin allows you to display videos independently or as a gallery.

The gallery mode displays one featured video with image thumbnails of the other videos. Clicking on the image thumbnail will replace the featured video.

Videos are displayed as simple list items allowing you to style them as you wish.

See a demo

See a demo of the gallery

##Instructions

Include jQuery and the plugin in the head or footer of your page.

<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
    
<script src="/js/plugins/vimy.js"></script>

Create an unordered list where the videos will display.

<ul class="vimy-videos"></ul>

Initialize the plugin targeting the class, ID or element you've created.

$('.vimy-videos').vimy();

####Options

username: string
A string that defines the username of the user you wish to retrieve videos from (default: null).

gallery: boolean
A boolean that indicates whether you want the videos to display as a gallery (default: false).

imgFormat: "bg / element"
A string that defines how the gallery images should display (default: 'bg'). 'bg' sets the image as a background image on the list item, while 'element' populates the list item with an img element.

limit: integer
An integer that defines how many videos you want displayed (default: 9).

title: boolean
A boolean that indicates whether you want the title of the videos to display (default: true).

duration: boolean
A boolean that indicates whether you want the duration of the videos to display (default: true).

date: boolean
A boolean that indicates whether you want the published date of the videos to display (default: true).

description: boolean
A boolean that indicates whether you want the video description to display (default: true).

tags: boolean
A boolean that indicates whether you want the video tags to display (default: true).

success: function()
A callback function that is triggered after the request, if the request is successful.

error: function()
A callback function that is triggered after the request, if the request is fails.

#####Example:

$(function() {
	
	$('.vimy-videos').vimy({
		username: 'brad',
		gallery: true,
		imgFormat: 'element',
		limit: 5,
		success: function() {
			console.log('Videos were retrieved successfully.');
		},
		error: function() {
			console.log('There was an error.');
			$('.vimy-videos').remove();
		}
	});
		
});

vimy's People

Watchers

 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.