Coder Social home page Coder Social logo

agentdavidjoseph / jquery.youtubebackground Goto Github PK

View Code? Open in Web Editor NEW

This project forked from bento-n-box/jquery.youtubebackground

0.0 1.0 0.0 522 KB

A wrapper for the Youtube API - Great for fullscreen background videos or just regular videos.

HTML 49.42% JavaScript 45.70% CSS 4.88%

jquery.youtubebackground's Introduction

NOTE I have not been contributing to this, I'm happy to give you permissions to write to the repo if I am slowing you down.

jQuery.BackgroundVideo V1.0.5

Inspired by [Tubular] (http://www.seanmccambridge.com/tubular/)

Example: http://rochestb.github.io/jQuery.YoutubeBackground 360 Video Example: http://rochestb.github.io/jQuery.YoutubeBackground/360.html

Production Example: [www.cpbgroup.com] (http://cpbgroup.com)

jQuery plugin that lets you create background videos using youtube api

Put the script at the bottom of your markup right after jQuery:

 <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
 <script src="src/jquery.youtubebackground.js"></script>
<div id="video"></div>

Call the plugin function and your carousel is ready.

$('#video').YTPlayer({
    fitToBackground: true,
    videoId: 'LSmgKRx5pBo'
});

Need to customize some CSS in order to make it a background

#video{
 position: relative;
 background: transparent;
}

.ytplayer-container{
 position: absolute;
 top: 0;
 z-index: -1;
}

Works with Youtube Javascript API

Youtube Javascript API Options

Any youtube option must be placed within the playerVars object.

$('#video').YTPlayer({
    fitToBackground: true,
    videoId: 'LSmgKRx5pBo',
    playerVars: {
      modestbranding: 0,
      autoplay: 1,
      controls: 1,
      showinfo: 0,
      branding: 0,
      rel: 0,
      autohide: 0,
      start: 59
    }
});

Access all of YouTube's API events and methods by using player:

var player = $('#background-video').data('ytPlayer').player;
player.pauseVideo();
player.playVideo();

player.addEventListener('onStateChange', function(data){
  console.log("Player State Change", data);
});

Options

For more details visit our [Documentations Page] (http://rochestb.github.io/jQuery.YoutubeBackground)

Install with Bower

bower install youtube-background-video

Documentation

[Documentations Page] (http://rochestb.github.io/jQuery.YoutubeBackground)

Contributing

I welcome contributors, bugs, and questions.

Bug reports

A bug is a demonstrable problem that is caused by the code in the repository. Good bug reports are extremely helpful, so thanks!

Guidelines for bug reports:

  1. Use the GitHub issue search — check if the issue has already been reported.

  2. Check if the issue has been fixed — try to reproduce it using the latest develop branch in the repository.

  3. Isolate the problem — ideally create a reduced test case and a live example. This JSFiddle is a helpful template you can fork.

By submitting a patch, you agree to allow the project owner to license your work under the terms of the MIT License.

License

The code and the documentation are released under the MIT License.

jquery.youtubebackground's People

Contributors

bento-n-box avatar bmsterling avatar andrew-dixon avatar afzalh avatar andreamariotti83 avatar cc-damo avatar webkonstantin avatar michaeljjames avatar ncharlot avatar tsvensen avatar

Watchers

James Cloos 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.