diff --git a/.bunyipconfig.js.example b/.bunyipconfig.js.example new file mode 100644 index 000000000..672db7310 --- /dev/null +++ b/.bunyipconfig.js.example @@ -0,0 +1,21 @@ +/* +Bunyip is a tool for multi-browser/device testing + https://github.com/ryanseddon/bunyip +It uses a few service under the hood including: + Browsertack - http://browserstack.com + Pagekite https://pagekite.net +You'll need accounts at both to use bunyip +You'll also need to download and install pagekite.py +*/ +var config = { + "browserstack": { + "username": "your-browserstack-email@example.com", + "password": "your browserstack password", + "timeout": 300 + }, + "port": 9000, + "tunnellink": "your-subdomain.pagekite.me", + "tunnel": "pagekite.py your-subdomain.pagekite.me" +}; + +module.exports = config; diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 000000000..d36ec3211 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,11 @@ +# editorconfig.org - unify code style +# plugins for text editors: editorconfig.org/#download +root = true + +[*] +indent_style = space +indent_size = 2 +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true \ No newline at end of file diff --git a/.gitignore b/.gitignore index d31b48e9e..257ba7713 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,20 @@ .DS_Store dist/* +build/files/* dev.html projects -.zenflow-log \ No newline at end of file +.zenflow-log +test/*.map +.bunyipconfig.js +.s3config.json + +node_modules +npm-debug.log + +sandbox/* +!sandbox/*.example + +*.swp +*.swo + +*.orig diff --git a/.jshintrc b/.jshintrc new file mode 100644 index 000000000..f7c8ed1db --- /dev/null +++ b/.jshintrc @@ -0,0 +1,40 @@ +{ + "evil" : true, + "validthis": true, + "browser" : true, + "debug" : true, + "boss" : true, + "expr" : true, + "eqnull" : true, + "quotmark" : "single", + "sub" : true, + "trailing" : true, + "undef" : true, + "laxbreak" : true, + "predef" : [ + "_V_", + "videojs", + "vjs", + "goog", + "console", + + "require", + + "PlayerTest", + "asyncTest", + "deepEqual", + "equal", + "expect", + "module", + "notDeepEqual", + "notEqual", + "notStrictEqual", + "ok", + "QUnit", + "raises", + "start", + "stop", + "strictEqual", + "test" + ] +} diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 000000000..c2ba3f90b --- /dev/null +++ b/.travis.yml @@ -0,0 +1,3 @@ +language: node_js +node_js: + - 0.8 \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 016caec99..872db3b5c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,15 @@ +* Added a plugins interface +* Added automated test suite and support for Travis CI. +* Updated docs to use Github markdown +* Allow disabling of default components +* Duration is now setable (need ed for HLS m3u8 files) +* Event binders (on/off/one) now return the player instance +* Stopped player from going back to beginningg on ended event. +* Added support for percent width/height and fluid layouts +* Improved load order of elements to reduce reflow. +* Changed addEvent function name to 'on'. +* Removed conflicting array.indexOf function +* Added exitFullScreen to support BlackBerry devices (pull/143) -------------------------------------------------------------------------------- ^ ADD NEW CHANGES ABOVE ^ -------------------------------------------------------------------------------- diff --git a/CHANGELOG2.md b/CHANGELOG2.md new file mode 100644 index 000000000..0a2f4e7cc --- /dev/null +++ b/CHANGELOG2.md @@ -0,0 +1,50 @@ + +``` +^ NEW CHANGES ABOVE ^ +``` + +CHANGELOG +========= + +#### 3.2.3 (2013-05-03) +* test line +* Added a plugins interface +* Added automated test suite and support for Travis CI. +* Updated docs to use Github markdown +* Allow disabling of default components +* Duration is now setable (need ed for HLS m3u8 files) +* Event binders (on/off/one) now return the player instance +* Stopped player from going back to beginningg on ended event. +* Added support for percent width/height and fluid layouts +* Improved load order of elements to reduce reflow. +* Changed addEvent function name to 'on'. +* Removed conflicting array.indexOf function +* Added exitFullScreen to support BlackBerry devices (pull/143) + +## 5.0.0 (2013-02-02) +* Added a plugins interface ([261f2072](https://github.com/angular-ui/bootstrap/commit/261f2072)) +* Added automated test suite and support for Travis CI. +* Updated docs to use Github markdown +* Allow disabling of default components + +#### 4.1.2 (2013-02-02) +* Added a plugins interface ([261f2072](https://github.com/angular-ui/bootstrap/commit/261f2072)) + +### 4.1.0 (2013-02-02) +* Added a plugins interface ([261f2072](https://github.com/angular-ui/bootstrap/commit/261f2072)) +* Added automated test suite and support for Travis CI. +* Updated docs to use Github markdown +* Allow disabling of default components + +#### 4.0.2 (2013-02-02) +* Added a plugins interface ([261f2072](https://github.com/angular-ui/bootstrap/commit/261f2072)) + +#### 4.0.1 (2013-02-02) +* Added a plugins interface ([261f2072](https://github.com/angular-ui/bootstrap/commit/261f2072)) + +## 4.0.0 (2013-02-02) +* Added a plugins interface ([261f2072](https://github.com/angular-ui/bootstrap/commit/261f2072)) +* Added automated test suite and support for Travis CI. +* Updated docs to use Github markdown +* Allow disabling of default components + diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 000000000..1254425e3 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,176 @@ +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. + There is a known issue between Node.js version 0.10.x and phantomjs. This will manifest itself during the node module installation (see step 4 below). For the time being, please install Node.js version 0.8.22 or earlier. You can find earlier versions of Node.js [here](http://nodejs.org/dist/). + +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//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 the grunt-cli package so that you will have the correct version of grunt available from any project that needs it. This should be done as a global install: + + ```bash + npm install -g grunt-cli + ``` + +4. Install required node.js modules using node package manager. + + ```bash + npm install + ``` + +5. 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 + ``` + +6. 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> + ``` + +Be sure to reference your issue in any commit message. Github allows you to do this though the [fixes or closes](https://github.com/blog/831-issues-2-0-the-next-generation) keywords. + + ```bash + My commit message. fixes #123 + ``` + +# 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)** — check if the issue has already been reported. + +2. **Check if the issue has been fixed** — try to reproduce it using the latest `master` branch in the repository. + +3. **Isolate the problem** — 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. +> +> `` (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/)** + +### NOTE: 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. + + +## 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//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 + ``` + +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 + ``` + +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). diff --git a/Gruntfile.js b/Gruntfile.js new file mode 100644 index 000000000..c7be53277 --- /dev/null +++ b/Gruntfile.js @@ -0,0 +1,256 @@ +module.exports = function(grunt) { + var pkg, s3, semver, version, verParts; + + semver = require('semver'); + pkg = grunt.file.readJSON('package.json'); + + try { + s3 = grunt.file.readJSON('.s3config.json'); + } catch(e) { + s3 = {}; + } + + verParts = pkg.version.split('.'); + version = { + full: pkg.version, + major: verParts[0], + minor: verParts[1], + patch: verParts[2] + }; + version.majorMinor = version.major + '.' + version.minor; + + // Project configuration. + grunt.initConfig({ + pkg: pkg, + + build: { + src: 'src/js/dependencies.js', + options: { + baseDir: 'src/js/' + } + }, + clean: { + build: ['build/files/*'], + dist: ['dist/*'] + }, + jshint: { + src: { + src: ['src/js/*.js', 'Gruntfile.js', 'test/unit/*.js'], + options: { + jshintrc: '.jshintrc' + } + } + }, + minify: { + source:{ + src: ['build/files/combined.video.js', 'build/compiler/goog.base.js', 'src/js/exports.js'], + externs: ['src/js/media/flash.externs.js'], + dest: 'build/files/minified.video.js' + }, + tests: { + src: ['build/files/combined.video.js', 'build/compiler/goog.base.js', 'src/js/exports.js', 'test/unit/*.js', '!test/unit/api.js'], + externs: ['src/js/media/flash.externs.js', 'test/qunit/qunit-externs.js'], + dest: 'build/files/test.minified.video.js' + } + }, + dist: {}, + qunit: { + source: ['test/index.html'], + minified: ['test/minified.html'], + minified_api: ['test/minified-api.html'] + }, + watch: { + files: [ 'src/**/*.js', 'test/unit/*.js' ], + tasks: 'dev' + }, + copy: { + minor: { + files: [ + {expand: true, cwd: 'build/files/', src: ['*'], dest: 'dist/'+version.majorMinor+'/', filter: 'isFile'} // includes files in path + ] + }, + patch: { + files: [ + {expand: true, cwd: 'build/files/', src: ['*'], dest: 'dist/'+version.full+'/', filter: 'isFile'} // includes files in path + ] + } + }, + s3: { + options: s3, + prod: { + // Files to be uploaded. + upload: [ + { + src: 'dist/cdn/*', + dest: 'vjs/'+version.full+'/', + rel: 'dist/cdn/', + headers: { + 'Cache-Control': 'public, max-age=31536000' + } + }, + { + src: 'dist/cdn/*', + dest: 'vjs/'+version.majorMinor+'/', + rel: 'dist/cdn/', + headers: { + 'Cache-Control': 'public, max-age=2628000' + } + } + ] + } + } + }); + + grunt.loadNpmTasks('grunt-contrib-jshint'); + grunt.loadNpmTasks('grunt-contrib-qunit'); + grunt.loadNpmTasks('grunt-contrib-watch'); + grunt.loadNpmTasks('grunt-contrib-clean'); + grunt.loadNpmTasks('grunt-contrib-copy'); + grunt.loadNpmTasks('grunt-s3'); + grunt.loadNpmTasks('contribflow'); + + // Default task. + grunt.registerTask('default', ['jshint', 'build', 'minify', 'dist']); + // Development watch task + grunt.registerTask('dev', ['jshint', 'build', 'qunit:source']); + grunt.registerTask('test', ['jshint', 'build', 'minify', 'qunit']); + + var fs = require('fs'), + gzip = require('zlib').gzip; + + grunt.registerMultiTask('build', 'Building Source', function(){ + /*jshint undef:false, evil:true */ + + // Loading predefined source order from source-loader.js + // Trust me, this is the easist way to do it so far. + var blockSourceLoading = true; + var sourceFiles; // Needed to satisfy jshint + eval(grunt.file.read('./build/source-loader.js')); + + // Fix windows file path delimiter issue + var i = sourceFiles.length; + while (i--) { + sourceFiles[i] = sourceFiles[i].replace(/\\/g, '/'); + } + + // grunt.file.write('build/files/sourcelist.txt', sourceList.join(',')); + // Allow time for people to update their index.html before they remove these + // grunt.file.write('build/files/sourcelist.js', 'var sourcelist = ["' + sourceFiles.join('","') + '"]'); + + // Create a combined sources file. https://github.com/zencoder/video-js/issues/287 + var combined = ''; + sourceFiles.forEach(function(result){ + combined += grunt.file.read(result); + }); + grunt.file.write('build/files/combined.video.js', combined); + + grunt.file.copy('src/css/video-js.css', 'build/files/video-js.css'); + grunt.file.copy('src/css/video-js.png', 'build/files/video-js.png'); + grunt.file.copy('src/swf/video-js.swf', 'build/files/video-js.swf'); + // grunt.file.copy('src/css/font/', 'build/files/font/'); + + grunt.file.recurse('src/css/font', function(absdir, rootdir, subdir, filename) { + // Block .DS_Store files + if ('filename'.substring(0,1) !== '.') { + grunt.file.copy(absdir, 'build/files/font/' + filename); + } + }); + }); + + grunt.registerMultiTask('minify', 'Minify JS files using Closure Compiler.', function() { + var done = this.async(); + var exec = require('child_process').exec; + + var externs = this.data.externs || []; + var dest = this.data.dest; + var filePatterns = []; + + // Make sure deeper directories exist for compiler + grunt.file.write(dest, ''); + + if (this.data.sourcelist) { + filePatterns = filePatterns.concat(grunt.file.read(this.data.sourcelist).split(',')); + } + if (this.data.src) { + filePatterns = filePatterns.concat(this.data.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' + + ' --jscomp_warning=checkTypes --warning_level=VERBOSE' + + ' --output_wrapper "/*! ' + pkg.copyright + ' */\n (function() {%output%})();//@ sourceMappingURL=video.js.map"'; + + grunt.file.expand(filePatterns).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.registerTask('dist', 'Creating distribution', function(){ + var exec = require('child_process').exec; + var done = this.async(); + + grunt.file.copy('build/files/minified.video.js', 'dist/video-js/video.js'); + grunt.file.copy('build/files/combined.video.js', 'dist/video-js/video.dev.js'); + grunt.file.copy('build/files/video-js.css', 'dist/video-js/video-js.css'); + grunt.file.copy('build/files/video-js.swf', 'dist/video-js/video-js.swf'); + grunt.file.copy('build/demo-files/demo.html', 'dist/video-js/demo.html'); + grunt.file.copy('build/demo-files/demo.captions.vtt', 'dist/video-js/demo.captions.vtt'); + + grunt.file.recurse('build/files/font', function(absdir, rootdir, subdir, filename) { + // Block .DS_Store files + if ('filename'.substring(0,1) !== '.') { + grunt.file.copy(absdir, 'dist/video-js/font/' + filename); + } + }); + + // CDN version uses already hosted font files + // Minified version only + // doesn't need demo files + grunt.file.copy('build/files/minified.video.js', 'dist/cdn/video.js'); + grunt.file.copy('build/files/video-js.css', 'dist/cdn/video-js.css'); + grunt.file.copy('build/files/video-js.swf', 'dist/cdn/video-js.swf'); + + + + var css = grunt.file.read('dist/cdn/video-js.css'); + css = css.replace(/font\//g, '../f/1/'); + grunt.file.write('dist/cdn/video-js.css', css); + + exec('cd dist && zip -r video-js-'+version.full+'.zip video-js && cd ..', { maxBuffer: 500*1024 }, function(err, stdout, stderr){ + + if (err) { + grunt.warn(err); + done(false); + } + + if (stdout) { + grunt.log.writeln(stdout); + } + + done(); + }); + }); +}; diff --git a/LGPLv3-LICENSE.txt b/LGPLv3-LICENSE.txt deleted file mode 100644 index 65c5ca88a..000000000 --- a/LGPLv3-LICENSE.txt +++ /dev/null @@ -1,165 +0,0 @@ - GNU LESSER GENERAL PUBLIC LICENSE - Version 3, 29 June 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - - This version of the GNU Lesser General Public License incorporates -the terms and conditions of version 3 of the GNU General Public -License, supplemented by the additional permissions listed below. - - 0. Additional Definitions. - - As used herein, "this License" refers to version 3 of the GNU Lesser -General Public License, and the "GNU GPL" refers to version 3 of the GNU -General Public License. - - "The Library" refers to a covered work governed by this License, -other than an Application or a Combined Work as defined below. - - An "Application" is any work that makes use of an interface provided -by the Library, but which is not otherwise based on the Library. -Defining a subclass of a class defined by the Library is deemed a mode -of using an interface provided by the Library. - - A "Combined Work" is a work produced by combining or linking an -Application with the Library. The particular version of the Library -with which the Combined Work was made is also called the "Linked -Version". - - The "Minimal Corresponding Source" for a Combined Work means the -Corresponding Source for the Combined Work, excluding any source code -for portions of the Combined Work that, considered in isolation, are -based on the Application, and not on the Linked Version. - - The "Corresponding Application Code" for a Combined Work means the -object code and/or source code for the Application, including any data -and utility programs needed for reproducing the Combined Work from the -Application, but excluding the System Libraries of the Combined Work. - - 1. Exception to Section 3 of the GNU GPL. - - You may convey a covered work under sections 3 and 4 of this License -without being bound by section 3 of the GNU GPL. - - 2. Conveying Modified Versions. - - If you modify a copy of the Library, and, in your modifications, a -facility refers to a function or data to be supplied by an Application -that uses the facility (other than as an argument passed when the -facility is invoked), then you may convey a copy of the modified -version: - - a) under this License, provided that you make a good faith effort to - ensure that, in the event an Application does not supply the - function or data, the facility still operates, and performs - whatever part of its purpose remains meaningful, or - - b) under the GNU GPL, with none of the additional permissions of - this License applicable to that copy. - - 3. Object Code Incorporating Material from Library Header Files. - - The object code form of an Application may incorporate material from -a header file that is part of the Library. You may convey such object -code under terms of your choice, provided that, if the incorporated -material is not limited to numerical parameters, data structure -layouts and accessors, or small macros, inline functions and templates -(ten or fewer lines in length), you do both of the following: - - a) Give prominent notice with each copy of the object code that the - Library is used in it and that the Library and its use are - covered by this License. - - b) Accompany the object code with a copy of the GNU GPL and this license - document. - - 4. Combined Works. - - You may convey a Combined Work under terms of your choice that, -taken together, effectively do not restrict modification of the -portions of the Library contained in the Combined Work and reverse -engineering for debugging such modifications, if you also do each of -the following: - - a) Give prominent notice with each copy of the Combined Work that - the Library is used in it and that the Library and its use are - covered by this License. - - b) Accompany the Combined Work with a copy of the GNU GPL and this license - document. - - c) For a Combined Work that displays copyright notices during - execution, include the copyright notice for the Library among - these notices, as well as a reference directing the user to the - copies of the GNU GPL and this license document. - - d) Do one of the following: - - 0) Convey the Minimal Corresponding Source under the terms of this - License, and the Corresponding Application Code in a form - suitable for, and under terms that permit, the user to - recombine or relink the Application with a modified version of - the Linked Version to produce a modified Combined Work, in the - manner specified by section 6 of the GNU GPL for conveying - Corresponding Source. - - 1) Use a suitable shared library mechanism for linking with the - Library. A suitable mechanism is one that (a) uses at run time - a copy of the Library already present on the user's computer - system, and (b) will operate properly with a modified version - of the Library that is interface-compatible with the Linked - Version. - - e) Provide Installation Information, but only if you would otherwise - be required to provide such information under section 6 of the - GNU GPL, and only to the extent that such information is - necessary to install and execute a modified version of the - Combined Work produced by recombining or relinking the - Application with a modified version of the Linked Version. (If - you use option 4d0, the Installation Information must accompany - the Minimal Corresponding Source and Corresponding Application - Code. If you use option 4d1, you must provide the Installation - Information in the manner specified by section 6 of the GNU GPL - for conveying Corresponding Source.) - - 5. Combined Libraries. - - You may place library facilities that are a work based on the -Library side by side in a single library together with other library -facilities that are not Applications and are not covered by this -License, and convey such a combined library under terms of your -choice, if you do both of the following: - - a) Accompany the combined library with a copy of the same work based - on the Library, uncombined with any other library facilities, - conveyed under the terms of this License. - - b) Give prominent notice with the combined library that part of it - is a work based on the Library, and explaining where to find the - accompanying uncombined form of the same work. - - 6. Revised Versions of the GNU Lesser General Public License. - - The Free Software Foundation may publish revised and/or new versions -of the GNU Lesser General Public License from time to time. Such new -versions will be similar in spirit to the present version, but may -differ in detail to address new problems or concerns. - - Each version is given a distinguishing version number. If the -Library as you received it specifies that a certain numbered version -of the GNU Lesser General Public License "or any later version" -applies to it, you have the option of following the terms and -conditions either of that published version or of any later version -published by the Free Software Foundation. If the Library as you -received it does not specify a version number of the GNU Lesser -General Public License, you may choose any version of the GNU Lesser -General Public License ever published by the Free Software Foundation. - - If the Library as you received it specifies that a proxy can decide -whether future versions of the GNU Lesser General Public License shall -apply, that proxy's public statement of acceptance of any version is -permanent authorization for you to choose that version for the -Library. diff --git a/LICENSE b/LICENSE new file mode 100644 index 000000000..138a50e82 --- /dev/null +++ b/LICENSE @@ -0,0 +1,13 @@ +Copyright 2013 Brightcove, Inc. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. \ No newline at end of file diff --git a/README.md b/README.md index aa16d77ab..0d502ef54 100644 --- a/README.md +++ b/README.md @@ -1,30 +1,50 @@ -VideoJS - [HTML5 Video Player](http://videojs.com) -================================================== -Version 3.0 BETA + +# [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. -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. +### PLEASE EXCUSE OUR DUST -Contributing ------------- -If you'd like to help out on VideoJS, you are awesome. Updates should be made to the source files and then make a pull request. +We're finishing up a big overhaul of the libary which includes -When working on VideoJS code, you can use dev.html as your test page. It doesn't exist in the repo and changes to it won't be tracked. To get your own copy simply clone the repo and copy dev.html.example. -cp dev.html.example dev.html +* Closure compiler advanced mode support for drastically better minification over previous versions +* Flashy new automated builds and test using node.js and grunt -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. +Check out our [contributing guide](https://github.com/zencoder/video-js/blob/master/CONTRIBUTING.md) for info on building a local version. ---- -BETA NOTES -Version 3 is almost a complete rewrite of the previous versions of VideoJS. New features includes: +## About - - 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. +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 +- Fast player loading +- Easily skinned (themed/chromed) using just CSS +- A JavaScript API for controlling the video that works consistently across video platforms (HTML5, Flash, and soon other players like youtube) as well as devices + +## Getting Started + +Check out our [getting started guide](http://videojs.com/#section5). + +## Contributing + +Check out our [contributing guide](https://github.com/zencoder/video-js/blob/master/CONTRIBUTING.md). + +## License + +Copyright 2013 Brightcove, Inc. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. ---- diff --git a/Rakefile b/Rakefile deleted file mode 100644 index 7b8db5530..000000000 --- a/Rakefile +++ /dev/null @@ -1,203 +0,0 @@ -require 'rubygems' -require 'yaml' -require 'httparty' - -namespace :build do - - desc "Build version for current '/c/' CDN copy and locked in version" - task :current do - Rake::Task["build:source"].execute - - cdn_version_num = "#{version['major']}.#{version['minor']}" - - ['c', cdn_version_num].each do |vsn| - Rake::Shell["mkdir dist/#{vsn}"] - - File.open("dist/#{vsn}/video.js", "w+") do |file| - file.puts File.read("dist/video.min.js").sub('GENERATED_CDN_VSN', vsn) - end - - Rake::Shell["cp dist/video-js.min.css dist/#{vsn}/video-js.css"] - Rake::Shell["cp dist/video-js.swf dist/#{vsn}/video-js.swf"] - Rake::Shell["cp dist/video-js.png dist/#{vsn}/video-js.png"] - Rake::Shell["cp dist/demo.html dist/#{vsn}/demo.html"] - Rake::Shell["cp dist/captions.vtt dist/#{vsn}/captions.vtt"] - end - - Rake::Shell["mkdir dist/video-js"] - - File.open("dist/video-js/video.min.js", "w+") do |file| - file.puts File.read("dist/video.min.js").sub('GENERATED_CDN_VSN', cdn_version_num) - end - - File.open("dist/video-js/video.js", "w+") do |file| - file.puts File.read("dist/video.js").sub('GENERATED_CDN_VSN', cdn_version_num) - end - - Rake::Shell["cp dist/video-js.min.css dist/video-js/video-js.min.css"] - Rake::Shell["cp dist/video-js.css dist/video-js/video-js.css"] - Rake::Shell["cp dist/video-js.swf dist/video-js/video-js.swf"] - Rake::Shell["cp dist/video-js.png dist/video-js/video-js.png"] - Rake::Shell["cp dist/demo.html dist/video-js/demo.html"] - Rake::Shell["cp dist/captions.vtt dist/video-js/captions.vtt"] - - Rake::Shell["cd dist && zip -r video-js-#{version_number}.zip video-js && cd .."] - - if `git name-rev --name-only HEAD`.strip != 'stable' - Rake::Log["*** WARNING: NOT ON STABLE BRANCH!!! ***"] - end - end - - desc "Build source files for packaging" - task :source do - Rake::Log["Building Version: " << version_number] - - if File.exist?("dist") - Rake::Shell["rm -r dist"] - end - - # Make distribution folder - Rake::Shell["mkdir dist"] - - Rake::Log["Combining source files"] - combined = "" - - first_files = [ '_begin.js', 'core.js', 'lib.js' ] - - first_files.each do |item| - Rake::Log[item] - combined << File.read("src/#{item}") - end - - Dir.foreach('src') do |item| - next if (['.', '..', '.DS_Store', 'setup.js', '_end.js'] + first_files).include? item - combined << File.read("src/#{item}") - end - - # combined << File.read("flash/swfobject.js") - combined << File.read("src/setup.js") - combined << File.read("src/_end.js") - - Rake::Log["Adding version number"] - combined = combined.gsub('GENERATED_AT_BUILD', version_number) - - File.open('dist/video.js', "w+") do |file| - file.puts "" << combined - end - - Rake::Log["Copying CSS and updated version"] - File.open('dist/video-js.css', "w+") do |file| - file.puts File.read("design/video-js.css").gsub('GENERATED_AT_BUILD', version_number) - end - - Rake::Log["Copying suppporting files"] - Rake::Shell["cp design/video-js.png dist/video-js.png"] - Rake::Shell["cp flash/video-js.swf dist/video-js.swf"] - - Rake::Shell["cp build/release-files/README.md dist/README.md"] - Rake::Shell["cp build/release-files/demo.html dist/demo.html"] - Rake::Shell["cp build/release-files/captions.vtt dist/captions.vtt"] - Rake::Shell["cp LGPLv3-LICENSE.txt dist/LGPLv3-LICENSE.txt"] - - Rake::Log["Minimizing JavaScript"] - Rake::Shell["java -jar build/lib/yuicompressor-2.4.7.jar dist/video.js -o dist/video.min.js"] - - Rake::Log["Minimizing CSS"] - Rake::Shell["java -jar build/lib/yuicompressor-2.4.7.jar dist/video-js.css -o dist/video-js.min.css"] - - Rake::Log[version_number << " Built"] - end - - desc "Build list of source files for easy inclusion in projects" - task :js_source do - - File.open("dev/source-list.js", "w+") do |file| - file.puts "var vjsSourceList = [];" - - src_array = ["src/core", "src/lib"] - last = ["src/setup"] # "flash/swfobject", - exclude = [".", "..", ".DS_Store", "_end.js", "_begin.js"] - - Dir.foreach('src') do |item| - next if exclude.include? item - - item_name = "src/" << item.sub(".js", "") - - next if (src_array + last).include? item_name - - src_array << item_name - end - - src_array = src_array + last - - src_array.each do |item| - file.puts "vjsSourceList.push('#{item}')" - end - # file.puts "vjsSourceList.push('src/#{item.sub(".js", "")}')" - # file.puts "vjsSourceList.push('flash/swfobject.js')" - - end - end - - desc "Build list of source files for easy inclusion in projects" - task :source_html do - - File.open("dev/source-list.html", "w+") do |file| - file.puts "" - - src_array = ["src/core", "src/lib"] - last = ["src/setup"] # "flash/swfobject", - exclude = [".", "..", ".DS_Store", "_end.js", "_begin.js"] - - Dir.foreach('src') do |item| - next if exclude.include? item - - item_name = "src/" << item.sub(".js", "") - - next if (src_array + last).include? item_name - - src_array << item_name - end - - src_array = src_array + last - - src_array.each do |item| - file.puts "" - end - # file.puts "vjsSourceList.push('src/#{item.sub(".js", "")}')" - # file.puts "vjsSourceList.push('flash/swfobject.js')" - - file.puts "" - - end - end - -end - -def version - YAML.load(File.read("VERSION.yml")) -end - -def version_number - "#{version['major']}.#{version['minor']}.#{version['patch']}" -end - -module Rake - class Shell - def self.[](command) - output = %x[#{command}] - if $?.to_i > 0 - puts "-----> Process aborted" - puts " Exit status: #{$?}" - exit($?.to_i) - end - puts output - end - end - - class Log - def self.[](message) - puts "-----> #{message.split("\n").join("\n ")}" - end - end -end diff --git a/browsers.json b/browsers.json new file mode 100644 index 000000000..9bc75f98c --- /dev/null +++ b/browsers.json @@ -0,0 +1,37 @@ +[ + { + "os": "win", + "browser": "chrome", + "version": "27.0" + }, + { + "os": "win", + "browser": "firefox", + "version": "20.0" + }, + { + "os": "win", + "browser": "ie", + "version": "9.0" + }, + { + "os": "win", + "browser": "ie", + "version": "10.0" + }, + { + "os": "ios", + "device": "iPhone 5", + "version": "6.0" + }, + { + "os": "ios", + "device": "iPad 3rd (6.0)", + "version": "6.0" + }, + { + "os": "android", + "device": "Samsung Galaxy Tab 2 10.1", + "version": "4.0" + } +] diff --git a/build.sh b/build.sh deleted file mode 100755 index 9a6237dc1..000000000 --- a/build.sh +++ /dev/null @@ -1,48 +0,0 @@ -#! /bin/csh -# Combines Source Files. In terminal, sh build.sh -# It will put a new video.js file under dist/ - -# Create dist directory if it doesn't already exist -mkdir -p 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/setup.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/release-files/README.md dist/README.md -cp build/release-files/demo.html dist/demo.html -cp LGPLv3-LICENSE.txt dist/LGPLv3-LICENSE.txt - -java -jar build/lib/yuicompressor-2.4.7.jar dist/video.js -o dist/video.min.js -java -jar build/lib/yuicompressor-2.4.7.jar dist/video-js.css -o dist/video-js.min.css diff --git a/build/Versioning Notes.md b/build/Versioning Notes.md deleted file mode 100644 index 57568baf8..000000000 --- a/build/Versioning Notes.md +++ /dev/null @@ -1,28 +0,0 @@ -Deploying Version ------------------ -- Update SWF location for CDN - -Version Numbers ---------------- -http://en.wikipedia.org/wiki/Software_versioning#Sequence-based_identifiers - -### Major Version (Integer, e.g 3.0) -- Any features where we expect it could break plugins, skins, or any major API integration. - -### Minor Version (3.1) -- Additional non-breaking features - -### Revision Versions - -- Beta (3.1b1) -- Release Candidate (3.1rc1) -- Release with revisions (3.1r1) - -Notes: -The last level of one revision type (beta/release candidate) should match the first level of the next revision type. 4.0-b10 should match 4.0-rc1, assuming b10 is the last beta version. - -Release revisions means bug fixes. The CDN url should not reflect the revision number. 4.0-r2 would still be /4.0/. - -Tagging a Release ------------------ -git tag -a [version number] [commit] \ No newline at end of file diff --git a/build/compiler/COPYING b/build/compiler/COPYING new file mode 100644 index 000000000..d64569567 --- /dev/null +++ b/build/compiler/COPYING @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/build/compiler/README b/build/compiler/README new file mode 100644 index 000000000..270cfc278 --- /dev/null +++ b/build/compiler/README @@ -0,0 +1,292 @@ +/* + * Copyright 2009 The Closure Compiler Authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// +// Contents +// + +The Closure Compiler performs checking, instrumentation, and +optimizations on JavaScript code. The purpose of this README is to +explain how to build and run the Closure Compiler. + +The Closure Compiler requires Java 6 or higher. +http://www.java.com/ + + +// +// Building The Closure Compiler +// + +There are three ways to get a Closure Compiler executable. + +1) Use one we built for you. + +Pre-built Closure binaries can be found at +http://code.google.com/p/closure-compiler/downloads/list + + +2) Check out the source and build it with Apache Ant. + +First, check out the full source tree of the Closure Compiler. There +are instructions on how to do this at the project site. +http://code.google.com/p/closure-compiler/source/checkout + +Apache Ant is a cross-platform build tool. +http://ant.apache.org/ + +At the root of the source tree, there is an Ant file named +build.xml. To use it, navigate to the same directory and type the +command + +ant jar + +This will produce a jar file called "build/compiler.jar". + + +3) Check out the source and build it with Eclipse. + +Eclipse is a cross-platform IDE. +http://www.eclipse.org/ + +Under Eclipse's File menu, click "New > Project ..." and create a +"Java Project." You will see an options screen. Give the project a +name, select "Create project from existing source," and choose the +root of the checked-out source tree as the existing directory. Verify +that you are using JRE version 6 or higher. + +Eclipse can use the build.xml file to discover rules. When you +navigate to the build.xml file, you will see all the build rules in +the "Outline" pane. Run the "jar" rule to build the compiler in +build/compiler.jar. + + +// +// Running The Closure Compiler +// + +Once you have the jar binary, running the Closure Compiler is straightforward. + +On the command line, type + +java -jar compiler.jar + +This starts the compiler in interactive mode. Type + +var x = 17 + 25; + +then hit "Enter", then hit "Ctrl-Z" (on Windows) or "Ctrl-D" (on Mac or Linux) +and "Enter" again. The Compiler will respond: + +var x=42; + +The Closure Compiler has many options for reading input from a file, +writing output to a file, checking your code, and running +optimizations. To learn more, type + +java -jar compiler.jar --help + +You can read more detailed documentation about the many flags at +http://code.google.com/closure/compiler/docs/gettingstarted_app.html + + +// +// Compiling Multiple Scripts +// + +If you have multiple scripts, you should compile them all together with +one compile command. + +java -jar compiler.jar --js=in1.js --js=in2.js ... --js_output_file=out.js + +The Closure Compiler will concatenate the files in the order they're +passed at the command line. + +If you need to compile many, many scripts together, you may start to +run into problems with managing dependencies between scripts. You +should check out the Closure Library. It contains functions for +enforcing dependencies between scripts, and a tool called calcdeps.py +that knows how to give scripts to the Closure Compiler in the right +order. + +http://code.google.com/p/closure-library/ + +// +// Licensing +// + +Unless otherwise stated, all source files are licensed under +the Apache License, Version 2.0. + + +----- +Code under: +src/com/google/javascript/rhino +test/com/google/javascript/rhino + +URL: http://www.mozilla.org/rhino +Version: 1.5R3, with heavy modifications +License: Netscape Public License and MPL / GPL dual license + +Description: A partial copy of Mozilla Rhino. Mozilla Rhino is an +implementation of JavaScript for the JVM. The JavaScript parser and +the parse tree data structures were extracted and modified +significantly for use by Google's JavaScript compiler. + +Local Modifications: The packages have been renamespaced. All code not +relevant to parsing has been removed. A JsDoc parser and static typing +system have been added. + + +----- +Code in: +lib/rhino + +Rhino +URL: http://www.mozilla.org/rhino +Version: Trunk +License: Netscape Public License and MPL / GPL dual license + +Description: Mozilla Rhino is an implementation of JavaScript for the JVM. + +Local Modifications: Minor changes to parsing JSDoc that usually get pushed +up-stream to Rhino trunk. + + +----- +Code in: +lib/args4j.jar + +Args4j +URL: https://args4j.dev.java.net/ +Version: 2.0.16 +License: MIT + +Description: +args4j is a small Java class library that makes it easy to parse command line +options/arguments in your CUI application. + +Local Modifications: None. + + +----- +Code in: +lib/guava.jar + +Guava Libraries +URL: http://code.google.com/p/guava-libraries/ +Version: 13.0.1 +License: Apache License 2.0 + +Description: Google's core Java libraries. + +Local Modifications: None. + + +----- +Code in: +lib/jsr305.jar + +Annotations for software defect detection +URL: http://code.google.com/p/jsr-305/ +Version: svn revision 47 +License: BSD License + +Description: Annotations for software defect detection. + +Local Modifications: None. + + +----- +Code in: +lib/jarjar.jar + +Jar Jar Links +URL: http://jarjar.googlecode.com/ +Version: 1.1 +License: Apache License 2.0 + +Description: +A utility for repackaging Java libraries. + +Local Modifications: None. + + +---- +Code in: +lib/junit.jar + +JUnit +URL: http://sourceforge.net/projects/junit/ +Version: 4.10 +License: Common Public License 1.0 + +Description: A framework for writing and running automated tests in Java. + +Local Modifications: None. + + +--- +Code in: +lib/protobuf-java.jar + +Protocol Buffers +URL: http://code.google.com/p/protobuf/ +Version: 2.4.1 +License: New BSD License + +Description: Supporting libraries for protocol buffers, +an encoding of structured data. + +Local Modifications: None + + +--- +Code in: +lib/ant.jar +lib/ant-launcher.jar + +URL: http://ant.apache.org/bindownload.cgi +Version: 1.8.1 +License: Apache License 2.0 +Description: + Ant is a Java based build tool. In theory it is kind of like "make" + without make's wrinkles and with the full portability of pure java code. + +Local Modifications: None + + +--- +Code in: +lib/json.jar +URL: http://json.org/java/index.html +Version: JSON version 20090211 +License: MIT license +Description: +JSON is a set of java files for use in transmitting data in JSON format. + +Local Modifications: None + +--- +Code in: +tools/maven-ant-tasks-2.1.3.jar +URL: http://maven.apache.org +Version 2.1.3 +License: Apache License 2.0 +Description: + Maven Ant tasks are used to manage dependencies and to install/deploy to + maven repositories. + +Local Modifications: None diff --git a/build/compiler/compiler.jar b/build/compiler/compiler.jar new file mode 100644 index 000000000..53037b0e8 Binary files /dev/null and b/build/compiler/compiler.jar differ diff --git a/build/compiler/goog.base.js b/build/compiler/goog.base.js new file mode 100644 index 000000000..28b281335 --- /dev/null +++ b/build/compiler/goog.base.js @@ -0,0 +1,1574 @@ +// VIDEO.JS NOTE +// Video.js uses Google's Closure Compiler in Avanced Optimization mode +// to achieve an exceptionally small file size. Video.js does not currently +// use the full Closure Library as a base, however Closure Compiler +// automatically replaces certain Closure Library methods with more +// optimized versions of the code when it compiles. +// http://code.google.com/p/closure-compiler/source/browse/trunk/src/com/google/javascript/jscomp/ProcessClosurePrimitives.java +// +// For instance we use `goog.base(this, 'methodName')` within class methods, +// which Compiler auto replaces with `this.superClass_.methodName.call(this);`. +// Compiler then minifies that code even more. So while we use the following +// code in development, it gets stripped out at compile time. +// +// (heff's note: Nothing against Closure Library, we just don't need it yet.) + +/* + * Class inhertance notes from compiler testing + * In a constructor, goog.base(this) is equivalent to _V_.SuperClass.call(this) + * in function and compression + * In an instance method, + * goog.base(this, 'funcName'); becomes + * f.a.c.call(this); + * + * this.superClass_.funcName.call(this); becomes + * this.a.c.call(this); + * + * _V_.SuperClass.prototype.funcName.call(this); becomes + * h.prototype.c.call(this); + * + * All three do the same thing but goog.base results in less characters. + */ + + +// Copyright 2006 The Closure Library Authors. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS-IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/** + * @fileoverview Bootstrap for the Google JS Library (Closure). + * + * In uncompiled mode base.js will write out Closure's deps file, unless the + * global CLOSURE_NO_DEPS is set to true. This allows projects to + * include their own deps file(s) from different locations. + * + * + * @provideGoog + */ + + +/** + * @define {boolean} Overridden to true by the compiler when --closure_pass + * or --mark_as_compiled is specified. + */ +var COMPILED = false; + + +/** + * Base namespace for the Closure library. Checks to see goog is + * already defined in the current scope before assigning to prevent + * clobbering if base.js is loaded more than once. + * + * @const + */ +var goog = goog || {}; // Identifies this file as the Closure base. + + +/** + * Reference to the global context. In most cases this will be 'window'. + */ +goog.global = this; + + +/** + * @define {boolean} DEBUG is provided as a convenience so that debugging code + * that should not be included in a production js_binary can be easily stripped + * by specifying --define goog.DEBUG=false to the JSCompiler. For example, most + * toString() methods should be declared inside an "if (goog.DEBUG)" conditional + * because they are generally used for debugging purposes and it is difficult + * for the JSCompiler to statically determine whether they are used. + */ +goog.DEBUG = true; + + +/** + * @define {string} LOCALE defines the locale being used for compilation. It is + * used to select locale specific data to be compiled in js binary. BUILD rule + * can specify this value by "--define goog.LOCALE=" as JSCompiler + * option. + * + * Take into account that the locale code format is important. You should use + * the canonical Unicode format with hyphen as a delimiter. Language must be + * lowercase, Language Script - Capitalized, Region - UPPERCASE. + * There are few examples: pt-BR, en, en-US, sr-Latin-BO, zh-Hans-CN. + * + * See more info about locale codes here: + * http://www.unicode.org/reports/tr35/#Unicode_Language_and_Locale_Identifiers + * + * For language codes you should use values defined by ISO 693-1. See it here + * http://www.w3.org/WAI/ER/IG/ert/iso639.htm. There is only one exception from + * this rule: the Hebrew language. For legacy reasons the old code (iw) should + * be used instead of the new code (he), see http://wiki/Main/IIISynonyms. + */ +goog.LOCALE = 'en'; // default to en + + +/** + * Creates object stubs for a namespace. The presence of one or more + * goog.provide() calls indicate that the file defines the given + * objects/namespaces. Build tools also scan for provide/require statements + * to discern dependencies, build dependency files (see deps.js), etc. + * @see goog.require + * @param {string} name Namespace provided by this file in the form + * "goog.package.part". + */ +goog.provide = function(name) { + if (!COMPILED) { + // Ensure that the same namespace isn't provided twice. This is intended + // to teach new developers that 'goog.provide' is effectively a variable + // declaration. And when JSCompiler transforms goog.provide into a real + // variable declaration, the compiled JS should work the same as the raw + // JS--even when the raw JS uses goog.provide incorrectly. + if (goog.isProvided_(name)) { + throw Error('Namespace "' + name + '" already declared.'); + } + delete goog.implicitNamespaces_[name]; + + var namespace = name; + while ((namespace = namespace.substring(0, namespace.lastIndexOf('.')))) { + if (goog.getObjectByName(namespace)) { + break; + } + goog.implicitNamespaces_[namespace] = true; + } + } + + goog.exportPath_(name); +}; + + +/** + * Marks that the current file should only be used for testing, and never for + * live code in production. + * @param {string=} opt_message Optional message to add to the error that's + * raised when used in production code. + */ +goog.setTestOnly = function(opt_message) { + if (COMPILED && !goog.DEBUG) { + opt_message = opt_message || ''; + throw Error('Importing test-only code into non-debug environment' + + opt_message ? ': ' + opt_message : '.'); + } +}; + + +if (!COMPILED) { + + /** + * Check if the given name has been goog.provided. This will return false for + * names that are available only as implicit namespaces. + * @param {string} name name of the object to look for. + * @return {boolean} Whether the name has been provided. + * @private + */ + goog.isProvided_ = function(name) { + return !goog.implicitNamespaces_[name] && !!goog.getObjectByName(name); + }; + + /** + * Namespaces implicitly defined by goog.provide. For example, + * goog.provide('goog.events.Event') implicitly declares + * that 'goog' and 'goog.events' must be namespaces. + * + * @type {Object} + * @private + */ + goog.implicitNamespaces_ = {}; +} + + +/** + * Builds an object structure for the provided namespace path, + * ensuring that names that already exist are not overwritten. For + * example: + * "a.b.c" -> a = {};a.b={};a.b.c={}; + * Used by goog.provide and goog.exportSymbol. + * @param {string} name name of the object that this file defines. + * @param {*=} opt_object the object to expose at the end of the path. + * @param {Object=} opt_objectToExportTo The object to add the path to; default + * is |goog.global|. + * @private + */ +goog.exportPath_ = function(name, opt_object, opt_objectToExportTo) { + var parts = name.split('.'); + var cur = opt_objectToExportTo || goog.global; + + // Internet Explorer exhibits strange behavior when throwing errors from + // methods externed in this manner. See the testExportSymbolExceptions in + // base_test.html for an example. + if (!(parts[0] in cur) && cur.execScript) { + cur.execScript('var ' + parts[0]); + } + + // Certain browsers cannot parse code in the form for((a in b); c;); + // This pattern is produced by the JSCompiler when it collapses the + // statement above into the conditional loop below. To prevent this from + // happening, use a for-loop and reserve the init logic as below. + + // Parentheses added to eliminate strict JS warning in Firefox. + for (var part; parts.length && (part = parts.shift());) { + if (!parts.length && goog.isDef(opt_object)) { + // last part and we have an object; use it + cur[part] = opt_object; + } else if (cur[part]) { + cur = cur[part]; + } else { + cur = cur[part] = {}; + } + } +}; + + +/** + * Returns an object based on its fully qualified external name. If you are + * using a compilation pass that renames property names beware that using this + * function will not find renamed properties. + * + * @param {string} name The fully qualified name. + * @param {Object=} opt_obj The object within which to look; default is + * |goog.global|. + * @return {?} The value (object or primitive) or, if not found, null. + */ +goog.getObjectByName = function(name, opt_obj) { + var parts = name.split('.'); + var cur = opt_obj || goog.global; + for (var part; part = parts.shift(); ) { + if (goog.isDefAndNotNull(cur[part])) { + cur = cur[part]; + } else { + return null; + } + } + return cur; +}; + + +/** + * Globalizes a whole namespace, such as goog or goog.lang. + * + * @param {Object} obj The namespace to globalize. + * @param {Object=} opt_global The object to add the properties to. + * @deprecated Properties may be explicitly exported to the global scope, but + * this should no longer be done in bulk. + */ +goog.globalize = function(obj, opt_global) { + var global = opt_global || goog.global; + for (var x in obj) { + global[x] = obj[x]; + } +}; + + +/** + * Adds a dependency from a file to the files it requires. + * @param {string} relPath The path to the js file. + * @param {Array} provides An array of strings with the names of the objects + * this file provides. + * @param {Array} requires An array of strings with the names of the objects + * this file requires. + */ +goog.addDependency = function(relPath, provides, requires) { + if (!COMPILED) { + var provide, require; + var path = relPath.replace(/\\/g, '/'); + var deps = goog.dependencies_; + for (var i = 0; provide = provides[i]; i++) { + deps.nameToPath[provide] = path; + if (!(path in deps.pathToNames)) { + deps.pathToNames[path] = {}; + } + deps.pathToNames[path][provide] = true; + } + for (var j = 0; require = requires[j]; j++) { + if (!(path in deps.requires)) { + deps.requires[path] = {}; + } + deps.requires[path][require] = true; + } + } +}; + + + + +// NOTE(nnaze): The debug DOM loader was included in base.js as an orignal +// way to do "debug-mode" development. The dependency system can sometimes +// be confusing, as can the debug DOM loader's asyncronous nature. +// +// With the DOM loader, a call to goog.require() is not blocking -- the +// script will not load until some point after the current script. If a +// namespace is needed at runtime, it needs to be defined in a previous +// script, or loaded via require() with its registered dependencies. +// User-defined namespaces may need their own deps file. See http://go/js_deps, +// http://go/genjsdeps, or, externally, DepsWriter. +// http://code.google.com/closure/library/docs/depswriter.html +// +// Because of legacy clients, the DOM loader can't be easily removed from +// base.js. Work is being done to make it disableable or replaceable for +// different environments (DOM-less JavaScript interpreters like Rhino or V8, +// for example). See bootstrap/ for more information. + + +/** + * @define {boolean} Whether to enable the debug loader. + * + * If enabled, a call to goog.require() will attempt to load the namespace by + * appending a script tag to the DOM (if the namespace has been registered). + * + * If disabled, goog.require() will simply assert that the namespace has been + * provided (and depend on the fact that some outside tool correctly ordered + * the script). + */ +goog.ENABLE_DEBUG_LOADER = true; + + +/** + * Implements a system for the dynamic resolution of dependencies + * that works in parallel with the BUILD system. Note that all calls + * to goog.require will be stripped by the JSCompiler when the + * --closure_pass option is used. + * @see goog.provide + * @param {string} name Namespace to include (as was given in goog.provide()) + * in the form "goog.package.part". + */ +goog.require = function(name) { + + // if the object already exists we do not need do do anything + // TODO(arv): If we start to support require based on file name this has + // to change + // TODO(arv): If we allow goog.foo.* this has to change + // TODO(arv): If we implement dynamic load after page load we should probably + // not remove this code for the compiled output + if (!COMPILED) { + if (goog.isProvided_(name)) { + return; + } + + if (goog.ENABLE_DEBUG_LOADER) { + var path = goog.getPathFromDeps_(name); + if (path) { + goog.included_[path] = true; + goog.writeScripts_(); + return; + } + } + + var errorMessage = 'goog.require could not find: ' + name; + if (goog.global.console) { + goog.global.console['error'](errorMessage); + } + + + throw Error(errorMessage); + + } +}; + + +/** + * Path for included scripts + * @type {string} + */ +goog.basePath = ''; + + +/** + * A hook for overriding the base path. + * @type {string|undefined} + */ +goog.global.CLOSURE_BASE_PATH; + + +/** + * Whether to write out Closure's deps file. By default, + * the deps are written. + * @type {boolean|undefined} + */ +goog.global.CLOSURE_NO_DEPS = true; +// goog.global.CLOSURE_NO_DEPS; + + +/** + * A function to import a single script. This is meant to be overridden when + * Closure is being run in non-HTML contexts, such as web workers. It's defined + * in the global scope so that it can be set before base.js is loaded, which + * allows deps.js to be imported properly. + * + * The function is passed the script source, which is a relative URI. It should + * return true if the script was imported, false otherwise. + */ +goog.global.CLOSURE_IMPORT_SCRIPT; + + +/** + * Null function used for default values of callbacks, etc. + * @return {void} Nothing. + */ +goog.nullFunction = function() {}; + + +/** + * The identity function. Returns its first argument. + * + * @param {*=} opt_returnValue The single value that will be returned. + * @param {...*} var_args Optional trailing arguments. These are ignored. + * @return {?} The first argument. We can't know the type -- just pass it along + * without type. + * @deprecated Use goog.functions.identity instead. + */ +// Currently not used in Video.js and throwing jshint errors +// goog.identityFunction = function(opt_returnValue, var_args) { +// return opt_returnValue; +// }; + + +/** + * When defining a class Foo with an abstract method bar(), you can do: + * + * Foo.prototype.bar = goog.abstractMethod + * + * Now if a subclass of Foo fails to override bar(), an error + * will be thrown when bar() is invoked. + * + * Note: This does not take the name of the function to override as + * an argument because that would make it more difficult to obfuscate + * our JavaScript code. + * + * @type {!Function} + * @throws {Error} when invoked to indicate the method should be + * overridden. + */ +goog.abstractMethod = function() { + throw Error('unimplemented abstract method'); +}; + + +/** + * Adds a {@code getInstance} static method that always return the same instance + * object. + * @param {!Function} ctor The constructor for the class to add the static + * method to. + */ +// Currently not used in Video.js and throwing jshint errors +// goog.addSingletonGetter = function(ctor) { +// ctor.getInstance = function() { +// if (ctor.instance_) { +// return ctor.instance_; +// } +// if (goog.DEBUG) { +// // NOTE: JSCompiler can't optimize away Array#push. +// goog.instantiatedSingletons_[goog.instantiatedSingletons_.length] = ctor; +// } +// return ctor.instance_ = new ctor; +// }; +// }; + + +/** + * All singleton classes that have been instantiated, for testing. Don't read + * it directly, use the {@code goog.testing.singleton} module. The compiler + * removes this variable if unused. + * @type {!Array.} + * @private + */ +goog.instantiatedSingletons_ = []; + + +if (!COMPILED && goog.ENABLE_DEBUG_LOADER) { + /** + * Object used to keep track of urls that have already been added. This + * record allows the prevention of circular dependencies. + * @type {Object} + * @private + */ + goog.included_ = {}; + + + /** + * This object is used to keep track of dependencies and other data that is + * used for loading scripts + * @private + * @type {Object} + */ + goog.dependencies_ = { + pathToNames: {}, // 1 to many + nameToPath: {}, // 1 to 1 + requires: {}, // 1 to many + // used when resolving dependencies to prevent us from + // visiting the file twice + visited: {}, + written: {} // used to keep track of script files we have written + }; + + + /** + * Tries to detect whether is in the context of an HTML document. + * @return {boolean} True if it looks like HTML document. + * @private + */ + goog.inHtmlDocument_ = function() { + var doc = goog.global.document; + return typeof doc != 'undefined' && + 'write' in doc; // XULDocument misses write. + }; + + + /** + * Tries to detect the base path of the base.js script that bootstraps Closure + * @private + */ + goog.findBasePath_ = function() { + if (goog.global.CLOSURE_BASE_PATH) { + goog.basePath = goog.global.CLOSURE_BASE_PATH; + return; + } else if (!goog.inHtmlDocument_()) { + return; + } + var doc = goog.global.document; + var scripts = doc.getElementsByTagName('script'); + // Search backwards since the current script is in almost all cases the one + // that has base.js. + for (var i = scripts.length - 1; i >= 0; --i) { + var src = scripts[i].src; + var qmark = src.lastIndexOf('?'); + var l = qmark == -1 ? src.length : qmark; + if (src.substr(l - 7, 7) == 'base.js') { + goog.basePath = src.substr(0, l - 7); + return; + } + } + }; + + + /** + * Imports a script if, and only if, that script hasn't already been imported. + * (Must be called at execution time) + * @param {string} src Script source. + * @private + */ + goog.importScript_ = function(src) { + var importScript = goog.global.CLOSURE_IMPORT_SCRIPT || + goog.writeScriptTag_; + if (!goog.dependencies_.written[src] && importScript(src)) { + goog.dependencies_.written[src] = true; + } + }; + + + /** + * The default implementation of the import function. Writes a script tag to + * import the script. + * + * @param {string} src The script source. + * @return {boolean} True if the script was imported, false otherwise. + * @private + */ + goog.writeScriptTag_ = function(src) { + if (goog.inHtmlDocument_()) { + var doc = goog.global.document; + + // If the user tries to require a new symbol after document load, + // something has gone terribly wrong. Doing a document.write would + // wipe out the page. + if (doc.readyState == 'complete') { + // Certain test frameworks load base.js multiple times, which tries + // to write deps.js each time. If that happens, just fail silently. + // These frameworks wipe the page between each load of base.js, so this + // is OK. + var isDeps = /\bdeps.js$/.test(src); + if (isDeps) { + return false; + } else { + throw Error('Cannot write "' + src + '" after document load'); + } + } + + doc.write( + ' @@ -23,7 +23,7 @@ - + diff --git a/build/lib/yuicompressor-2.4.7.jar b/build/lib/yuicompressor-2.4.7.jar deleted file mode 100644 index 3c9a408aa..000000000 Binary files a/build/lib/yuicompressor-2.4.7.jar and /dev/null differ diff --git a/build/release-files/README.md b/build/release-files/README.md deleted file mode 100644 index f3bacb2f4..000000000 --- a/build/release-files/README.md +++ /dev/null @@ -1,153 +0,0 @@ -Video.js - [HTML5 Video Player](http://videojs.com) -================================================== -Version 3.0 - ---- -Version 3 is almost a complete rewrite of the previous versions of Video.js. 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. - -Video.js 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 Video.js Javascript and CSS files in the head of your page. -Change the file urls to point to the files on your server. - - - - - -### Step 2: Add an HTML5 video tag to your page. -Use the video tag as normal, with a few extra pieces for Video.js: - - 1. The 'data-setup' attribute tells Video.js 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 Video.js 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. - - - - -### Step 3: Nada! -That's all it take to get started. See the [docs](http://videojs.com/docs/) for more advanced uses. - - -Changelog ---------- -3.0 - -- Complete rewrite -- 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. - -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 diff --git a/build/source-loader.js b/build/source-loader.js new file mode 100644 index 000000000..af58d8ad6 --- /dev/null +++ b/build/source-loader.js @@ -0,0 +1,72 @@ +// This file is used to load the video.js source files into a page +// in the correct order based on dependencies. +// When you create a new source file you will need to add +// it to the list below to use it in sandbox/index.html and +// test/index.html + +// You can use the projectRoot variable to adjust relative urls +// that this script loads. By default it's "../", which is what /sandbox +// and /test need. If you had sandbox/newDir/index.html, in index.html you +// would set projectRoot = "../../" + +// We could use somehting like requireJS to load files, and at one point +// we used goog.require/provide to load dependencies, but that seems like +// overkill with the small number of files we actually have. + +// ADD NEW SOURCE FILES HERE +var sourceFiles = [ + "src/js/core.js", + "src/js/core-object.js", + "src/js/events.js", + "src/js/lib.js", + "src/js/component.js", + "src/js/button.js", + "src/js/slider.js", + "src/js/menu.js", + "src/js/player.js", + "src/js/control-bar/control-bar.js", + "src/js/control-bar/play-toggle.js", + "src/js/control-bar/time-display.js", + "src/js/control-bar/fullscreen-toggle.js", + "src/js/control-bar/progress-control.js", + "src/js/control-bar/volume-control.js", + "src/js/control-bar/mute-toggle.js", + "src/js/control-bar/volume-menu-button.js", + "src/js/poster.js", + "src/js/loading-spinner.js", + "src/js/big-play-button.js", + "src/js/media/media.js", + "src/js/media/html5.js", + "src/js/media/flash.js", + "src/js/media/loader.js", + "src/js/tracks.js", + "src/js/json.js", + "src/js/setup.js", + "src/js/plugins.js" +]; + +// Allow overriding the default project root +var projectRoot = projectRoot || '../'; + +function loadScripts(scriptsArr){ + for (var i = 0; i < scriptsArr.length; i++) { + // Using document.write because that's the easiest way to avoid triggering + // asynchrnous script loading + document.write( "') + } +} + + diff --git a/contrib.json b/contrib.json new file mode 100644 index 000000000..10a1a6553 --- /dev/null +++ b/contrib.json @@ -0,0 +1,6 @@ +{ + "developmentBranch": "master", + "releaseBranch": "stable", + "remote": "origin", + "upstream": "zencoder" +} \ No newline at end of file diff --git a/decisions.txt b/decisions.txt deleted file mode 100644 index 3f030af59..000000000 --- a/decisions.txt +++ /dev/null @@ -1,8 +0,0 @@ -Tracking/Polling CurrentTime Manually -------------------------------------- -- Necessary for most flash players and browsers that don't trigger timeupdate events. -- In VJS 1-2, we always tracked time because timeupdate was rare. -- Now most browsers support it well. There is a delay bug in the current Chrome. - http://code.google.com/p/chromium/issues/detail?id=92251 - Andrew from Chrome told me it would be fix in an upcoming release. -Going to rely on browsers timeupdates when available now. \ No newline at end of file diff --git a/demo-subtitles.srt b/demo-subtitles.srt deleted file mode 100644 index 1a5217306..000000000 --- a/demo-subtitles.srt +++ /dev/null @@ -1,13 +0,0 @@ -1 -00:00:00,000 --> 00:00:07,200 -[Background Music Playing] - -2 -00:00:16,000 --> 00:00:17,200 -Welcome to this week's episode - -3 -00:00:17,400 --> 00:00:19,000 -of explore California - - diff --git a/design/Icon Design.png b/design/Icon Design.png deleted file mode 100644 index ae1b79fe7..000000000 Binary files a/design/Icon Design.png and /dev/null differ diff --git a/design/loading.gif b/design/loading.gif deleted file mode 100644 index 70b533298..000000000 Binary files a/design/loading.gif and /dev/null differ diff --git a/design/skin.old.css b/design/skin.old.css deleted file mode 100644 index 657ae3217..000000000 --- a/design/skin.old.css +++ /dev/null @@ -1,190 +0,0 @@ -/* DEFAULT SKIN (override in another file) -================================================================================ -Using all CSS to draw the controls. Images could be used if desired. -Instead of editing this file, I recommend creating your own skin CSS file to be included after this file, -so you can upgrade to newer versions easier. */ - -.vjs-original-skin .vjs-controls { - position: absolute; margin: 0; opacity: 0.85; color: #fff; - display: block; /* Start hidden */ - left: 0; right: 0; /* 100% width of video-js-box */ - width: 100%; - bottom: 0px; /* Distance from the bottom of the box/video. Keep 0. Use height to add more bottom margin. */ - height: 35px; /* Including any margin you want above or below control items */ - padding: 0; /* Controls are absolutely position, so no padding necessary */ - -webkit-transition: opacity 0.5s linear; - -moz-transition: opacity 0.5s linear; - -o-transition: opacity 0.5s linear; - -ms-transition: opacity 0.5s linear; - transition: opacity 0.5s linear; -} - -.vjs-original-skin .vjs-control { - position: absolute; /* Use top, bottom, left, and right to specifically position the control. */ - text-align: center; margin: 0; padding: 0; - height: 25px; /* Default height of individual controls */ - top: 5px; /* Top margin to put space between video and controls when controls are below */ - - /* CSS Background Gradients - Using to give the aqua-ish look. */ - /* Default */ background-color: #0B151A; - /* Webkit */ background: #1F3744 -webkit-gradient(linear, left top, left bottom, from(#0B151A), to(#1F3744)) left 12px; - /* Firefox */ background: #1F3744 -moz-linear-gradient(top, #0B151A, #1F3744) left 12px; - - /* CSS Curved Corners */ - -webkit-border-radius: 5px; -moz-border-radius: 5px; border-radius: 5px; - - /* CSS Shadows */ - -webkit-box-shadow: 1px 1px 2px #000; -moz-box-shadow: 1px 1px 2px #000; box-shadow: 1px 1px 2px #000; -} - -/* Placement of Control Items - - Left side of pogress bar, use left & width - - Rigth side of progress bar, use right & width - - Expand with the video (like progress bar) use left & right - (using div.x to make more specific than vjs-control style) -*/ -.vjs-original-skin div.vjs-play-control { left: 5px; width: 25px; } -.vjs-original-skin div.vjs-progress-control { left: 35px; right: 165px; } /* Using left & right so it expands with the width of the video */ -.vjs-original-skin div.vjs-time-control { width: 75px; right: 90px; } /* Time control and progress bar are combined to look like one */ -.vjs-original-skin div.vjs-volume-control { width: 50px; right: 35px; } -.vjs-original-skin div.vjs-fullscreen-control { width: 25px; right: 5px; } - -/* Removing curved corners on progress control and time control to join them. */ -.vjs-original-skin div.vjs-progress-control { - -webkit-border-top-right-radius: 0; -moz-border-radius-topright: 0; border-top-right-radius: 0; - -webkit-border-bottom-right-radius: 0; -moz-border-radius-bottomright: 0; border-bottom-right-radius: 0; -} -.vjs-original-skin div.vjs-time-control { - -webkit-border-top-left-radius: 0; -moz-border-radius-topleft: 0; border-top-left-radius: 0; - -webkit-border-bottom-left-radius: 0; -moz-border-radius-bottomleft: 0; border-bottom-left-radius: 0; -} - -/* Play/Pause --------------------------------------------------------------------------------- */ -.vjs-original-skin .vjs-play-control { cursor: pointer !important; } -/* Play Icon */ -.vjs-original-skin .vjs-play-control span { display: block; font-size: 0; line-height: 0; } -.vjs-original-skin.vjs-paused .vjs-play-control span { - width: 0; height: 0; margin: 8px 0 0 8px; - /* Drawing the play triangle with borders - http://www.infimum.dk/HTML/slantinfo.html */ - border-left: 10px solid #fff; /* Width & Color of play icon */ - /* Height of play icon is total top & bottom border widths. Color is transparent. */ - border-top: 5px solid rgba(0,0,0,0); border-bottom: 5px solid rgba(0,0,0,0); -} -.vjs-original-skin.vjs-playing .vjs-play-control span { - width: 3px; height: 10px; margin: 8px auto 0; - /* Drawing the pause bars with borders */ - border-top: 0px; border-left: 3px solid #fff; border-bottom: 0px; border-right: 3px solid #fff; -} - -/* Progress --------------------------------------------------------------------------------- */ -.vjs-original-skin .vjs-progress-holder { /* Box containing play and load progresses */ - position: relative; padding: 0; overflow:hidden; cursor: pointer !important; - height: 9px; border: 1px solid #777; - margin: 7px 1px 0 5px; /* Placement within the progress control item */ - -webkit-border-radius: 5px; -moz-border-radius: 5px; border-radius: 5px; -} -.vjs-original-skin .vjs-progress-holder div { /* Progress Bars */ - position: absolute; display: block; width: 0; height: 9px; margin: 0; padding: 0; - left: 0; top: 0; /*Needed for IE6*/ - -webkit-border-radius: 5px; -moz-border-radius: 5px; border-radius: 5px; -} -.vjs-original-skin .vjs-play-progress { - /* CSS Gradient */ - /* Default */ background: #fff; - /* Webkit */ background: -webkit-gradient(linear, left top, left bottom, from(#fff), to(#777)); - /* Firefox */ background: -moz-linear-gradient(top, #fff, #777); -} -.vjs-original-skin .vjs-load-progress { - opacity: 0.8; - /* CSS Gradient */ - /* Default */ background-color: #555; - /* Webkit */ background: -webkit-gradient(linear, left top, left bottom, from(#555), to(#aaa)); - /* Firefox */ background: -moz-linear-gradient(top, #555, #aaa); -} - -/* Time Display --------------------------------------------------------------------------------- */ -.vjs-original-skin .vjs-time-control { font-size: 10px; line-height: 1; font-weight: normal; font-family: Helvetica, Arial, sans-serif; } -.vjs-original-skin .vjs-time-control span { line-height: 25px; /* Centering vertically */ } - -/* Volume --------------------------------------------------------------------------------- */ -.vjs-original-skin .vjs-volume-control { cursor: pointer !important; } -.vjs-original-skin .vjs-volume-control div { display: block; margin: 0 5px 0 5px; padding: 4px 0 0 0; } -/* Drawing the volume icon using 6 span elements */ -.vjs-original-skin .vjs-volume-control div span { /* Individual volume bars */ - float: left; padding: 0; font-size: 0; line-height: 0; - margin: 0 2px 0 0; /* Space between */ - width: 5px; height: 0px; /* Total height is height + bottom border */ - border-bottom: 18px solid #555; /* Default (off) color and height of visible portion */ -} -.vjs-original-skin .vjs-volume-control div span.vjs-volume-level-on { border-color: #fff; /* Volume on bar color */ } -/* Creating differnt bar heights through height (transparent) and bottom border (visible). */ -.vjs-original-skin .vjs-volume-control div span.vjs-vc-1 { border-bottom-width: 2px; height: 16px; } -.vjs-original-skin .vjs-volume-control div span.vjs-vc-2 { border-bottom-width: 4px; height: 14px; } -.vjs-original-skin .vjs-volume-control div span.vjs-vc-3 { border-bottom-width: 7px; height: 11px; } -.vjs-original-skin .vjs-volume-control div span.vjs-vc-4 { border-bottom-width: 10px; height: 8px; } -.vjs-original-skin .vjs-volume-control div span.vjs-vc-5 { border-bottom-width: 14px; height: 4px; } -.vjs-original-skin .vjs-volume-control div span.vjs-vc-6 { margin-right: 0; } - -/* Fullscreen --------------------------------------------------------------------------------- */ -.vjs-original-skin .vjs-fullscreen-control { cursor: pointer !important; } -.vjs-original-skin .vjs-fullscreen-control div { - padding: 0; text-align: left; vertical-align: top; cursor: pointer !important; - margin: 5px 0 0 5px; /* Placement within the fullscreen control item */ - width: 20px; height: 20px; -} -/* Drawing the fullscreen icon using 4 span elements */ -.vjs-original-skin .vjs-fullscreen-control div span { float: left; margin: 0; padding: 0; font-size: 0; line-height: 0; width: 0; text-align: left; vertical-align: top; } -.vjs-original-skin .vjs-fullscreen-control div span.vjs-fc-1 { /* Top-left triangle */ - margin-right: 3px; /* Space between top-left and top-right */ - margin-bottom: 3px; /* Space between top-left and bottom-left */ - border-top: 6px solid #fff; /* Height and color */ - border-right: 6px solid rgba(0,0,0,0); /* Width */ -} -.vjs-original-skin .vjs-fullscreen-control div span.vjs-fc-2 { border-top: 6px solid #fff; border-left: 6px solid rgba(0,0,0,0); } -.vjs-original-skin .vjs-fullscreen-control div span.vjs-fc-3 { clear: both; margin: 0 3px 0 0; border-bottom: 6px solid #fff; border-right: 6px solid rgba(0,0,0,0); } -.vjs-original-skin .vjs-fullscreen-control div span.vjs-fc-4 { border-bottom: 6px solid #fff; border-left: 6px solid rgba(0,0,0,0); } -/* Icon when video is in fullscreen mode */ -.vjs-original-skin.vjs-fullscreen .vjs-fullscreen-control div span.vjs-fc-1 { border: none; border-bottom: 6px solid #fff; border-left: 6px solid rgba(0,0,0,0); } -.vjs-original-skin.vjs-fullscreen .vjs-fullscreen-control div span.vjs-fc-2 { border: none; border-bottom: 6px solid #fff; border-right: 6px solid rgba(0,0,0,0); } -.vjs-original-skin.vjs-fullscreen .vjs-fullscreen-control div span.vjs-fc-3 { border: none; border-top: 6px solid #fff; border-left: 6px solid rgba(0,0,0,0); } -.vjs-original-skin.vjs-fullscreen .vjs-fullscreen-control div span.vjs-fc-4 { border: none; border-top: 6px solid #fff; border-right: 6px solid rgba(0,0,0,0); } - - - - - -/* Big Play Button (at start) ----------------------------------------------------------*/ -.vjs-original-skin .vjs-big-play-button { - display: block; /* Start hidden */ z-index: 2; - position: absolute; top: 50%; left: 50%; width: 80px; height: 80px; margin: -43px 0 0 -43px; text-align: center; vertical-align: center; cursor: pointer !important; - border: 3px solid #fff; opacity: 0.9; - -webkit-border-radius: 20px; -moz-border-radius: 20px; border-radius: 20px; - - /* CSS Background Gradients */ - /* Default */ background-color: #0B151A; - /* Webkit */ background: #1F3744 -webkit-gradient(linear, left top, left bottom, from(#0B151A), to(#1F3744)) left 40px; - /* Firefox */ background: #1F3744 -moz-linear-gradient(top, #0B151A, #1F3744) left 40px; - - /* CSS Shadows */ - -webkit-box-shadow: 4px 4px 8px #000; -moz-box-shadow: 4px 4px 8px #000; box-shadow: 4px 4px 8px #000; -} - -.vjs-original-skin div.vjs-big-play-button:hover { - -webkit-box-shadow: 0px 0px 80px #fff; -moz-box-shadow: 0px 0px 80px #fff; box-shadow: 0px 0px 80px #fff; -} - -.vjs-original-skin div.vjs-big-play-button span { - display: block; font-size: 0; line-height: 0; - width: 0; height: 0; margin: 20px 0 0 23px; - /* Drawing the play triangle with borders - http://www.infimum.dk/HTML/slantinfo.html */ - border-left: 40px solid #fff; /* Width & Color of play icon */ - /* Height of play icon is total top & bottom border widths. Color is transparent. */ - border-top: 20px solid rgba(0,0,0,0); border-bottom: 20px solid rgba(0,0,0,0); -} \ No newline at end of file diff --git a/design/video-js.css b/design/video-js.css deleted file mode 100644 index cd468eb03..000000000 --- a/design/video-js.css +++ /dev/null @@ -1,499 +0,0 @@ -/* -VideoJS Default Styles (http://videojs.com) -Version GENERATED_AT_BUILD -*/ - -/* -REQUIRED STYLES (be careful overriding) -================================================================================ */ -/* When loading the player, the video tag is replaced with a DIV, - that will hold the video tag or object tag for other playback methods. - The div contains the video playback element (Flash or HTML5) and controls, and sets the width and height of the video. - - ** If you want to add some kind of border/padding (e.g. a frame), or special positioning, use another containing element. - Otherwise you risk messing up control positioning and full window mode. ** -*/ -.video-js { - background-color: #000; position: relative; padding: 0; - - /* Start with 10px for base font size so other dimensions can be em based and easily calculable. */ - font-size: 10px; - - /* Allow poster to be vertially aligned. */ - vertical-align: middle; - /* display: table-cell; */ /*This works in Safari but not Firefox.*/ -} - -/* Playback technology elements expand to the width/height of the containing div.