Skip to content

Commit

Permalink
Merge pull request #215 from heff/jhurliman-youtube
Browse files Browse the repository at this point in the history
Jhurliman youtube
  • Loading branch information
heff committed Aug 13, 2012
2 parents 9343610 + fffa9dd commit 8eba022
Show file tree
Hide file tree
Showing 16 changed files with 1,766 additions and 846 deletions.
4 changes: 4 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,11 @@ cat src/tracks.js >> dist/video.js
# h5swf temporarily requires swfobject
# cat flash/swfobject.js >> dist/video.js

cat tech/html5/html5.js >> dist/video.js
cat tech/flash/flash.js >> dist/video.js

cat src/setup.js >> dist/video.js

cat src/_end.js >> dist/video.js


Expand Down
20 changes: 20 additions & 0 deletions build/release-files/youtube.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<!DOCTYPE html>
<html>
<head>
<title>Video.js | HTML5 Video Player | YouTube Demo</title>

<!-- Change URLs to wherever Video.js files will be hosted -->
<link href="video-js.css" rel="stylesheet" type="text/css">
<!-- video.js must be in the <head> for older IEs to work. -->
<script src="video.js"></script>

</head>
<body>

<video id="example_video_1" class="video-js vjs-default-skin" controls preload="none" width="640" height="360"
data-setup='{"techOrder":["youtube","html5"],"ytcontrols":false}'>
<source src="http://www.youtube.com/watch?v=qWjzVHG9T1I" type='video/youtube' />
</video>

</body>
</html>
8 changes: 6 additions & 2 deletions dev.html.example
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,17 @@
<script src="src/controls.js"></script>
<script src="src/events.js"></script>
<script src="src/tracks.js"></script>

<script src="tech/html5/html5.js"></script>
<script src="tech/flash/flash.js"></script>

<script src="src/setup.js"></script>

<script type="text/javascript" charset="utf-8">
// Easy access to test Flash over HTML5. Add ?flash to URL
if (window.location.href.indexOf("?flash") !== -1) {
_V_.options.techOrder = ["H5swf"]
_V_.options.techOrder = ["flash"];
_V_.options.flash.swf = "tech/flash/video-js.swf";
}
</script>

Expand Down
44 changes: 44 additions & 0 deletions docs/tech.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,47 @@ timeupdate
progress
enterFullScreen
exitFullScreen

Adding Playback Technology
==================
When adding additional Tech to a video player, make sure to add the supported tech to the video object.

### Tag Method: ###
<video data-setup='{"techOrder", "html5", "flash", [other supported tech]}'

### Object Method: ###
_V_("videoID", {
techOrder: {"html5", "flash", [other supported tech]}
});

Youtube Technology
==================
To add a youtube source to your video tag, use the following source:

<source src="http://www.youtube.com/watch?v=[ytVideoId]" type="video/youtube"

Important Note:
------------------
> You can simply copy and paste the url of the youtube page from the browser and
> the Youtube Tech will be able to find the video id by itself. This is just the
> minimum needed to get the video working. (Useful for data storage)

Youtube Technology - Extra Options
----------------------------------

In Addition to the natively supported options, the Youtube API supports the following
added options:

### ytcontrols ###
Type: Boolean (T/F)
Default: False

Determines whether to show Youtube's basic Red/Black default play bar skin or to hide
it and use the native video-js play bar.

### hd ###
Type: Boolean (T/F)
Default: False

Determines whether or not to play back the video in HD.
Loading

0 comments on commit 8eba022

Please sign in to comment.