All Projects → ayastreb → jquery.youtube-inview-autoplay

ayastreb / jquery.youtube-inview-autoplay

Licence: MIT license
📺 A jQuery plugin that starts playing YouTube video when it's scrolled into the view and stops it when it's scrolled out

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to jquery.youtube-inview-autoplay

conditionize.js
Small jQuery plugins for handling conditional form fields via data attributes. Unmaintained.
Stars: ✭ 56 (+330.77%)
Mutual labels:  jquery-plugin
Ace-Responsive-Menu
Ace responsive menu is a lightweight jQuery plugin to create responsive multi-level navigation menus with multi device support. Ace responsive menu comes with 3 variants like horizontal, vertical and accordion menu. It gives complete responsive menu solution for any kind of websites or admin templates. The plugin has clean and well commented val…
Stars: ✭ 46 (+253.85%)
Mutual labels:  jquery-plugin
Persian-DatePicker
jQuery UI Datepicker with bootstrap theme (Persian Shamsi, Arabic, Gregorian Calendar Support)
Stars: ✭ 36 (+176.92%)
Mutual labels:  jquery-plugin
Parallaxie
Easiest, Responsive and Customizable Parallax jQuery Plugin
Stars: ✭ 65 (+400%)
Mutual labels:  jquery-plugin
jquery-scrollToTop
A jQuery plugin that display a button for scrolling the page to the top.
Stars: ✭ 14 (+7.69%)
Mutual labels:  jquery-plugin
jQuery-Sakura
Make it rain - sakura petals or anything else for that matter.
Stars: ✭ 76 (+484.62%)
Mutual labels:  jquery-plugin
jquery.geocomplete
A simple plugin for Google Maps Autocomplete.
Stars: ✭ 15 (+15.38%)
Mutual labels:  jquery-plugin
xGallerify
A lightweight, responsive, smart gallery based on jQuery
Stars: ✭ 52 (+300%)
Mutual labels:  jquery-plugin
jQuery-Awesome-Sosmed-Share-Button
Awesome Social Media Share Button With Share Count
Stars: ✭ 58 (+346.15%)
Mutual labels:  jquery-plugin
blog
仿照nswbmw的N-blog项目写的多人博客系统,引入了bootstrap和jquery validation plugin。详见wiki部分。
Stars: ✭ 10 (-23.08%)
Mutual labels:  jquery-plugin
fontIconPicker
A lightweight iconpicker for use with jQuery
Stars: ✭ 30 (+130.77%)
Mutual labels:  jquery-plugin
desoslide
Take control of your slideshow with this powerful jQuery plugin
Stars: ✭ 68 (+423.08%)
Mutual labels:  jquery-plugin
Zebra Tooltips
A lightweight, accessible, and highly configurable jQuery plugin for creating beautiful tooltips
Stars: ✭ 52 (+300%)
Mutual labels:  jquery-plugin
paginathing
a jQuery plugin to paginate your DOM easily.
Stars: ✭ 23 (+76.92%)
Mutual labels:  jquery-plugin
Accordion.JS
Accordion.JS: Free jQuery Accordion plugin
Stars: ✭ 34 (+161.54%)
Mutual labels:  jquery-plugin
guillotine
jQuery plugin to crop images within an area (fully responsive), allowing to drag (touch support), zoom and rotate.
Stars: ✭ 321 (+2369.23%)
Mutual labels:  jquery-plugin
valida
jQuery Plugin for client side easy form validations.
Stars: ✭ 17 (+30.77%)
Mutual labels:  jquery-plugin
jquery.throwable
JQuery plugin to make HTML elements throwable
Stars: ✭ 69 (+430.77%)
Mutual labels:  jquery-plugin
floating-scroll
Lightweight jQuery plugin providing floating scrollbar functionality
Stars: ✭ 72 (+453.85%)
Mutual labels:  jquery-plugin
drawer
A touch-enabled drawer component for the modern web.
Stars: ✭ 26 (+100%)
Mutual labels:  jquery-plugin

YouTube in-view auto-play plugin

This plugin is using https://github.com/protonet/jquery.inview and YouTube Iframe API to setup multiple embeded YouTube players and starts playing them once the player is scrolled in browser view.

Usage

In page markup videos can be stored as <div> elements with data attributes, e.g:

<div class="youtube-video" 
     id="menorca-faro-de-favarix" 
     data-video-id="o2Fs6SoRHCk" 
     width="1000" 
     height="563"></div>

First, you need to load YouTube API. Then you need to apply plugin to all video elements:

<script type="text/javascript">
  // Load the IFrame Player API code asynchronously.
  var tag = document.createElement('script');
  tag.src = "https://www.youtube.com/player_api";
  var firstScriptTag = document.getElementsByTagName('script')[0];
  firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);

  function onYouTubeIframeAPIReady() {
    $('.youtube-video').inViewAutoplay({
      autohide: 1,
      modestbranding: 1,
      rel: 0,
      quality: 'hd720'
    });
  }
</script>

In plugin call you can pass player parameters object, for a list of supported parameters see: https://developers.google.com/youtube/player_parameters#Parameters

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].