Skip to content

Commit

Permalink
MAJOR REFACTOR: Restrcutured code into class-based components. Setup …
Browse files Browse the repository at this point in the history
…and configuring should still work the same, but controls and tech elements are now sub-classes for Component, which builds elements and applies event behaviors.

Removed demo source code from repository root. Was receiving pull requests for the release files instead of source files. This makes it more clear where to make changes.
  • Loading branch information
heff committed Nov 29, 2011
1 parent a314c0a commit ef321a8
Show file tree
Hide file tree
Showing 87 changed files with 2,315 additions and 6,436 deletions.
148 changes: 10 additions & 138 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,16 @@ VideoJS - [HTML5 Video Player](http://videojs.com)
==================================================
Version 3.0 BETA

Visit the main site at [videojs.com](http://videojs.com) for download options and instructions.

To build video-js from the latest version of the source, clone the source repository and run:
sh build.sh
in the video-js directory using the commnand-line/terminal of a unix-based system.

Contributing
------------
You can use dev.html to test new code. It's simple HTML doc that includes all the source files. Send a pull request for any updates.

---
BETA NOTES
Version 3 is almost a complete rewrite of the previous versions of VideoJS. New features includes:
Expand All @@ -13,141 +23,3 @@ Version 3 is almost a complete rewrite of the previous versions of VideoJS. New
- No more embedding of Flash fallback within the video tag HTML.

---

View [VideoJS.com](http://videojs.com) for a demo and overview.

VideoJS is an HTML5 video player that uses the HTML5 video tag built into modern browsers, and uses javascript to add custom controls, new functionality, and to fix cross browser bugs. For browsers that don't support HTML5, it will fallback to a Flash player.

View demo.html for an example of how to use it.

Originally based on [this tutorial](http://blog.steveheffernan.com/2010/04/how-to-build-an-html5-video-player/).

Contributors (Github Username)
------------------------------
heff, dz0ny, sentientbit, tvdeyen, brandonarbini, gordonbrander, Shraymonks, albertogasparin, sandaru1, nicholasbs, majornista, Fredust85, @wonderboymusic, ellis-, emirpprime, eirikb, mbrubeck


Getting Started
---------------

### Step 1: Include the VideoJS Javascript and CSS files in the head of your page.
Change the file urls to point to the files on your server.

<script src="video.js"></script>
<link href="video-js.css" rel="stylesheet">


### Step 2: Add an HTML5 video tag to your page.
Use the video tag as normal, with a few extra pieces for VideoJS:

1. The 'data-setup' Atrribute tells VideoJS to automatically set up the video when the page is ready, and read any options (in JSON format) from the attribute.
2. The 'id' Attribute: Should be used and unique for every video on the same page.
3. The 'class' attribute contains two classes:
- 'video-js' applies styles that are required for VideoJS functionality, like fullscreen and subtitles.
- 'vjs-default-skin' applies the default skin to the HTML controls, and can be removed or overridden to create your own controls design.

Otherwise include/exclude attributes, settings, sources, and tracks exactly as you would for HTML5 video.

<video id="example_video_1" class="video-js vjs-default-skin" controls preload="auto" width="640" height="264"
poster="http://video-js.zencoder.com/oceans-clip.png"
data-setup='{"example_option":true}'>
<source src="http://video-js.zencoder.com/oceans-clip.mp4" type='video/mp4' />
<source src="http://video-js.zencoder.com/oceans-clip.webm" type='video/webm' />
</video>


### Step 3: Nada!
That's all it take to get started. See the docs for more advanced uses.


Coming Next
-----------
- Stable Release

Changelog
---------
3.0b

- Complete rewrite in progress

2.0.3

- Feature: Made returning to the start at the end of the movie an option ("returnToStart").
- Feature: Added loop option to loop movie ("loop").
- Feature: Reorganized player API and listeners.
- Feature: Added option to disable controls. controlsEnabled: false
- Feature: Setup method now has a callback, so you can more easily work with the player after setup
- Feature: Added listeners for enter/exit full screen/window.
- Feature: Added a VideoJS.player(id) function for getting the player for a video ID
- Changes: setupAllWhenReady is now just setupAll (backward compatible)
- Fix: Check for Android browser now excludes firefox and opera

2.0.2 (2010-12-10)

- Feature: Rewrote and optimized subtitle code.
- Feature: Protecting against volume ranges outside of 1 and 0.
- Fix: Bug in Safari for Mac OS 10.5 (Leopard) that was breaking fullscreen.

2.0.1 (2010-11-22)

- Fix: Issue with big play button when multiple videos are on the page.
- Fix: Optimized play progress tracking.
- Fix: Optimized buffer progress checking.
- Fix: Firefox not showing Flash fallback object.

2.0.0 (2010-11-21)

- Feature: Created "behaviors" concept for adding behaviors to elements
- Feature: Switched back to divs for controls, for more portable styles
- Feature: Created playerFallbackOrder array option. ["html5", "flash", "links"]
- Feature: Created playerType concept, for initializing different platforms
- Feature: Added play button for Android
- Feature: Added spinner for iPad (non-fullscreen)
- Feature: Split into multiple files for easier development
- Feature: Combined VideoJS & _V_ into the same variable to reduce confusion
- Fix: Checking for m3u8 files (Apple HTTP Streaming)
- Fix: Catching error on localStorage full that safari seems to randomly throw
- Fix: Scrubbing to end doesn't trigger onEnded

1.1.5 (2010-11-09)

- Feature: Switched to track method for setting subtitles. Now works like spec.
- Feature: Created "players" concept for defining fallbacks and fallback order
- Fix: Android playback bug.
- Fix: Massive reorganization of code to make easier to navigate

1.1.4 (2010-11-06)

- Feature: Added loading spinner.
- Feature: Improved styles loaded checking.
- Feature: Added volume() function to get and set volume through the player.
- Fix: Fix issue where FF would loop video in background when ended.
- Fix: Bug in Chrome that shows poster & plays audio if you set currentTime too quickly.
- Fix: Bug in Safari where waiting is triggered and shows spinner when not needed
- Fix: Updated to show links if only unplayable sources and no Flash.
- Fix: Issue where if play button was loaded after play, it wouldn't hide.

1.1.3 (2010-10-19)

- Feature: Width/Height functions for resizing the player
- Feature: Made initial click & hold trigger new value on progress and volume
- Feature: Made controls not hide when hovering over them
- Feature: Added big play button as default starting control.
- Fix: Removed trailing comma that was breaking IE7
- Fix: Removed some vars from global scope
- Fix: Changed a document.onmousemove to an eventListener to prevent conflicts
- Fix: Added a unique ID to FlowPlayer demo object to fix a FlowPlayer bug. Thanks @emirpprime.
- Fix: Safari error on unloaded video

1.1.2 (2010-09-20)

- Added a fix for the poster bug in iPad/iPhone
- Added more specificity to styles

1.1.1 (2010-09-14)

- First Formally Versioned Release

1.0.0 (2010-05-18)

- First released
41 changes: 41 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#! /bin/csh
# Combines Source Files. In terminal, sh build.sh
# It will put a new video.js file under dist/

# FILES=../src/*
# for f in $FILES
# do
# echo "Processing $f file..."
# # take action on each file. $f store current file name
# cat $f
# done

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

cat src/core.js >> dist/video.js
cat src/lib.js >> dist/video.js
cat src/ecma.js >> dist/video.js
cat src/json.js >> dist/video.js
cat src/events.js >> dist/video.js

cat src/component.js >> dist/video.js
cat src/player.js >> dist/video.js
cat src/tech.js >> dist/video.js
cat src/controls.js >> dist/video.js

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

# h5swf temporarily requires swfobject
cat flash/swfobject.js >> dist/video.js

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


# Copy Files
cp design/video-js.css dist/video-js.css
cp design/video-js.png dist/video-js.png
cp flash/video-js.swf dist/video-js.swf

cp build/files/README.md dist/README.md
cp build/files/demo.html dist/demo.html
cp LICENSE.txt dist/LICENSE.txt
File renamed without changes.
17 changes: 9 additions & 8 deletions dev/build/combine_sources.sh → build/combine_sources.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@
# Combines Source Files. In terminal, sh combine_sources.sh
# It will put a new video.js file under dist/

# FILES=../src/*
# for f in $FILES
# do
# echo "Processing $f file..."
# # take action on each file. $f store current file name
# cat $f
# done

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

cat ../src/core.js >> ../dist/video.js
Expand All @@ -24,14 +32,7 @@ cat ../flash/swfobject.js >> ../dist/video.js
# So does Youtube
cat ../src/tech/youtube.js >> ../dist/video.js

cat ../src/behaviors/behaviors.js >> ../dist/video.js
cat ../src/behaviors/seekBar.js >> ../dist/video.js
cat ../src/behaviors/texttrackdisplays.js >> ../dist/video.js
cat ../src/behaviors/volume.js >> ../dist/video.js

cat ../src/controls/bar.js >> ../dist/video.js
cat ../src/controls/bigPlay.js >> ../dist/video.js
cat ../src/controls/subtitlesBox.js >> ../dist/video.js
cat ../src/components.js >> ../dist/video.js

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

Expand Down
153 changes: 153 additions & 0 deletions build/files/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,153 @@
VideoJS - [HTML5 Video Player](http://videojs.com)
==================================================
Version 3.0 BETA

---
BETA NOTES
Version 3 is almost a complete rewrite of the previous versions of VideoJS. New features includes:

- HTML/CSS Controls and API now work for both the HTML5 and Flash versions.
- Custom Super-lightweight Flash Fallback
- Embed Code is much simpler.
- No more "vjs-box" div required, just use the video tag.
- No more embedding of Flash fallback within the video tag HTML.

---

View [VideoJS.com](http://videojs.com) for a demo and overview.

VideoJS is an HTML5 video player that uses the HTML5 video tag built into modern browsers, and uses javascript to add custom controls, new functionality, and to fix cross browser bugs. For browsers that don't support HTML5, it will fallback to a Flash player.

View demo.html for an example of how to use it.

Originally based on [this tutorial](http://blog.steveheffernan.com/2010/04/how-to-build-an-html5-video-player/).

Contributors (Github Username)
------------------------------
heff, dz0ny, sentientbit, tvdeyen, brandonarbini, gordonbrander, Shraymonks, albertogasparin, sandaru1, nicholasbs, majornista, Fredust85, @wonderboymusic, ellis-, emirpprime, eirikb, mbrubeck


Getting Started
---------------

### Step 1: Include the VideoJS Javascript and CSS files in the head of your page.
Change the file urls to point to the files on your server.

<script src="video.js"></script>
<link href="video-js.css" rel="stylesheet">


### Step 2: Add an HTML5 video tag to your page.
Use the video tag as normal, with a few extra pieces for VideoJS:

1. The 'data-setup' Atrribute tells VideoJS to automatically set up the video when the page is ready, and read any options (in JSON format) from the attribute.
2. The 'id' Attribute: Should be used and unique for every video on the same page.
3. The 'class' attribute contains two classes:
- 'video-js' applies styles that are required for VideoJS functionality, like fullscreen and subtitles.
- 'vjs-default-skin' applies the default skin to the HTML controls, and can be removed or overridden to create your own controls design.

Otherwise include/exclude attributes, settings, sources, and tracks exactly as you would for HTML5 video.

<video id="example_video_1" class="video-js vjs-default-skin" controls preload="auto" width="640" height="264"
poster="http://video-js.zencoder.com/oceans-clip.png"
data-setup='{"example_option":true}'>
<source src="http://video-js.zencoder.com/oceans-clip.mp4" type='video/mp4' />
<source src="http://video-js.zencoder.com/oceans-clip.webm" type='video/webm' />
</video>


### Step 3: Nada!
That's all it take to get started. See the docs for more advanced uses.


Coming Next
-----------
- Stable Release

Changelog
---------
3.0b

- Complete rewrite in progress

2.0.3

- Feature: Made returning to the start at the end of the movie an option ("returnToStart").
- Feature: Added loop option to loop movie ("loop").
- Feature: Reorganized player API and listeners.
- Feature: Added option to disable controls. controlsEnabled: false
- Feature: Setup method now has a callback, so you can more easily work with the player after setup
- Feature: Added listeners for enter/exit full screen/window.
- Feature: Added a VideoJS.player(id) function for getting the player for a video ID
- Changes: setupAllWhenReady is now just setupAll (backward compatible)
- Fix: Check for Android browser now excludes firefox and opera

2.0.2 (2010-12-10)

- Feature: Rewrote and optimized subtitle code.
- Feature: Protecting against volume ranges outside of 1 and 0.
- Fix: Bug in Safari for Mac OS 10.5 (Leopard) that was breaking fullscreen.

2.0.1 (2010-11-22)

- Fix: Issue with big play button when multiple videos are on the page.
- Fix: Optimized play progress tracking.
- Fix: Optimized buffer progress checking.
- Fix: Firefox not showing Flash fallback object.

2.0.0 (2010-11-21)

- Feature: Created "behaviors" concept for adding behaviors to elements
- Feature: Switched back to divs for controls, for more portable styles
- Feature: Created playerFallbackOrder array option. ["html5", "flash", "links"]
- Feature: Created playerType concept, for initializing different platforms
- Feature: Added play button for Android
- Feature: Added spinner for iPad (non-fullscreen)
- Feature: Split into multiple files for easier development
- Feature: Combined VideoJS & _V_ into the same variable to reduce confusion
- Fix: Checking for m3u8 files (Apple HTTP Streaming)
- Fix: Catching error on localStorage full that safari seems to randomly throw
- Fix: Scrubbing to end doesn't trigger onEnded

1.1.5 (2010-11-09)

- Feature: Switched to track method for setting subtitles. Now works like spec.
- Feature: Created "players" concept for defining fallbacks and fallback order
- Fix: Android playback bug.
- Fix: Massive reorganization of code to make easier to navigate

1.1.4 (2010-11-06)

- Feature: Added loading spinner.
- Feature: Improved styles loaded checking.
- Feature: Added volume() function to get and set volume through the player.
- Fix: Fix issue where FF would loop video in background when ended.
- Fix: Bug in Chrome that shows poster & plays audio if you set currentTime too quickly.
- Fix: Bug in Safari where waiting is triggered and shows spinner when not needed
- Fix: Updated to show links if only unplayable sources and no Flash.
- Fix: Issue where if play button was loaded after play, it wouldn't hide.

1.1.3 (2010-10-19)

- Feature: Width/Height functions for resizing the player
- Feature: Made initial click & hold trigger new value on progress and volume
- Feature: Made controls not hide when hovering over them
- Feature: Added big play button as default starting control.
- Fix: Removed trailing comma that was breaking IE7
- Fix: Removed some vars from global scope
- Fix: Changed a document.onmousemove to an eventListener to prevent conflicts
- Fix: Added a unique ID to FlowPlayer demo object to fix a FlowPlayer bug. Thanks @emirpprime.
- Fix: Safari error on unloaded video

1.1.2 (2010-09-20)

- Added a fix for the poster bug in iPad/iPhone
- Added more specificity to styles

1.1.1 (2010-09-14)

- First Formally Versioned Release

1.0.0 (2010-05-18)

- First released
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit ef321a8

Please sign in to comment.