Permalink
Browse files

Merge branch 'feature/component-docs'

Conflicts:
	src/player.js
  • Loading branch information...
2 parents 77d9d34 + 6ad5e0d commit 6623919429999554aaffb986f52b9310a97cd10a Steve Heffernan committed Jan 15, 2013
Showing with 8,863 additions and 8,726 deletions.
  1. +4 −1 .gitignore
  2. +8 −4 .jshintrc
  3. +159 −0 CONTRIBUTING.md
  4. +138 −0 Gruntfile.js
  5. +0 −10 Makefile
  6. +17 −2 README.md
  7. +0 −206 Rakefile
  8. +202 −0 build/compiler/COPYING
  9. +292 −0 build/compiler/README
  10. BIN build/compiler/compiler.jar
  11. +0 −20 build/release-files/youtube.html
  12. BIN design/Icon Design.png
  13. BIN design/loading.gif
  14. +0 −190 design/skin.old.css
  15. +0 −54 dev.html.example
  16. +0 −17 dev/build-source-list.rb
  17. 0 dev/include-sources.js
  18. +0 −31 dev/require-list.js
  19. +0 −2,144 dev/require.js
  20. +0 −13 dev/source-list.html
  21. +0 −13 dev/source-list.js
  22. +1 −26 docs/api.md
  23. +82 −2 docs/components.md
  24. +10 −10 docs/setup.md
  25. +29 −16 package.json
  26. +53 −0 sandbox/index.html.example
  27. +0 −24 src/_begin.js
  28. +0 −6 src/_end.js
  29. +0 −247 src/component.js
  30. +0 −853 src/controls.js
  31. +0 −116 src/core.js
  32. +2 −2 {design → src/css}/video-js.css
  33. BIN src/css/video-js.fw.png
  34. BIN {design → src/css}/video-js.png
  35. +0 −308 src/events.js
  36. +598 −0 src/js/component.js
  37. +1,002 −0 src/js/controls.js
  38. +104 −0 src/js/core.js
  39. +322 −0 src/js/events.js
  40. +131 −0 src/js/exports.js
  41. +1,574 −0 src/js/goog.base.js
  42. +61 −0 src/js/json.js
  43. +542 −0 src/js/lib.js
  44. +27 −0 src/js/media.flash.externs.js
  45. +468 −0 src/js/media.flash.js
  46. +247 −0 src/js/media.html5.js
  47. +59 −0 src/js/media.js
  48. +886 −0 src/js/player.js
  49. +25 −15 src/{ → js}/setup.js
  50. +1,025 −0 src/js/tracks.js
  51. +0 −54 src/json.js
  52. +0 −346 src/lib.js
  53. +0 −927 src/player.js
  54. BIN {tech/flash → src/swf}/video-js.swf
  55. +0 −29 src/tech.js
  56. +0 −780 src/tracks.js
  57. +0 −444 tech/flash/flash.js
  58. +0 −4 tech/flash/swfobject.js
  59. +0 −228 tech/html5/html5.js
  60. +0 −603 tech/vimeo/vimeo.js
  61. +0 −39 tech/youtube/youtube.html
  62. +0 −369 tech/youtube/youtube.js
  63. +59 −0 test/index.html
  64. +0 −42 test/integration.html
  65. +0 −304 test/integration/test.js
  66. +0 −63 test/phantom.js
  67. 0 test/{vendor → }/qunit/.gitignore
  68. 0 test/{vendor → }/qunit/README.md
  69. 0 test/{vendor → }/qunit/addons/canvas/README.md
  70. 0 test/{vendor → }/qunit/addons/canvas/canvas-test.js
  71. 0 test/{vendor → }/qunit/addons/canvas/canvas.html
  72. 0 test/{vendor → }/qunit/addons/canvas/qunit-canvas.js
  73. 0 test/{vendor → }/qunit/addons/close-enough/README.md
  74. 0 test/{vendor → }/qunit/addons/close-enough/close-enough-test.js
  75. 0 test/{vendor → }/qunit/addons/close-enough/close-enough.html
  76. 0 test/{vendor → }/qunit/addons/close-enough/qunit-close-enough.js
  77. 0 test/{vendor → }/qunit/addons/composite/README.md
  78. 0 test/{vendor → }/qunit/addons/composite/composite-demo-test.html
  79. 0 test/{vendor → }/qunit/addons/composite/composite-test.html
  80. 0 test/{vendor → }/qunit/addons/composite/composite-test.js
  81. 0 test/{vendor → }/qunit/addons/composite/dummy-qunit-test.html
  82. 0 test/{vendor → }/qunit/addons/composite/dummy-same-test.html
  83. 0 test/{vendor → }/qunit/addons/composite/index.html
  84. 0 test/{vendor → }/qunit/addons/composite/qunit-composite.css
  85. 0 test/{vendor → }/qunit/addons/composite/qunit-composite.js
  86. 0 test/{vendor → }/qunit/addons/step/README.md
  87. 0 test/{vendor → }/qunit/addons/step/qunit-step.js
  88. 0 test/{vendor → }/qunit/addons/step/step-test.js
  89. 0 test/{vendor → }/qunit/addons/step/step.html
  90. 0 test/{vendor → }/qunit/package.json
  91. +84 −0 test/qunit/qunit-externs.js
  92. 0 test/{vendor → }/qunit/qunit/qunit.css
  93. 0 test/{vendor → }/qunit/qunit/qunit.js
  94. 0 test/{vendor → }/qunit/test/headless.html
  95. 0 test/{vendor → }/qunit/test/index.html
  96. 0 test/{vendor → }/qunit/test/logs.html
  97. 0 test/{vendor → }/qunit/test/logs.js
  98. 0 test/{vendor → }/qunit/test/same.js
  99. 0 test/{vendor → }/qunit/test/test.js
  100. +0 −14 test/server.js
  101. +0 −48 test/unit.html
  102. +101 −22 test/unit/component.js
  103. +0 −1 test/unit/controls.js
  104. +29 −1 test/unit/core.js
  105. +74 −1 test/unit/events.js
  106. +156 −41 test/unit/lib.js
  107. +1 −0 test/unit/media.html5.js
  108. +0 −21 test/unit/phantom-logging.js
  109. +173 −12 test/unit/player.js
  110. +1 −1 test/unit/setup.js
  111. +0 −1 test/unit/tech.js
  112. +0 −1 test/unit/tracks.js
  113. +117 −0 test/video.test.js
