Permalink
Browse files

MAJOR REFACTOR: Restrcutured code into class-based components. Setup …

…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...
1 parent a314c0a commit ef321a807237ee512af0ec3ab16d6b9e378b7b37 Steve Heffernan committed Nov 29, 2011
Showing with 2,315 additions and 6,436 deletions.
  1. +10 −138 README.md
  2. +41 −0 build.sh
  3. 0 {dev → }/build/Create Release Notes.md
  4. +9 −8 {dev → }/build/combine_sources.sh
  5. +153 −0 build/files/README.md
  6. 0 { → build/files}/demo.html
  7. 0 {dev → }/compare/compare.css
  8. +4 −2 {dev → }/compare/compare.html
  9. +2 −2 {dev → }/compare/compare.js
  10. 0 {dev → }/decisions.txt
  11. 0 {dev → }/demo-subtitles.srt
  12. BIN {dev → }/design/Icon Design.png
  13. 0 {dev → }/design/skin.old.css
  14. 0 {dev → }/design/video-js.css
  15. BIN {dev → }/design/video-js.png
  16. +6 −28 {dev → }/dev.html
  17. +0 −298 dev/src/api.js
  18. +0 −37 dev/src/autoload.js
  19. +0 −312 dev/src/behaviors/behaviors.js
  20. +0 −216 dev/src/behaviors/seekBar.js
  21. +0 −43 dev/src/behaviors/texttrackdisplays.js
  22. +0 −177 dev/src/behaviors/volume.js
  23. +0 −153 dev/src/controls/bar.js
  24. +0 −52 dev/src/controls/bigPlay.js
  25. +0 −157 dev/src/controls/controls.html
  26. +0 −134 dev/src/controls/main.js
  27. +0 −22 dev/src/controls/subtitlesBox.js
  28. +0 −451 dev/src/core.js
  29. +0 −15 dev/src/log.js
  30. +0 −153 dev/src/tech/h5swf.js
  31. +0 −170 dev/src/tech/html5.js
  32. +0 −262 dev/src/ui.js
  33. 0 {dev → }/flash/swfobject.js
  34. BIN dev/flash/VideoJS.swf → flash/video-js.swf
  35. 0 {dev → }/src/_begin.js
  36. +3 −0 {dev → }/src/_end.js
  37. +183 −0 src/component.js
  38. +725 −0 src/controls.js
  39. +146 −0 src/core.js
  40. 0 {dev → }/src/ecma.js
  41. +1 −1 {dev → }/src/events.js
  42. 0 {dev → }/src/json.js
  43. +37 −13 {dev → }/src/lib.js
  44. +607 −0 src/player.js
  45. +382 −0 src/tech.js
  46. +2 −1 {dev → }/src/tracks.js
  47. +2 −0 {dev/src → }/tech/flowplayer.js
  48. 0 {dev/src → }/tech/youtube.html
  49. +2 −0 {dev/src → }/tech/youtube.js
  50. 0 {dev → }/test/qunit/.gitignore
  51. 0 {dev → }/test/qunit/README.md
  52. 0 {dev → }/test/qunit/addons/canvas/README.md
  53. 0 {dev → }/test/qunit/addons/canvas/canvas-test.js
  54. 0 {dev → }/test/qunit/addons/canvas/canvas.html
  55. 0 {dev → }/test/qunit/addons/canvas/qunit-canvas.js
  56. 0 {dev → }/test/qunit/addons/close-enough/README.md
  57. 0 {dev → }/test/qunit/addons/close-enough/close-enough-test.js
  58. 0 {dev → }/test/qunit/addons/close-enough/close-enough.html
  59. 0 {dev → }/test/qunit/addons/close-enough/qunit-close-enough.js
  60. 0 {dev → }/test/qunit/addons/composite/README.md
  61. 0 {dev → }/test/qunit/addons/composite/composite-demo-test.html
  62. 0 {dev → }/test/qunit/addons/composite/composite-test.html
  63. 0 {dev → }/test/qunit/addons/composite/composite-test.js
  64. 0 {dev → }/test/qunit/addons/composite/dummy-qunit-test.html
  65. 0 {dev → }/test/qunit/addons/composite/dummy-same-test.html
  66. 0 {dev → }/test/qunit/addons/composite/index.html
  67. 0 {dev → }/test/qunit/addons/composite/qunit-composite.css
  68. 0 {dev → }/test/qunit/addons/composite/qunit-composite.js
  69. 0 {dev → }/test/qunit/addons/step/README.md
  70. 0 {dev → }/test/qunit/addons/step/qunit-step.js
  71. 0 {dev → }/test/qunit/addons/step/step-test.js
  72. 0 {dev → }/test/qunit/addons/step/step.html
  73. 0 {dev → }/test/qunit/package.json
  74. 0 {dev → }/test/qunit/qunit/qunit.css
  75. 0 {dev → }/test/qunit/qunit/qunit.js
  76. 0 {dev → }/test/qunit/test/headless.html
  77. 0 {dev → }/test/qunit/test/index.html
  78. 0 {dev → }/test/qunit/test/logs.html
  79. 0 {dev → }/test/qunit/test/logs.js
  80. 0 {dev → }/test/qunit/test/same.js
  81. 0 {dev → }/test/qunit/test/test.js
  82. 0 {dev → }/test/test.html
  83. 0 {dev → }/test/test.js
  84. +0 −307 video-js.css
  85. BIN video-js.png
  86. BIN video-js.swf
  87. +0 −3,284 video.js
View
148 README.md
@@ -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:
@@ -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
View
@@ -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.
@@ -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
@@ -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
View
@@ -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.
Oops, something went wrong.

0 comments on commit ef321a8

Please sign in to comment.