Initial commit
Based on the grunt-init jquery template.
0 parents
Showing
13 changed files
with
533 additions
and
0 deletions
.gitignore
0 → 100644
.jshintrc
0 → 100644
CONTRIBUTING.md
0 → 100644
1 | # Contributing | ||
2 | |||
3 | ## Important notes | ||
4 | Please don't edit files in the `dist` subdirectory as they are generated via Grunt. You'll find source code in the `src` subdirectory! | ||
5 | |||
6 | ### Code style | ||
7 | Regarding code style like indentation and whitespace, **follow the conventions you see used in the source already.** | ||
8 | |||
9 | ### PhantomJS | ||
10 | While Grunt can run the included unit tests via [PhantomJS](http://phantomjs.org/), this shouldn't be considered a substitute for the real thing. Please be sure to test the `test/*.html` unit test file(s) in _actual_ browsers. | ||
11 | |||
12 | ## Modifying the code | ||
13 | First, ensure that you have the latest [Node.js](http://nodejs.org/) and [npm](http://npmjs.org/) installed. | ||
14 | |||
15 | Test that Grunt's CLI is installed by running `grunt --version`. If the command isn't found, run `npm install -g grunt-cli`. For more information about installing Grunt, see the [getting started guide](http://gruntjs.com/getting-started). | ||
16 | |||
17 | 1. Fork and clone the repo. | ||
18 | 1. Run `npm install` to install all dependencies (including Grunt). | ||
19 | 1. Run `grunt` to grunt this project. | ||
20 | |||
21 | Assuming that you don't see any red, you're ready to go. Just be sure to run `grunt` after making any changes, to ensure that nothing is broken. | ||
22 | |||
23 | ## Submitting pull requests | ||
24 | |||
25 | 1. Create a new branch, please don't work in your `master` branch directly. | ||
26 | 1. Add failing tests for the change you want to make. Run `grunt` to see the tests fail. | ||
27 | 1. Fix stuff. | ||
28 | 1. Run `grunt` to see if the tests pass. Repeat steps 2-4 until done. | ||
29 | 1. Open `test/*.html` unit test file(s) in actual browser to ensure tests pass everywhere. | ||
30 | 1. Update the documentation to reflect any changes. | ||
31 | 1. Push to your fork and submit a pull request. |
Gruntfile.js
0 → 100644
1 | 'use strict'; | ||
2 | |||
3 | module.exports = function(grunt) { | ||
4 | |||
5 | // Project configuration. | ||
6 | grunt.initConfig({ | ||
7 | // Metadata. | ||
8 | pkg: grunt.file.readJSON('package.json'), | ||
9 | banner: '/*! <%= pkg.name %> - v<%= pkg.version %> - ' + | ||
10 | '<%= grunt.template.today("yyyy-mm-dd") %>\n' + | ||
11 | '* Copyright (c) <%= grunt.template.today("yyyy") %> Brightcove;' + | ||
12 | ' Licensed <%= _.pluck(pkg.licenses, "type").join(", ") %> */\n', | ||
13 | // Task configuration. | ||
14 | clean: { | ||
15 | files: ['dist'] | ||
16 | }, | ||
17 | concat: { | ||
18 | options: { | ||
19 | banner: '<%= banner %>', | ||
20 | stripBanners: true | ||
21 | }, | ||
22 | dist: { | ||
23 | src: ['src/*.js'], | ||
24 | dest: 'dist/videojs.hls.js' | ||
25 | }, | ||
26 | }, | ||
27 | uglify: { | ||
28 | options: { | ||
29 | banner: '<%= banner %>' | ||
30 | }, | ||
31 | dist: { | ||
32 | src: '<%= concat.dist.dest %>', | ||
33 | dest: 'dist/videojs.hls.min.js' | ||
34 | }, | ||
35 | }, | ||
36 | qunit: { | ||
37 | files: ['test/**/*.html'] | ||
38 | }, | ||
39 | jshint: { | ||
40 | gruntfile: { | ||
41 | options: { | ||
42 | jshintrc: '.jshintrc' | ||
43 | }, | ||
44 | src: 'Gruntfile.js' | ||
45 | }, | ||
46 | src: { | ||
47 | options: { | ||
48 | jshintrc: 'src/.jshintrc' | ||
49 | }, | ||
50 | src: ['src/**/*.js'] | ||
51 | }, | ||
52 | test: { | ||
53 | options: { | ||
54 | jshintrc: 'test/.jshintrc' | ||
55 | }, | ||
56 | src: ['test/**/*.js'] | ||
57 | }, | ||
58 | }, | ||
59 | watch: { | ||
60 | gruntfile: { | ||
61 | files: '<%= jshint.gruntfile.src %>', | ||
62 | tasks: ['jshint:gruntfile'] | ||
63 | }, | ||
64 | src: { | ||
65 | files: '<%= jshint.src.src %>', | ||
66 | tasks: ['jshint:src', 'qunit'] | ||
67 | }, | ||
68 | test: { | ||
69 | files: '<%= jshint.test.src %>', | ||
70 | tasks: ['jshint:test', 'qunit'] | ||
71 | }, | ||
72 | }, | ||
73 | }); | ||
74 | |||
75 | // These plugins provide necessary tasks. | ||
76 | grunt.loadNpmTasks('grunt-contrib-clean'); | ||
77 | grunt.loadNpmTasks('grunt-contrib-concat'); | ||
78 | grunt.loadNpmTasks('grunt-contrib-uglify'); | ||
79 | grunt.loadNpmTasks('grunt-contrib-qunit'); | ||
80 | grunt.loadNpmTasks('grunt-contrib-jshint'); | ||
81 | grunt.loadNpmTasks('grunt-contrib-watch'); | ||
82 | |||
83 | // Default task. | ||
84 | grunt.registerTask('default', ['jshint', 'qunit', 'clean', 'concat', 'uglify']); | ||
85 | |||
86 | }; |
README.md
0 → 100644
1 | # video.js HLS Plugin | ||
2 | |||
3 | A video.js plugin that plays HLS video on platforms that don't support it but have Flash. | ||
4 | |||
5 | ## Getting Started | ||
6 | Download the [production version][min] or the [development version][max]. | ||
7 | |||
8 | [min]: https://raw.bithub.com/dlapalomento/video-js-hls/master/dist/video-js-hls.min.js | ||
9 | [max]: https://raw.bithub.com/dlapalomento/video-js-hls/master/dist/video-js-hls.js | ||
10 | |||
11 | In your web page: | ||
12 | |||
13 | ```html | ||
14 | <script src="video.js"></script> | ||
15 | <script src="dist/video-js-hls.min.js"></script> | ||
16 | <script> | ||
17 | var player = videojs('video'); | ||
18 | player.hls(); | ||
19 | </script> | ||
20 | ``` | ||
21 | |||
22 | ## Documentation | ||
23 | _(Coming soon)_ | ||
24 | |||
25 | ## Examples | ||
26 | _(Coming soon)_ | ||
27 | |||
28 | ## Release History | ||
29 | _(Nothing yet)_ |
libs/qunit/qunit.css
0 → 100644
1 | /** | ||
2 | * QUnit v1.11.0 - A JavaScript Unit Testing Framework | ||
3 | * | ||
4 | * http://qunitjs.com | ||
5 | * | ||
6 | * Copyright 2012 jQuery Foundation and other contributors | ||
7 | * Released under the MIT license. | ||
8 | * http://jquery.org/license | ||
9 | */ | ||
10 | |||
11 | /** Font Family and Sizes */ | ||
12 | |||
13 | #qunit-tests, #qunit-header, #qunit-banner, #qunit-testrunner-toolbar, #qunit-userAgent, #qunit-testresult { | ||
14 | font-family: "Helvetica Neue Light", "HelveticaNeue-Light", "Helvetica Neue", Calibri, Helvetica, Arial, sans-serif; | ||
15 | } | ||
16 | |||
17 | #qunit-testrunner-toolbar, #qunit-userAgent, #qunit-testresult, #qunit-tests li { font-size: small; } | ||
18 | #qunit-tests { font-size: smaller; } | ||
19 | |||
20 | |||
21 | /** Resets */ | ||
22 | |||
23 | #qunit-tests, #qunit-header, #qunit-banner, #qunit-userAgent, #qunit-testresult, #qunit-modulefilter { | ||
24 | margin: 0; | ||
25 | padding: 0; | ||
26 | } | ||
27 | |||
28 | |||
29 | /** Header */ | ||
30 | |||
31 | #qunit-header { | ||
32 | padding: 0.5em 0 0.5em 1em; | ||
33 | |||
34 | color: #8699a4; | ||
35 | background-color: #0d3349; | ||
36 | |||
37 | font-size: 1.5em; | ||
38 | line-height: 1em; | ||
39 | font-weight: normal; | ||
40 | |||
41 | border-radius: 5px 5px 0 0; | ||
42 | -moz-border-radius: 5px 5px 0 0; | ||
43 | -webkit-border-top-right-radius: 5px; | ||
44 | -webkit-border-top-left-radius: 5px; | ||
45 | } | ||
46 | |||
47 | #qunit-header a { | ||
48 | text-decoration: none; | ||
49 | color: #c2ccd1; | ||
50 | } | ||
51 | |||
52 | #qunit-header a:hover, | ||
53 | #qunit-header a:focus { | ||
54 | color: #fff; | ||
55 | } | ||
56 | |||
57 | #qunit-testrunner-toolbar label { | ||
58 | display: inline-block; | ||
59 | padding: 0 .5em 0 .1em; | ||
60 | } | ||
61 | |||
62 | #qunit-banner { | ||
63 | height: 5px; | ||
64 | } | ||
65 | |||
66 | #qunit-testrunner-toolbar { | ||
67 | padding: 0.5em 0 0.5em 2em; | ||
68 | color: #5E740B; | ||
69 | background-color: #eee; | ||
70 | overflow: hidden; | ||
71 | } | ||
72 | |||
73 | #qunit-userAgent { | ||
74 | padding: 0.5em 0 0.5em 2.5em; | ||
75 | background-color: #2b81af; | ||
76 | color: #fff; | ||
77 | text-shadow: rgba(0, 0, 0, 0.5) 2px 2px 1px; | ||
78 | } | ||
79 | |||
80 | #qunit-modulefilter-container { | ||
81 | float: right; | ||
82 | } | ||
83 | |||
84 | /** Tests: Pass/Fail */ | ||
85 | |||
86 | #qunit-tests { | ||
87 | list-style-position: inside; | ||
88 | } | ||
89 | |||
90 | #qunit-tests li { | ||
91 | padding: 0.4em 0.5em 0.4em 2.5em; | ||
92 | border-bottom: 1px solid #fff; | ||
93 | list-style-position: inside; | ||
94 | } | ||
95 | |||
96 | #qunit-tests.hidepass li.pass, #qunit-tests.hidepass li.running { | ||
97 | display: none; | ||
98 | } | ||
99 | |||
100 | #qunit-tests li strong { | ||
101 | cursor: pointer; | ||
102 | } | ||
103 | |||
104 | #qunit-tests li a { | ||
105 | padding: 0.5em; | ||
106 | color: #c2ccd1; | ||
107 | text-decoration: none; | ||
108 | } | ||
109 | #qunit-tests li a:hover, | ||
110 | #qunit-tests li a:focus { | ||
111 | color: #000; | ||
112 | } | ||
113 | |||
114 | #qunit-tests li .runtime { | ||
115 | float: right; | ||
116 | font-size: smaller; | ||
117 | } | ||
118 | |||
119 | .qunit-assert-list { | ||
120 | margin-top: 0.5em; | ||
121 | padding: 0.5em; | ||
122 | |||
123 | background-color: #fff; | ||
124 | |||
125 | border-radius: 5px; | ||
126 | -moz-border-radius: 5px; | ||
127 | -webkit-border-radius: 5px; | ||
128 | } | ||
129 | |||
130 | .qunit-collapsed { | ||
131 | display: none; | ||
132 | } | ||
133 | |||
134 | #qunit-tests table { | ||
135 | border-collapse: collapse; | ||
136 | margin-top: .2em; | ||
137 | } | ||
138 | |||
139 | #qunit-tests th { | ||
140 | text-align: right; | ||
141 | vertical-align: top; | ||
142 | padding: 0 .5em 0 0; | ||
143 | } | ||
144 | |||
145 | #qunit-tests td { | ||
146 | vertical-align: top; | ||
147 | } | ||
148 | |||
149 | #qunit-tests pre { | ||
150 | margin: 0; | ||
151 | white-space: pre-wrap; | ||
152 | word-wrap: break-word; | ||
153 | } | ||
154 | |||
155 | #qunit-tests del { | ||
156 | background-color: #e0f2be; | ||
157 | color: #374e0c; | ||
158 | text-decoration: none; | ||
159 | } | ||
160 | |||
161 | #qunit-tests ins { | ||
162 | background-color: #ffcaca; | ||
163 | color: #500; | ||
164 | text-decoration: none; | ||
165 | } | ||
166 | |||
167 | /*** Test Counts */ | ||
168 | |||
169 | #qunit-tests b.counts { color: black; } | ||
170 | #qunit-tests b.passed { color: #5E740B; } | ||
171 | #qunit-tests b.failed { color: #710909; } | ||
172 | |||
173 | #qunit-tests li li { | ||
174 | padding: 5px; | ||
175 | background-color: #fff; | ||
176 | border-bottom: none; | ||
177 | list-style-position: inside; | ||
178 | } | ||
179 | |||
180 | /*** Passing Styles */ | ||
181 | |||
182 | #qunit-tests li li.pass { | ||
183 | color: #3c510c; | ||
184 | background-color: #fff; | ||
185 | border-left: 10px solid #C6E746; | ||
186 | } | ||
187 | |||
188 | #qunit-tests .pass { color: #528CE0; background-color: #D2E0E6; } | ||
189 | #qunit-tests .pass .test-name { color: #366097; } | ||
190 | |||
191 | #qunit-tests .pass .test-actual, | ||
192 | #qunit-tests .pass .test-expected { color: #999999; } | ||
193 | |||
194 | #qunit-banner.qunit-pass { background-color: #C6E746; } | ||
195 | |||
196 | /*** Failing Styles */ | ||
197 | |||
198 | #qunit-tests li li.fail { | ||
199 | color: #710909; | ||
200 | background-color: #fff; | ||
201 | border-left: 10px solid #EE5757; | ||
202 | white-space: pre; | ||
203 | } | ||
204 | |||
205 | #qunit-tests > li:last-child { | ||
206 | border-radius: 0 0 5px 5px; | ||
207 | -moz-border-radius: 0 0 5px 5px; | ||
208 | -webkit-border-bottom-right-radius: 5px; | ||
209 | -webkit-border-bottom-left-radius: 5px; | ||
210 | } | ||
211 | |||
212 | #qunit-tests .fail { color: #000000; background-color: #EE5757; } | ||
213 | #qunit-tests .fail .test-name, | ||
214 | #qunit-tests .fail .module-name { color: #000000; } | ||
215 | |||
216 | #qunit-tests .fail .test-actual { color: #EE5757; } | ||
217 | #qunit-tests .fail .test-expected { color: green; } | ||
218 | |||
219 | #qunit-banner.qunit-fail { background-color: #EE5757; } | ||
220 | |||
221 | |||
222 | /** Result */ | ||
223 | |||
224 | #qunit-testresult { | ||
225 | padding: 0.5em 0.5em 0.5em 2.5em; | ||
226 | |||
227 | color: #2b81af; | ||
228 | background-color: #D2E0E6; | ||
229 | |||
230 | border-bottom: 1px solid white; | ||
231 | } | ||
232 | #qunit-testresult .module-name { | ||
233 | font-weight: bold; | ||
234 | } | ||
235 | |||
236 | /** Fixture */ | ||
237 | |||
238 | #qunit-fixture { | ||
239 | position: absolute; | ||
240 | top: -10000px; | ||
241 | left: -10000px; | ||
242 | width: 1000px; | ||
243 | height: 1000px; | ||
244 | } |
libs/qunit/qunit.js
0 → 100644
This diff is collapsed.
Click to expand it.
package.json
0 → 100644
1 | { | ||
2 | "name": "videojs-hls", | ||
3 | "version": "0.1.0", | ||
4 | "engines": { | ||
5 | "node": ">= 0.8.0" | ||
6 | }, | ||
7 | "scripts": { | ||
8 | "test": "grunt qunit" | ||
9 | }, | ||
10 | "devDependencies": { | ||
11 | "grunt-contrib-jshint": "~0.6.0", | ||
12 | "grunt-contrib-qunit": "~0.2.0", | ||
13 | "grunt-contrib-concat": "~0.3.0", | ||
14 | "grunt-contrib-uglify": "~0.2.0", | ||
15 | "grunt-contrib-watch": "~0.4.0", | ||
16 | "grunt-contrib-clean": "~0.4.0", | ||
17 | "grunt": "~0.4.1" | ||
18 | } | ||
19 | } |
src/.jshintrc
0 → 100644
src/video-js-hls.js
0 → 100644
test/.jshintrc
0 → 100644
1 | { | ||
2 | "curly": true, | ||
3 | "eqeqeq": true, | ||
4 | "immed": true, | ||
5 | "latedef": true, | ||
6 | "newcap": true, | ||
7 | "noarg": true, | ||
8 | "sub": true, | ||
9 | "undef": true, | ||
10 | "unused": true, | ||
11 | "boss": true, | ||
12 | "eqnull": true, | ||
13 | "browser": true, | ||
14 | "predef": [ | ||
15 | "QUnit", | ||
16 | "module", | ||
17 | "test", | ||
18 | "asyncTest", | ||
19 | "expect", | ||
20 | "start", | ||
21 | "stop", | ||
22 | "ok", | ||
23 | "equal", | ||
24 | "notEqual", | ||
25 | "deepEqual", | ||
26 | "notDeepEqual", | ||
27 | "strictEqual", | ||
28 | "notStrictEqual", | ||
29 | "throws" | ||
30 | ] | ||
31 | } |
test/video-js-hls.html
0 → 100644
1 | <!DOCTYPE html> | ||
2 | <html> | ||
3 | <head> | ||
4 | <meta charset="utf-8"> | ||
5 | <title>video.js HLS Plugin Test Suite</title> | ||
6 | <!-- Load local QUnit. --> | ||
7 | <link rel="stylesheet" href="../libs/qunit/qunit.css" media="screen"> | ||
8 | <script src="../libs/qunit/qunit.js"></script> | ||
9 | <!-- Load local lib and tests. --> | ||
10 | <script src="../src/video-js-hls.js"></script> | ||
11 | <script src="video-js-hls_test.js"></script> | ||
12 | </head> | ||
13 | <body> | ||
14 | <div id="qunit"></div> | ||
15 | <div id="qunit-fixture"> | ||
16 | <span>test markup</span> | ||
17 | </div> | ||
18 | </body> | ||
19 | </html> |
test/video-js-hls_test.js
0 → 100644
1 | (function() { | ||
2 | /* | ||
3 | ======== A Handy Little QUnit Reference ======== | ||
4 | http://api.qunitjs.com/ | ||
5 | |||
6 | Test methods: | ||
7 | module(name, {[setup][ ,teardown]}) | ||
8 | test(name, callback) | ||
9 | expect(numberOfAssertions) | ||
10 | stop(increment) | ||
11 | start(decrement) | ||
12 | Test assertions: | ||
13 | ok(value, [message]) | ||
14 | equal(actual, expected, [message]) | ||
15 | notEqual(actual, expected, [message]) | ||
16 | deepEqual(actual, expected, [message]) | ||
17 | notDeepEqual(actual, expected, [message]) | ||
18 | strictEqual(actual, expected, [message]) | ||
19 | notStrictEqual(actual, expected, [message]) | ||
20 | throws(block, [expected], [message]) | ||
21 | */ | ||
22 | |||
23 | module('environment', { | ||
24 | // This will run before each test in this module. | ||
25 | setup: function() { | ||
26 | } | ||
27 | }); | ||
28 | |||
29 | test('is sane', function() { | ||
30 | expect(1); | ||
31 | ok(true); | ||
32 | }); | ||
33 | }()); |
-
Please register or sign in to post a comment