View
@@ -3,6 +3,9 @@ dist/*
dev.html
projects
.zenflow-log
+test/*.map
node_modules
-npm-debug.log
+npm-debug.log
+sandbox/*
+!sandbox/*.example
View
@@ -1,16 +1,20 @@
{
+ "evil" : true,
"validthis": true,
"browser" : true,
"debug" : true,
"boss" : true,
"expr" : true,
"eqnull" : true,
- "quotmark" : "double",
+ "quotmark" : "single",
"sub" : true,
"trailing" : true,
"undef" : true,
- "predef" : [ // Extra globals.
+ "laxbreak" : true,
+ "predef" : [
"_V_",
- "VideoJS"
+ "videojs",
+ "vjs",
+ "goog"
]
-}
+}
View
@@ -0,0 +1,159 @@
+So you're telling me you want to spend some of your precious time giving back to this humble project? You're crazy. But since you're here...there are some ways you can help make Video.js a faster, easier, more compatible, and more fully-featured video player.
+
+ * Bug reports and fixes
+ * Features and changes (pull requests)
+ * [Answer questions](http://stackoverflow.com/questions/tagged/video.js) on Stack Overflow
+ * Other Video.js projects
+
+Don't miss the [code style guide](#code-style).
+
+# Getting started
+
+1. [Download and install Node.js](http://nodejs.org/download/). Video.js uses Node for build and test automation.
+
+2. [Fork](http://help.github.com/fork-a-repo/) and clone the video.js git repository.
+
+```bash
+# Clones your fork of the repo into the current directory in terminal
+git clone https://github.com/<your-username>/video-js.git
+# Navigate to the newly cloned directory
+cd video-js
+# Assigns the original repo to a remote called "upstream"
+git remote add upstream https://github.com/zencoder/video-js.git
+```
+
+In the future, if you want to pull in updates to video.js that happened after you cloned the main repo, you can run:
+
+```bash
+git checkout master
+git pull upstream master
+```
+
+3. Install required node.js modules using node package manager.
+
+```bash
+npm install
+```
+
+4. Build a local copy. Video.js uses [grunt](http://gruntjs.com), a node-based task automation tool for building and tesing. The following will compile a local copy in the dist/ directory and run tests. It will also create a sourcelist.js file that can be used to load the video.js source scripts in a page.
+
+```bash
+grunt
+```
+
+5. When you're ready to add a feature, make a change, or fix a bug, first create a new branch for it. Prefix the branch with the correspoding [issue number](https://github.com/zencoder/video-js/issues). If there isn't one, submit a new issue. Anything more complicated than simple docs changes should have an issue.
+
+```bash
+git checkout -b <####-branch-name>
+```
+
+# Bugs
+
+A bug is a _demonstrable problem_ that is caused by the code in the
+repository. Good bug reports are extremely helpful - thank you!
+
+Guidelines for bug reports:
+
+1. **Use the [GitHub issue search](https://github.com/zencoder/video-js/issues)** &mdash; check if the issue has already been reported.
+
+2. **Check if the issue has been fixed** &mdash; try to reproduce it using the latest `master` branch in the repository.
+
+3. **Isolate the problem** &mdash; ideally create a [reduced test
+ case](http://css-tricks.com/6263-reduced-test-cases/) and a live example.
+
+A good bug report shouldn't leave others needing to chase you up for more information. Please try to be as detailed as possible in your report. What is your environment? What steps will reproduce the issue? What browser(s), OS, and devices experience the problem? What would you expect to be the outcome? All these
+details will help people to fix any potential bugs.
+
+Example:
+
+> Short and descriptive example bug report title
+>
+> A summary of the issue and the browser/OS environment in which it occurs. If
+> suitable, include the steps required to reproduce the bug.
+>
+> 1. This is the first step
+> 2. This is the second step
+> 3. Further steps, etc.
+>
+> `<url>` (a link to the reduced test case)
+>
+> Any other information you want to share that is relevant to the issue being
+> reported. This might include the lines of code that you have identified as
+> causing the bug, and potential solutions (and your opinions on their
+> merits).
+
+**[File a bug report](https://github.com/h5bp/html5-boilerplate/issues/)**
+
+## Pull requests
+
+Good pull requests - patches, improvements, new features - are a fantastic help. They should remain focused in scope and avoid containing unrelated commits. If your contribution involves a significant amount of work or substantial changes to any part of the project, please open an issue to discuss it first.
+
+Make sure to adhere to the coding conventions used throughout a project (indentation, accurate comments, etc.). Please update any documentation that is relevant to the change you're making.
+
+Please follow this process; it's the best way to get your work included in the project:
+
+1. [Fork](http://help.github.com/fork-a-repo/) the project, clone your fork, and configure the remotes:
+
+ ```bash
+ # Clones your fork of the repo into the current directory in terminal
+ git clone https://github.com/<your-username>/html5-boilerplate.git
+ # Navigate to the newly cloned directory
+ cd html5-boilerplate
+ # Assigns the original repo to a remote called "upstream"
+ git remote add upstream https://github.com/h5bp/html5-boilerplate.git
+ ```
+
+2. If you cloned a while ago, get the latest changes from upstream:
+
+ ```bash
+ git checkout master
+ git pull upstream master
+ ```
+
+3. Create a new topic branch to contain your feature, change, or fix:
+
+ ```bash
+ git checkout -b <topic-branch-name>
+ ```
+
+4. Commit your changes in logical chunks. Please adhere to these [git commit message guidelines](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html) or your pull request is unlikely be merged into the main project. Use git's [interactive rebase](https://help.github.com/articles/interactive-rebase) feature to tidy up your commits before making them public.
+
+5. Locally merge (or rebase) the upstream development branch into your topic branch:
+
+ ```bash
+ git pull [--rebase] upstream master
+ ```
+
+6. Push your topic branch up to your fork:
+
+ ```bash
+ git push origin <topic-branch-name>
+ ```
+
+10. [Open a Pull Request](http://help.github.com/send-pull-requests/) with a clear title and description.
+
+# Code Style
+Please follow [Google's JavaScript Style Guide](http://google-styleguide.googlecode.com/svn/trunk/javascriptguide.xml) to the letter. If your editor supports [.editorconfig](http://editorconfig.org/#download) it will make it easier to manage differences from your own coding style.
+
+### Style examples include:
+* Two space indents.
+* Delimit strings with single-quotes `'`, not double-quotes `"`.
+* No trailing whitespace, except in markdown files where a linebreak must be forced.
+* No more than [one assignment](http://benalman.com/news/2012/05/multiple-var-statements-javascript/) per `var` statement.
+* Prefer `if` and `else` to ["clever"](http://programmers.stackexchange.com/a/25281) uses of `? :` conditional or `||`, `&&` logical operators.
+* **When in doubt, follow the conventions you see used in the source already.**
+
+If you happen to find something in the codebase that does not follow the style guide, that's a good opportunity to make your first contribution!
+
+# Other Video.js Pojects
+* [Video.js SWF](https://github.com/zencoder/video-js-swf) - The light-weight flash video player that makes flash work like HTML5 video. This allows player skins, plugins, and other features to work with both HTML5 and Flash.
+
+* [Videojs.com](http://videojs.com) - The public site with helpful tools and information about Video.js.
+
+---
+### Doc Credit
+This doc was inspired by some great contribution guide examples including [contribute.md template](https://github.com/contribute-md/contribute-md-template),
+[grunt](https://github.com/gruntjs/grunt/wiki/Contributing),
+[html5 boilerplate](https://github.com/h5bp/html5-boilerplate/blob/master/CONTRIBUTING.md),
+[jquery](https://github.com/jquery/jquery/blob/master/CONTRIBUTING.md),
+and [node.js](https://github.com/joyent/node/wiki/Contributing).
View
@@ -0,0 +1,138 @@
+module.exports = function(grunt) {
+
+ // Project configuration.
+ grunt.initConfig({
+ pkg: grunt.file.readJSON('package.json'),
+ build: {
+ dist:{}
+ },
+ // Current forEach issue: https://github.com/gruntjs/grunt/issues/610
+ // npm install https://github.com/gruntjs/grunt-contrib-jshint/archive/7fd70e86c5a8d489095fa81589d95dccb8eb3a46.tar.gz
+ jshint: {
+ src: {
+ src: ["src/js/*.js"],
+ options: {
+ jshintrc: ".jshintrc"
+ }
+ }
+ },
+ compile: {
+ dist:{
+ sourcelist: 'dist/sourcelist.txt',
+ externs: ['src/js/media.flash.externs.js'],
+ dest: 'dist/video.js'
+ },
+ test: {
+ sourcelist: 'dist/sourcelist.txt',
+ src: ['test/unit/*.js'],
+ externs: ['src/js/media.flash.externs.js', 'test/qunit/qunit-externs.js'],
+ dest: 'test/video.test.js'
+ }
+ },
+ dist: {
+ latest:{}
+ },
+ qunit: {
+ all: ['test/index.html'],
+ },
+ watch: {
+ files: [ "src/**/*.js" ],
+ tasks: "dev"
+ }
+
+ });
+
+ grunt.loadNpmTasks("grunt-contrib-jshint");
+ grunt.loadNpmTasks("grunt-contrib-qunit");
+ grunt.loadNpmTasks("grunt-contrib-watch");
+
+ // Default task.
+ grunt.registerTask('default', ['build', 'jshint', 'compile', 'dist']);
+ // Development watch task
+ grunt.registerTask('dev', ['jshint','build']);
+
+ grunt.registerTask('test', ['jshint','build','qunit']);
+
+ var fs = require('fs'),
+ gzip = require('zlib').gzip;
+
+ grunt.registerMultiTask('build', 'Building Source', function(){
+ var calcdeps = require('calcdeps').calcdeps;
+ // caclcdeps is async
+ var done = this.async();
+
+ // In current version of calcdeps, not supplying certain
+ // options that should have defaults causes errors
+ // so we have all options listed here with their defaults.
+ calcdeps({
+ input: ['src/js/exports.js'],
+ path:['src/js/'],
+ dep:[],
+ exclude:[],
+ output_mode:'list',
+ }, function(err,results){
+ if (err) {
+ grunt.warn({ message: err })
+ grunt.log.writeln(err);
+ done(false);
+ }
+
+ if (results) {
+ grunt.file.write('dist/sourcelist.txt', results.join(','));
+ grunt.file.write('dist/sourcelist.js', 'var sourcelist = ["' + results.join('","') + '"]');
+ }
+
+ done();
+ });
+ });
+
+ grunt.registerMultiTask('compile', 'Minify JS files using Closure Compiler.', function() {
+ var done = this.async();
+ var exec = require('child_process').exec;
+
+ var externs = this.file.externs || [];
+ var dest = this.file.dest;
+ var files = [];
+ if (this.data.sourcelist) {
+ files = files.concat(grunt.file.read(this.data.sourcelist).split(','))
+ }
+ if (this.file.src) {
+ files = files.concat(this.file.src);
+ }
+
+ var command = 'java -jar build/compiler/compiler.jar'
+ + ' --compilation_level ADVANCED_OPTIMIZATIONS'
+ // + ' --formatting=pretty_print'
+ + ' --js_output_file=' + dest
+ + ' --create_source_map ' + dest + '.map --source_map_format=V3'
+ + ' --output_wrapper "(function() {%output%})();//@ sourceMappingURL=video.js.map"';
+
+ files.forEach(function(file){
+ command += ' --js='+file;
+ });
+
+ externs.forEach(function(extern){
+ command += ' --externs='+extern;
+ });
+
+ // grunt.log.writeln(command)
+
+ exec(command, { maxBuffer: 500*1024 }, function(err, stdout, stderr){
+
+ if (err) {
+ grunt.warn(err);
+ done(false);
+ }
+
+ if (stdout) {
+ grunt.log.writeln(stdout);
+ }
+
+ done();
+ });
+ });
+
+ grunt.registerMultiTask('dist', 'Creating distribution', function(){
+
+ });
+};
View
@@ -1,10 +0,0 @@
-# Using makefile temporarily to run tests on Travis CI
-
-test:
- # jshint src/*.js --config .jshintrc
- node test/server.js &
- phantomjs test/phantom.js "http://localhost:3000/test/unit.html"
- kill -9 `cat test/pid.txt`
- rm test/pid.txt
-
-.PHONY: test
View
@@ -1,8 +1,16 @@
-[Video.js - HTML5 Video Player](http://videojs.com) [![Build Status](https://travis-ci.org/zencoder/video-js.png?branch=master)](https://travis-ci.org/zencoder/video-js)
+[Video.js - HTML5 and Flash Video Player](http://videojs.com) [![Build Status](https://travis-ci.org/zencoder/video-js.png?branch=master)](https://travis-ci.org/zencoder/video-js)
==================================================
Visit the main site at [videojs.com](http://videojs.com) for download options and instructions.
+Video.js was built to provide a fast and easy way to embed and work with video in a web page. It was built from the ground up with the assumption that HTML5 is the future of web video, however it supports Flash equally well for older browsers and for advanced features not yet supported in HTML5.
+
+Some of the focuses of Video.js are:
+- Universal browser and device support
+- Easily skinned (themed/chromed) using just CSS
+- A JavaScript API for controlling the video that works consistently across video platforms (HTML5, Flash, and others) as well as devices
+- A common skin and API between HTML5, Flash, and potentially other players like YouTube
+
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.
@@ -17,7 +25,7 @@ cp dev.html.example dev.html
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
+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.
@@ -27,3 +35,10 @@ 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.
---
+
+TESTING FLASH LOCALLY IN CHROME
+-------------------------------
+Chrome 21+ (as of 2013/01/01) doens't run Flash files that are local and loaded into a locally accessed page (file:///). To get around this you need to [disable the version of Flash](http://helpx.adobe.com/flash-player/kb/flash-player-google-chrome.html#How_can_I_run_debugger_or_alternate_versions_of_Flash_Player_in_Google_Chrome) included with Chrome and enable a system-wide version of Flash.
+
+
+
Oops, something went wrong.

0 comments on commit 6623919

Please sign in to comment.