• Stars
    star
    203
  • Rank 192,890 (Top 4 %)
  • Language
    JavaScript
  • Created over 11 years ago
  • Updated over 9 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A small, slick, library independent YouTube User/Playlist player

YoutubeTV

A small, slick, library independent YouTube User/Playlist player

Features

  • Library Independent
  • Customizable via CSS
  • Autoplay
  • Remove YouTube Chrome
  • Supports Playlists and Users
  • jQuery Support
  • Module Support

Demos

Installation

Include both the ytv.css and ytv.js in your HTML file and you are good to go.

<link href="src/ytv.css" type="text/css" rel="stylesheet" />
<script src="src/ytv.js" type="text/javascript"></script>

Usage

After your page has loaded, you may call the script like so:

var controller = new YTV(element, {
	user: 'YoutubeUsername'
});

YTV accepts two parameters. The first is a string of the element ID you want to use as the player, OR it may the element itself. The second parameter is an object of options defined below:

Settings and Defaults

settings = {
    element: null,
    user: null,
    playlist: '',
    fullscreen: false,
    accent: '#fff',
    controls: true,
    annotations: false,
    autoplay: false,
    chainVideos: true,
    browsePlaylists: false,
    wmode: 'opaque',
    events: {
        videoReady: function(){},
        stateChange: function(){}
    }
}
  • element: The element or element ID to apply the YouTube TV Player to
  • user: (String) The Username of the YouTube user you want to display videos from
  • playlist: (String) The Playlist ID you would like to load (Overrides user)
  • browsePlaylists: (Boolean) If true and the specified user has YouTube playlists, they will be accessible in the player by clicking the users Username
  • fullscreen: (Boolean) If true, the player will take up all the available space on the users browser screen
  • accent: (String) A CSS color string to apply to the accents of the player
  • controls: (Boolean) If false, the normal YouTube controls will be hidden.
  • annotations: (Boolean) If false, the annotations from the YouTube video will be hidden
  • autoplay: (Boolean) If true, the first video in the list will automatically play once the player has loaded
  • chainVideos: (Boolean) If true, the next video in que will automatically play after the current video has completed
  • wmode: (String) Sets the Window Mode property for transparency, layering, and positioning in the browser. Values can be: window - movie plays in its own rectangular window on a web page. opaque - the movie hides everything on the page behind it. transparent - the background of the HTML page shows through all transparent portions of the movie, this may slow animation performance.
  • events: The respective events will fire when key actions in the player have been called

Public Methods

destroy

Destroys the YouTube TV Player and all associated elements/events

controller.destroy();

fullscreen.state()

Returns true if in Fullscreen Mode

controller.fullscreen.state();

fullscreen.enter()

Enters into Fullscreen Mode

controller.fullscreen.enter();

fullscreen.exit()

Exits Fullscreen Mode

controller.fullscreen.exit();

jQuery Support

YTV may be used as a jQuery plugin in the following fashion:

$('#frame').ytv({opts});

Licensing

MIT Licensing

Copyright (c) 2013 Jacob Kelley

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Share Meh!

More Repositories

1

Snap.js

A Library for creating beautiful mobile shelfs in Javascript (Facebook and Path style side menus)
JavaScript
5,987
star
2

Medium.js

A tiny JavaScript library for making contenteditable beautiful (Like Medium's editor)
JavaScript
4,389
star
3

himawari.js

Download real-time images of Earth from the Himawari-8 satellite
JavaScript
1,807
star
4

Behave.js

A lightweight, cross browser library for adding IDE style behaviors to plain text areas
JavaScript
1,740
star
5

Blur.js

blur.js is a jQuery plugin that produces psuedo-transparent blurred elements over other elements.
JavaScript
924
star
6

Mention.js

Lightweight wrapper for adding @user mention functionality to Twitter Bootstraps Typeahead plugin
JavaScript
751
star
7

off-the-rip

Downloads audio, artwork, and metadata from Soundcloud
JavaScript
453
star
8

Ripple.js

Adds Material style ripple to anything
JavaScript
277
star
9

AppScroll.js

AppScroll is a tiny (< 100 lines) JS library that fixes the "website dragging" issue caused on iDevices
JavaScript
251
star
10

Context.js

Contextual Menus with Twitters Bootstrap.css
JavaScript
248
star
11

Sparky.js

Sparky.js is an idea about client-side Javascript organization.
JavaScript
197
star
12

Submodal

Add submodals to Bootstrap 3.x modals
JavaScript
184
star
13

stability-ts

DreamStudio Client written in TypeScript
TypeScript
157
star
14

Bits

Bits Editor is your personal playground to develop in HTML, CSS, and Javascript, all from your own server.
JavaScript
87
star
15

Github-Mobile

GitHub Mobile
79
star
16

Ratchet-Vine

A Ratchet template that attempts to recreat the beautiful Vine app
JavaScript
59
star
17

Shadow

An internal analytics engine used to track meta data and user relations for objects in your application
PHP
55
star
18

Blur.js-II

Javascript library for blurring HTML content with CSS and SVG
JavaScript
50
star
19

Throttle

A PHP function that can be used to throttle any actions you want, as to prevent flooding.
PHP
30
star
20

WebFontGenerator

This is a class to generate CSS3 web fonts with Font Forge and PHP
PHP
25
star
21

iTunes-Colors

Recreates the color-effect used in iTunes
25
star
22

Scenario.js

A lightweight A/B Testing library for use with MixPanel
JavaScript
21
star
23

Slow.js

slow.js is a small script used to slow down CSS transition durations by a predefined factor on a key press event.
JavaScript
21
star
24

Repo-Downloader

A small PHP class to download repo zipballs from GitHub
PHP
20
star
25

Architect.js

A simple scaffold for your client side JavaScript.
JavaScript
17
star
26

Formula.js

Turn hyperlinks into ajax requests, making links as powerful as forms.
JavaScript
14
star
27

Gift.js

A Javascript library for wrapping your websites up as a present
JavaScript
10
star
28

Rap

A wicked simple comment system
JavaScript
8
star
29

ParseObject.js

Simple function to parse a string and compare it against an object.
JavaScript
8
star
30

Hatchet

Hatchet is a mobile client for Y Combinator Hacker News, and was built with Ratchet. Currently, it is tailored for iOS devices.
JavaScript
7
star
31

stfu

Tools and scripts used to broaden my reach online
CSS
5
star
32

sams-calendar-program

My Grandfathers Calendar Program read from two floppy disks.
Batchfile
4
star
33

Sparky.js-Website

This is the website for Sparky.js
PHP
4
star
34

Brazzed

Add the Brazzers logo to any image for intensity...
PHP
4
star
35

stemmy

An experimental Typescript wrapper for demucs
TypeScript
2
star
36

Thought.js

Create a beautiful message for someone you care about.
JavaScript
2
star
37

trill

A multi-resource html5 audio player
1
star
38

Not-Enough-Juans

We need more Juans
JavaScript
1
star