1
0
mirror of https://github.com/videojs/video.js.git synced 2024-12-25 02:42:10 +02:00

Updated grunt script to add CSS/PNG/SWF files dist. Also did some renaming of files and folders.

This commit is contained in:
Steve Heffernan 2013-01-25 15:22:14 -08:00
parent 1c6bcb0a5e
commit c7d3b9ebf9
12 changed files with 68 additions and 223 deletions

1
.gitignore vendored
View File

@ -1,5 +1,6 @@
.DS_Store
dist/*
build/files/*
dev.html
projects
.zenflow-log

View File

@ -3,8 +3,12 @@ module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
build: {
dist:{}
},
clean: {
build: ['build/files/*'],
dist: ['dist/*']
},
// Current forEach issue: https://github.com/gruntjs/grunt/issues/610
// npm install https://github.com/gruntjs/grunt-contrib-jshint/archive/7fd70e86c5a8d489095fa81589d95dccb8eb3a46.tar.gz
@ -16,51 +20,64 @@ module.exports = function(grunt) {
}
}
},
compile: {
dist:{
sourcelist: 'dist/sourcelist.txt',
minify: {
source:{
sourcelist: 'build/files/sourcelist.txt',
externs: ['src/js/media.flash.externs.js'],
dest: 'dist/video.js'
dest: 'build/files/minified.video.js'
},
test: {
sourcelist: 'dist/sourcelist.txt',
tests: {
sourcelist: 'build/files/sourcelist.txt',
src: ['test/unit/*.js'],
externs: ['src/js/media.flash.externs.js', 'test/qunit/qunit-externs.js'],
dest: 'dist/test.video.js'
dest: 'build/files/test.minified.video.js'
}
},
dist: {
latest:{}
},
dist: {},
qunit: {
all: ['test/index.html', 'test/compiled.html'],
source: ['test/index.html'],
minified: ['test/minified.html']
},
watch: {
files: [ "src/**/*.js" ],
tasks: "dev"
}
// Copy is broken. Waiting for an update to use.
// copy: {
// latest: {
// files: [
// { src: ['dist/video-js'], dest: 'dist/latest' } // includes files in path
// // {src: ['path/**'], dest: 'dest/'}, // includes files in path and its subdirs
// // {expand: true, cwd: 'path/', src: ['**'], dest: 'dest/'}, // makes all src relative to cwd
// // {expand: true, flatten: true, src: ['path/**'], dest: 'dest/', filter: 'isFile'} // flattens results to a single level
// ]
// }
// },
});
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");
// Default task.
grunt.registerTask('default', ['build', 'jshint', 'compile', 'dist']);
grunt.registerTask('default', ['jshint', 'build', 'minify', 'dist']);
// Development watch task
grunt.registerTask('dev', ['jshint','build']);
grunt.registerTask('test', ['jshint', 'build', 'compile','qunit']);
grunt.registerTask('dev', ['jshint', 'build', 'qunit:source']);
grunt.registerTask('test', ['jshint', 'build', 'minify:tests', 'qunit']);
var fs = require('fs'),
gzip = require('zlib').gzip;
grunt.registerMultiTask('build', 'Building Source', function(){
grunt.registerTask('build', 'Building Source', function(){
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');
var calcdeps = require('calcdeps').calcdeps;
// caclcdeps is async
var done = this.async();
// In current version of calcdeps, not supplying certain
// options that should have defaults causes errors
// so we have all options listed here with their defaults.
@ -78,29 +95,32 @@ module.exports = function(grunt) {
}
if (results) {
grunt.file.write('dist/sourcelist.txt', results.join(','));
grunt.file.write('dist/sourcelist.js', 'var sourcelist = ["' + results.join('","') + '"]');
grunt.file.write('build/files/sourcelist.txt', results.join(','));
grunt.file.write('build/files/sourcelist.js', 'var sourcelist = ["' + results.join('","') + '"]');
// Create a combined sources file
// https://github.com/zencoder/video-js/issues/287
// Create a combined sources file. https://github.com/zencoder/video-js/issues/287
var combined = '';
results.forEach(function(result){
combined += grunt.file.read(result);
});
grunt.file.write('dist/source.video.js', combined);
grunt.file.write('build/files/combined.video.js', combined);
}
done();
});
});
grunt.registerMultiTask('compile', 'Minify JS files using Closure Compiler.', function() {
grunt.registerMultiTask('minify', 'Minify JS files using Closure Compiler.', function() {
var done = this.async();
var exec = require('child_process').exec;
var externs = this.file.externs || [];
var dest = this.file.dest;
var files = [];
// Make sure deeper directories exist for compiler
grunt.file.write(dest, '');
if (this.data.sourcelist) {
files = files.concat(grunt.file.read(this.data.sourcelist).split(','))
}
@ -140,7 +160,14 @@ module.exports = function(grunt) {
});
});
grunt.registerMultiTask('dist', 'Creating distribution', function(){
grunt.registerTask('dist', 'Creating distribution', function(){
// TODO: create semver folders (4.1.1, 4.1, 4, and latest)
// grunt copy could be used but is currently broken and needs an update
grunt.file.copy('build/files/minified.video.js', 'dist/video-js/video.js');
grunt.file.copy('build/files/video-js.css', 'dist/video-js/video-js.css');
grunt.file.copy('build/files/video-js.png', 'dist/video-js/video-js.png');
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');
});
};

View File

@ -22,8 +22,12 @@ Some of the focuses of Video.js are:
- 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 [gettign started guide](http://videojs.com/#section5).
Contributing
------------
Please check out our [contributing guide](https://github.com/zencoder/video-js/blob/master/CONTRIBUTING.md).
Check out our [contributing guide](https://github.com/zencoder/video-js/blob/master/CONTRIBUTING.md).

View File

@ -1,36 +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]`
Release Names
-------------
Using [TMNT characters](http://en.wikipedia.org/wiki/List_of_Teenage_Mutant_Ninja_Turtles_characters).
- Alphabetical order
- Major Release - Good Guys
- Minor Release - Bad Guys

View File

@ -23,7 +23,7 @@
<source src="http://video-js.zencoder.com/oceans-clip.mp4" type='video/mp4' />
<source src="http://video-js.zencoder.com/oceans-clip.webm" type='video/webm' />
<source src="http://video-js.zencoder.com/oceans-clip.ogv" type='video/ogg' />
<track kind="captions" src="captions.vtt" srclang="en" label="English" />
<track kind="captions" src="demo.captions.vtt" srclang="en" label="English" />
</video>
</body>

Binary file not shown.

View File

@ -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.
<script src="video.js"></script>
<link href="video-js.css" rel="stylesheet">
### Step 2: Add an HTML5 video tag to your page.
Use the video tag as normal, with a few extra pieces for 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.
<video id="example_video_1" class="video-js vjs-default-skin" controls preload="auto" width="640" height="264"
poster="http://video-js.zencoder.com/oceans-clip.png"
data-setup='{"example_option":true}'>
<source src="http://video-js.zencoder.com/oceans-clip.mp4" type='video/mp4' />
<source src="http://video-js.zencoder.com/oceans-clip.webm" type='video/webm' />
</video>
### Step 3: Nada!
That's all it take to get started. See the [docs](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

View File

@ -24,6 +24,8 @@
"grunt-contrib-watch": "~0.1.4",
"grunt-contrib-qunit": "~0.1.0",
"calcdeps": "~0.1.7",
"phantomjs": "~1.8.0-1"
"phantomjs": "~1.8.0-1",
"grunt-contrib-clean": "~0.4.0a",
"grunt-contrib-copy": "~0.3.2"
}
}

View File

@ -1,5 +1,5 @@
/**
* @fileoverview Media Technology Controller - Base class for media playback technologies
* @fileoverview Media Technology Controller - Base class for media playback technology controllers like Flash and HTML5
*/
goog.provide('vjs.MediaTechController');

View File

@ -11,7 +11,7 @@
<link rel="stylesheet" href="../src/css/video-js.css" type="text/css">
<!-- GENERATED LIST OF SOURCE FILES -->
<script src="../dist/sourcelist.js"></script>
<script src="../build/files/sourcelist.js"></script>
<script type="text/javascript">
(function(){
@ -26,7 +26,7 @@
'test/unit/core.js',
'test/unit/media.html5.js'
];
var compiledTests = "dist/test.video.js";
var compiledTests = "build/files/test.minified.video.js";
var scripts = [];
// Choose either the raw source and tests

View File

@ -15,7 +15,7 @@
so we can automatically run compiled tests too.
(in test/index.html you can add ?compiled to also run compiled tests)
-->
<script src="../dist/test.video.js"></script>
<script src="../build/files/test.minified.video.js"></script>
</head>
<body>