-
Notifications
You must be signed in to change notification settings - Fork 547
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
33 changed files
with
838 additions
and
1,766 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,6 @@ | ||
.DS_Store | ||
.idea | ||
*.sublime-project | ||
*.sublime-workspace | ||
dist | ||
|
||
node_modules | ||
bower_components | ||
npm-debug.log | ||
|
||
mongoose*.exe | ||
|
||
*.orig | ||
|
||
*.log | ||
dist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
node_modules | ||
dist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,8 @@ | ||
# Exclude everything but the contents of the src and dist directory. | ||
**/* | ||
!dist/** | ||
!src/** | ||
.DS_Store | ||
.npmignore | ||
.gitignore | ||
.jshintrc | ||
.jshintignore | ||
src | ||
tests | ||
karma.conf.js |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,47 +1,95 @@ | ||
# YouTube Playback Technology<br />for [Video.js](https://github.com/videojs/video.js) [![Build Status](https://travis-ci.org/eXon/videojs-youtube.svg?branch=master)](https://travis-ci.org/eXon/videojs-youtube) | ||
[![Selenium Test Status](https://saucelabs.com/browser-matrix/videojs-youtube.svg)](https://saucelabs.com/u/videojs-youtube) | ||
<br /><br /> | ||
YouTube playback technology for the [Video.js player](https://github.com/videojs/video.js/). | ||
# YouTube Playback Technology<br />for [Video.js](https://github.com/videojs/video.js) | ||
|
||
## Install | ||
You can use bower (`bower install videojs-youtube`), npm (`npm install videojs-youtube`) or the source and build it using `grunt`. Then, the only file you need is dist/vjs.youtube.js. | ||
You can use bower (`bower install videojs-youtube`), npm (`npm install videojs-youtube`) or the source and build it using `npm run build`. Then, the only file you need is dist/Youtube.min.js. | ||
|
||
## Example | ||
```html | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<link type="text/css" rel="stylesheet" href="https://vjs.zencdn.net/4.12/video-js.css" /> | ||
<script src="https://vjs.zencdn.net/4.12/video.js"></script> | ||
<script src="vjs.youtube.js"></script> | ||
<link type="text/css" rel="stylesheet" href="../node_modules/video.js/dist/video-js.min.css" /> | ||
</head> | ||
<body> | ||
<video id="vid1" src="" class="video-js vjs-default-skin" controls preload="auto" width="640" height="360" data-setup='{ "techOrder": ["youtube"], "src": "http://www.youtube.com/watch?v=xjS6SftYQaQ" }'> | ||
<video | ||
id="vid1" | ||
class="video-js vjs-default-skin" | ||
controls | ||
autoplay | ||
width="640" height="264" | ||
data-setup='{ "techOrder": ["youtube"], "sources": [{ "type": "video/youtube", "src": "https://www.youtube.com/watch?v=xjS6SftYQaQ"}] }' | ||
> | ||
</video> | ||
|
||
<script src="../node_modules/video.js/dist/video.min.js"></script> | ||
<script src="../dist/Youtube.min.js"></script> | ||
</body> | ||
</html> | ||
``` | ||
|
||
|
||
See the examples folder for more | ||
|
||
## How does it work? | ||
Including the script vjs.youtube.js will add the YouTube as a tech. You just have to add it to your techOrder option. Then, you add the option src with your YouTube URL. | ||
Including the script Youtube.min.js will add the YouTube as a tech. You just have to add it to your techOrder option. Then, you add the option src with your YouTube URL. | ||
|
||
It supports: | ||
- youtube.com as well as youtu.be | ||
- Regular URLs: http://www.youtube.com/watch?v=xjS6SftYQaQ | ||
- Embeded URLs: http://www.youtube.com/embed/xjS6SftYQaQ | ||
- Playlist URLs: http://www.youtube.com/playlist?list=PLA60DCEB33156E51F OR http://www.youtube.com/watch?v=xjS6SftYQaQ&list=SPA60DCEB33156E51F | ||
|
||
## Additional Options | ||
This plugin exposes the following additional [player options](https://github.com/videojs/video.js/blob/master/docs/guides/options.md): | ||
## Options | ||
It supports every regular Video.js options. Additionally, you can change any [YouTube parameter](https://developers.google.com/youtube/player_parameters?hl=en#Parameters). Here is an example of setting the `iv_load_policy` parameter to `1`. | ||
|
||
- `ytcontrols` (Boolean): Display the YouTube player controls instead of the Video.js player controls. (default `false`) | ||
- `ytFullScreenControls` (Boolean): Show the fullscreen controls on the default youtube player controls. Also enables double click to fullscreen. (default `true`) | ||
- `quality` (String): Set the default video quality. Should be one of `1080p`, `720p`, `480p`, `360p`, `240p`, `144p`. | ||
- `playsInline` (Boolean): Sets the [`playsinline`](https://developers.google.com/youtube/player_parameters?playerVersion=HTML5#playsinline) YouTube player parameter to enable inline playback on iOS | ||
- `forceHTML5` (Boolean): Forces loading the YouTube HTML5 player (default `true`) | ||
```html | ||
<video | ||
id="vid1" | ||
class="video-js vjs-default-skin" | ||
controls | ||
autoplay | ||
width="640" height="264" | ||
data-setup='{ "techOrder": ["youtube"], "sources": [{ "type": "video/youtube", "src": "https://www.youtube.com/watch?v=xjS6SftYQaQ"}], "Youtube": { "iv_load_policy": 1 } }' | ||
> | ||
</video> | ||
``` | ||
|
||
### YouTube controls | ||
Because `controls` is already a Video.js option, to use the YouTube controls, you must set the `ytControls` parameter. | ||
|
||
```html | ||
<video | ||
id="vid1" | ||
class="video-js vjs-default-skin" | ||
controls | ||
autoplay | ||
width="640" height="264" | ||
data-setup='{ "techOrder": ["youtube"], "sources": [{ "type": "video/youtube", "src": "https://www.youtube.com/watch?v=xjS6SftYQaQ"}], "Youtube": { "ytControls": 2 } }' | ||
> | ||
</video> | ||
``` | ||
|
||
##Special Thank You | ||
Thanks to Steve Heffernan for the amazing Video.js and to John Hurliman for the original version of the YouTube tech | ||
|
||
## License | ||
The MIT License (MIT) | ||
|
||
Copyright (c) 2014-2015 Benoit Tremblay <[email protected]> | ||
|
||
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,31 @@ | ||
{ | ||
"name": "videojs-youtube", | ||
"version": "2.0.0", | ||
"homepage": "https://github.com/eXon/videojs-youtube", | ||
"authors": [ | ||
"Benoit Tremblay <[email protected]>" | ||
], | ||
"description": "YouTube playback technology for Video.js", | ||
"version": "1.2.13", | ||
"main": ["dist/vjs.youtube.js"], | ||
"main": "dist/Youtube.min.js", | ||
"license": "MIT", | ||
"keywords": [ | ||
"video", | ||
"videojs", | ||
"video.js", | ||
"vjs", | ||
"YouTube", | ||
"tech" | ||
], | ||
"ignore": [ | ||
"examples", | ||
"sandbox", | ||
"test", | ||
".editorconfig", | ||
".npmignore", | ||
".gitignore", | ||
".jshintrc", | ||
".travis.yml", | ||
"bower.json", | ||
"Gruntfile.js", | ||
"package.json", | ||
"README.md" | ||
".jshintignore", | ||
"src", | ||
"tests", | ||
"karma.conf.js" | ||
], | ||
"dependencies": { | ||
"video.js": "^4.11" | ||
"video.js": "^5.0.0" | ||
} | ||
} |
Binary file not shown.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.