Giter Site home page Giter Site logo

motses / jquery-video Goto Github PK

View Code? Open in Web Editor NEW

This project forked from dachcom-digital/jquery-video

0.0 1.0 0.0 331 KB

Unifies the iframe APIs of Youtube, Vimeo and Dailymotion. Build as responsive jQuery UI widget.

Home Page: http://jquery-video.dachcom.ch/demo/

License: MIT License

HTML 9.14% JavaScript 90.86%

jquery-video's Introduction

jquery-video

Unifies the iframe APIs of Youtube, Vimeo and Dailymotion. Build as responsive jQuery UI widget.

Features

Demo

Demo can be found here: http://jquery-video.dachcom.ch/demo/

You can also checkout the project and open the index.html in the demo folder (use a webserver).

Dependencies

Installation

<!-- 1. Place containers with data attributes for configuration -->
<div class="container">
    <div class="video" data-type="vimeo" data-code="29950141" data-width="500" data-height="280"></div>
    <div class="video" data-type="youtube" data-code="ubKinQvpc6w" data-responsive="false" data-width="960" data-height="720"></div>
    <div class="video" data-type="dailymotion" data-code="x14b8od" data-width="500" data-height="280"></div>
</div>

<!-- 2. Include libraries -->
<script src="../lib/jquery.js" type="text/javascript"></script>
<script src="../lib/jquery.ui.widget.js" type="text/javascript"></script>
<script src="../lib/froogaloop.js" type="text/javascript"></script>

<!-- 3. Include widget -->
<script src="../src/jquery.dcd.video.js" type="text/javascript"></script>

<!-- 4. Bind widget to containers -->
<script type="text/javascript">
    $(function () {
        $('.video').video();
    });
</script>

Options

  • type: API used [Required:(youtube|vimeo|dailymotion)]
  • code: the video code [Required]
  • width: the width of the video [Required:Integer]
  • height: the height of the video [Required:Integer]
  • responsive: should the video be included responsively [Optional:(true|false)]

Methods

  • play: play video
  • pause: pause video
  • stop: stop video
  • playing: returns status of video

Examples

     $(':dcd-videoYoutube').video('play'); // plays all youtube videos
     $('[data-type="youtube"]').video('play'); // plays also all youtube videos
     $('.video').video('pause'); // pauses all videos with class video
     $('[data-code="29950141"]').video('play'); // plays video with code 29950141
     $('.video').video('stop'); // stops all videos with class video
     $('[data-code="29950141"]').video('playing'); // returns true when video is playing, false if video is paused

Wishlist

  • find better way to include and initialize youtube api
  • find better way for video factory and inheritance
  • include full test suite
  • make 'responsive' class configurable
  • implement more API commands
  • implement more APIs (Dailymotion, MyVideo, ...)

Known Issues

  • Youtube API is throwing exceptions
  • You can't have more than one Vimeo video with the same code on one page

jquery-video's People

Contributors

vandres avatar

Watchers

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