Merge branch 'master' into withcredentials
Conflicts: package.json test/.jshintrc
Showing
8 changed files
with
367 additions
and
7 deletions
1 | language: node_js | 1 | language: node_js |
2 | node_js: | ||
3 | - '0.10' | ||
2 | before_script: | 4 | before_script: |
3 | - npm install -g grunt-cli | 5 | - npm install -g grunt-cli |
4 | notifications: | 6 | notifications: |
5 | hipchat: | 7 | hipchat: |
6 | rooms: | 8 | rooms: |
7 | secure: l5TTd5JuPAW883PtcyaIBcJI9Chr9JpsZPQAEUBKAgIEwzuS6y7t5arlkS1PwH6gi1FADzYDf+OXSIou4GkTSrIetnBcT/SAgF0gBKgIhj+eRkuCfZ4VaC7BPhfZ0hgYRE+5Ejf5BM2MJafRm0pj7OlqG4xKrQZwtuV1te5r3JY= | 9 | secure: l5TTd5JuPAW883PtcyaIBcJI9Chr9JpsZPQAEUBKAgIEwzuS6y7t5arlkS1PwH6gi1FADzYDf+OXSIou4GkTSrIetnBcT/SAgF0gBKgIhj+eRkuCfZ4VaC7BPhfZ0hgYRE+5Ejf5BM2MJafRm0pj7OlqG4xKrQZwtuV1te5r3JY= |
10 | irc: chat.freenode.net#videojs | ||
11 | #addons: | ||
12 | #sauce_connect: | ||
13 | #username: | ||
14 | #secure: "Y++AtTlMXkcPAx+K0cL6uzn4FlmfiIki5bkGCkowoYSCxq1X9tNta39JONSVSeZKBlP58GJwNJdB4Wq1CpJL4NriGc3UvpcgNcrILGOWLczX0zFvXkOIaLn0bUuierf4wzUjk3i6XOh83NrMaX+gBHXb8RVUEBf2z0/WM3zHrEM=" | ||
15 | #access_key: | ||
16 | #secure: "bCan88WIWqm6jP4ZtDbLVrrGXe1a33otfQhi7SYp95wHFLemUHS1JyXv+HbbbsW5dNjatfdhzvc47bpw4LbccL6evVR9sb2Tld15TxW2a2WQtMPzvOfj55aP1YQtIxYwy14swifWGK/Lj/A0ZUCUNolCf7DjCK6hZGaWaDRtdIE=" | ... | ... |
... | @@ -107,10 +107,90 @@ module.exports = function(grunt) { | ... | @@ -107,10 +107,90 @@ module.exports = function(grunt) { |
107 | logConcurrentOutput: true | 107 | logConcurrentOutput: true |
108 | } | 108 | } |
109 | } | 109 | } |
110 | }, | ||
111 | karma: { | ||
112 | options: { | ||
113 | frameworks: ['qunit'] | ||
114 | }, | ||
115 | |||
116 | saucelabs: { | ||
117 | configFile: 'test/karma.conf.js', | ||
118 | autoWatch: true | ||
119 | }, | ||
120 | |||
121 | dev: { | ||
122 | browsers: ['Chrome', 'Safari', 'Firefox', | ||
123 | 'Opera', 'IE', 'PhantomJS', 'ChromeCanary'], | ||
124 | configFile: 'test/localkarma.conf.js', | ||
125 | autoWatch: true | ||
126 | }, | ||
127 | |||
128 | chromecanary: { | ||
129 | options: { | ||
130 | browsers: ['ChromeCanary'], | ||
131 | configFile: 'test/localkarma.conf.js', | ||
132 | autoWatch: true | ||
133 | } | ||
134 | }, | ||
135 | |||
136 | phantomjs: { | ||
137 | options: { | ||
138 | browsers: ['PhantomJS'], | ||
139 | configFile: 'test/localkarma.conf.js', | ||
140 | autoWatch: true | ||
141 | } | ||
142 | }, | ||
143 | |||
144 | opera: { | ||
145 | options: { | ||
146 | browsers: ['Opera'], | ||
147 | configFile: 'test/localkarma.conf.js', | ||
148 | autoWatch: true | ||
149 | } | ||
150 | }, | ||
151 | |||
152 | chrome: { | ||
153 | options: { | ||
154 | browsers: ['Chrome'], | ||
155 | configFile: 'test/localkarma.conf.js', | ||
156 | autoWatch: true | ||
110 | } | 157 | } |
158 | }, | ||
159 | |||
160 | safari: { | ||
161 | options: { | ||
162 | browsers: ['Safari'], | ||
163 | configFile: 'test/localkarma.conf.js', | ||
164 | autoWatch: true | ||
165 | } | ||
166 | }, | ||
167 | |||
168 | firefox: { | ||
169 | options: { | ||
170 | browsers: ['Firefox'], | ||
171 | configFile: 'test/localkarma.conf.js', | ||
172 | autoWatch: true | ||
173 | } | ||
174 | }, | ||
175 | |||
176 | ie: { | ||
177 | options: { | ||
178 | browsers: ['IE'], | ||
179 | configFile: 'test/localkarma.conf.js', | ||
180 | autoWatch: true | ||
181 | } | ||
182 | }, | ||
183 | |||
184 | ci: { | ||
185 | configFile: 'test/karma.conf.js', | ||
186 | autoWatch: false | ||
187 | } | ||
188 | }, | ||
189 | |||
111 | }); | 190 | }); |
112 | 191 | ||
113 | // These plugins provide necessary tasks. | 192 | // These plugins provide necessary tasks. |
193 | grunt.loadNpmTasks('grunt-karma'); | ||
114 | grunt.loadNpmTasks('grunt-contrib-clean'); | 194 | grunt.loadNpmTasks('grunt-contrib-clean'); |
115 | grunt.loadNpmTasks('grunt-contrib-concat'); | 195 | grunt.loadNpmTasks('grunt-contrib-concat'); |
116 | grunt.loadNpmTasks('grunt-contrib-uglify'); | 196 | grunt.loadNpmTasks('grunt-contrib-uglify'); |
... | @@ -120,6 +200,8 @@ module.exports = function(grunt) { | ... | @@ -120,6 +200,8 @@ module.exports = function(grunt) { |
120 | grunt.loadNpmTasks('grunt-contrib-connect'); | 200 | grunt.loadNpmTasks('grunt-contrib-connect'); |
121 | grunt.loadNpmTasks('grunt-open'); | 201 | grunt.loadNpmTasks('grunt-open'); |
122 | grunt.loadNpmTasks('grunt-concurrent'); | 202 | grunt.loadNpmTasks('grunt-concurrent'); |
203 | grunt.loadNpmTasks('grunt-contrib-watch'); | ||
204 | |||
123 | 205 | ||
124 | grunt.registerTask('manifests-to-js', 'Wrap the test fixtures and output' + | 206 | grunt.registerTask('manifests-to-js', 'Wrap the test fixtures and output' + |
125 | ' so they can be loaded in a browser', | 207 | ' so they can be loaded in a browser', |
... | @@ -177,4 +259,10 @@ module.exports = function(grunt) { | ... | @@ -177,4 +259,10 @@ module.exports = function(grunt) { |
177 | 'concat', | 259 | 'concat', |
178 | 'uglify']); | 260 | 'uglify']); |
179 | 261 | ||
262 | grunt.registerTask('test', ['jshint', 'manifests-to-js', 'karma:saucelabs']); | ||
263 | |||
264 | // travis build task | ||
265 | grunt.registerTask('test-local', ['jshint', 'manifests-to-js', 'qunit']); | ||
266 | |||
267 | |||
180 | }; | 268 | }; | ... | ... |
... | @@ -61,7 +61,7 @@ | ... | @@ -61,7 +61,7 @@ |
61 | type="application/x-mpegURL"> | 61 | type="application/x-mpegURL"> |
62 | </video> | 62 | </video> |
63 | <script> | 63 | <script> |
64 | videojs.options.flash.swf = 'node_modules/videojs-swf/dist/video-js.swf'; | 64 | videojs.options.flash.swf = 'node_modules/video.js/dist/video-js/video-js.swf'; |
65 | // initialize the player | 65 | // initialize the player |
66 | var player = videojs('video'); | 66 | var player = videojs('video'); |
67 | 67 | ... | ... |
1 | { | 1 | { |
2 | "name": "videojs-contrib-hls", | 2 | "name": "videojs-contrib-hls", |
3 | "version": "0.3.1", | 3 | "version": "0.3.2", |
4 | "engines": { | 4 | "engines": { |
5 | "node": ">= 0.10.12" | 5 | "node": ">= 0.10.12" |
6 | }, | 6 | }, |
... | @@ -10,7 +10,7 @@ | ... | @@ -10,7 +10,7 @@ |
10 | }, | 10 | }, |
11 | "license": "Apache 2", | 11 | "license": "Apache 2", |
12 | "scripts": { | 12 | "scripts": { |
13 | "test": "grunt" | 13 | "test": "grunt test-local" |
14 | }, | 14 | }, |
15 | "devDependencies": { | 15 | "devDependencies": { |
16 | "grunt-contrib-jshint": "~0.6.0", | 16 | "grunt-contrib-jshint": "~0.6.0", |
... | @@ -24,11 +24,23 @@ | ... | @@ -24,11 +24,23 @@ |
24 | "grunt-open": "0.2.3", | 24 | "grunt-open": "0.2.3", |
25 | "grunt-shell": "0.6.1", | 25 | "grunt-shell": "0.6.1", |
26 | "grunt": "~0.4.1", | 26 | "grunt": "~0.4.1", |
27 | "sinon": "~1.9.0" | 27 | "sinon": "~1.9.0", |
28 | "grunt-karma": "~0.6.2", | ||
29 | "karma": "~0.10.0", | ||
30 | "karma-sauce-launcher": "~0.1.8", | ||
31 | "karma-chrome-launcher": "~0.1.2", | ||
32 | "karma-firefox-launcher": "~0.1.3", | ||
33 | "karma-ie-launcher": "~0.1.1", | ||
34 | "karma-opera-launcher": "~0.1.0", | ||
35 | "karma-phantomjs-launcher": "~0.1.1", | ||
36 | "karma-safari-launcher": "~0.1.1", | ||
37 | "karma-qunit": "~0.1.1", | ||
38 | "video.js": "^4.5" | ||
39 | }, | ||
40 | "peerDependencies": { | ||
41 | "video.js": "^4.5" | ||
28 | }, | 42 | }, |
29 | "dependencies": { | 43 | "dependencies": { |
30 | "video.js": "git+https://github.com/videojs/video.js.git#v4.4.1", | ||
31 | "videojs-swf": "git+https://github.com/videojs/video-js-swf.git#v4.4.0", | ||
32 | "videojs-contrib-media-sources": "git+https://github.com/videojs/videojs-contrib-media-sources.git" | 44 | "videojs-contrib-media-sources": "git+https://github.com/videojs/videojs-contrib-media-sources.git" |
33 | } | 45 | } |
34 | } | 46 | } | ... | ... |
... | @@ -11,6 +11,7 @@ | ... | @@ -11,6 +11,7 @@ |
11 | "boss": true, | 11 | "boss": true, |
12 | "eqnull": true, | 12 | "eqnull": true, |
13 | "browser": true, | 13 | "browser": true, |
14 | "node": true, | ||
14 | "predef": [ | 15 | "predef": [ |
15 | "QUnit", | 16 | "QUnit", |
16 | "module", | 17 | "module", |
... | @@ -27,6 +28,7 @@ | ... | @@ -27,6 +28,7 @@ |
27 | "strictEqual", | 28 | "strictEqual", |
28 | "notStrictEqual", | 29 | "notStrictEqual", |
29 | "throws", | 30 | "throws", |
30 | "sinon" | 31 | "sinon", |
32 | "process" | ||
31 | ] | 33 | ] |
32 | } | 34 | } | ... | ... |
test/karma-qunit-shim.js
0 → 100644
test/karma.conf.js
0 → 100644
1 | // Karma example configuration file | ||
2 | // NOTE: To configure Karma tests, do the following: | ||
3 | // 1. Copy this file and rename the copy with a .conf.js extension, for example: karma.conf.js | ||
4 | // 2. Configure the properties below in your conf.js copy | ||
5 | // 3. Run your tests | ||
6 | |||
7 | module.exports = function(config) { | ||
8 | config.set({ | ||
9 | // base path, that will be used to resolve files and exclude | ||
10 | basePath: '', | ||
11 | |||
12 | frameworks: ['qunit'], | ||
13 | |||
14 | // Set autoWatch to true if you plan to run `grunt karma` continuously, to automatically test changes as you make them. | ||
15 | autoWatch: false, | ||
16 | |||
17 | // Setting singleRun to true here will start up your specified browsers, run tests, and then shut down the browsers. Helpful to have in a CI environment, where you don't want to leave browsers running continuously. | ||
18 | singleRun: true, | ||
19 | |||
20 | // Start these browsers, currently available: | ||
21 | // - Chrome | ||
22 | // - ChromeCanary | ||
23 | // - Firefox | ||
24 | // - Opera | ||
25 | // - Safari (only Mac) | ||
26 | // - PhantomJS | ||
27 | // - IE (only Windows) | ||
28 | // Example usage: | ||
29 | browsers: ['chrome_test'], | ||
30 | //'firefox_test', | ||
31 | //'safari_test', | ||
32 | //'ipad_test', | ||
33 | //'android_test' | ||
34 | |||
35 | // List of files / patterns to load in the browser | ||
36 | // Add any new src files to this list. | ||
37 | // If you add new unit tests, they will be picked up automatically by Karma, | ||
38 | // unless you've added them to a nested directory, in which case you should | ||
39 | // add their paths to this list. | ||
40 | |||
41 | files: [ | ||
42 | '../node_modules/video.js/dist/video-js/video.js', | ||
43 | '../node_modules/videojs-contrib-media-sources/videojs-media-sources.js', | ||
44 | '../test/karma-qunit-shim.js', | ||
45 | "../src/videojs-hls.js", | ||
46 | "../src/flv-tag.js", | ||
47 | "../src/exp-golomb.js", | ||
48 | "../src/h264-stream.js", | ||
49 | "../src/aac-stream.js", | ||
50 | "../src/segment-parser.js", | ||
51 | "../src/stream.js", | ||
52 | "../src/m3u8/m3u8-parser.js", | ||
53 | "../tmp/manifests.js", | ||
54 | "../tmp/expected.js", | ||
55 | "tsSegment-bc.js", | ||
56 | "../src/bin-utils.js", | ||
57 | "../src/async-queue.js", | ||
58 | '../test/*.js' | ||
59 | ], | ||
60 | |||
61 | plugins: [ | ||
62 | 'karma-qunit', | ||
63 | 'karma-chrome-launcher', | ||
64 | 'karma-firefox-launcher', | ||
65 | 'karma-ie-launcher', | ||
66 | 'karma-opera-launcher', | ||
67 | 'karma-phantomjs-launcher', | ||
68 | 'karma-safari-launcher', | ||
69 | 'karma-sauce-launcher' | ||
70 | ], | ||
71 | |||
72 | // list of files to exclude | ||
73 | exclude: [ | ||
74 | |||
75 | ], | ||
76 | |||
77 | |||
78 | // test results reporter to use | ||
79 | // possible values: 'dots', 'progress', 'junit' | ||
80 | reporters: ['progress'], | ||
81 | |||
82 | |||
83 | // web server port | ||
84 | port: 9876, | ||
85 | |||
86 | // cli runner port | ||
87 | runnerPort: 9100, | ||
88 | |||
89 | // enable / disable colors in the output (reporters and logs) | ||
90 | colors: true, | ||
91 | |||
92 | // level of logging | ||
93 | // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG | ||
94 | //logLevel: config.LOG_INFO, | ||
95 | |||
96 | // If browser does not capture in given timeout [ms], kill it | ||
97 | captureTimeout: 60000, | ||
98 | |||
99 | // global config for SauceLabs | ||
100 | sauceLabs: { | ||
101 | startConnect: true, | ||
102 | tunnelIdentifier: process.env.TRAVIS_JOB_NUMBER, | ||
103 | build: process.env.TRAVIS_BUILD_NUMBER, | ||
104 | testName: process.env.TRAVIS_BUILD_NUMBER + process.env.TRAVIS_BRANCH, | ||
105 | recordScreenshots: false | ||
106 | }, | ||
107 | |||
108 | //define SL browsers | ||
109 | customLaunchers: { | ||
110 | chrome_test: { | ||
111 | singleRun: true, | ||
112 | base: 'SauceLabs', | ||
113 | browserName: 'chrome', | ||
114 | platform: 'Windows XP' | ||
115 | }, | ||
116 | |||
117 | firefox_test: { | ||
118 | singleRun: true, | ||
119 | base: 'SauceLabs', | ||
120 | browserName: 'firefox', | ||
121 | platform: 'Windows 8' | ||
122 | }, | ||
123 | |||
124 | safari_test: { | ||
125 | singleRun: true, | ||
126 | base: 'SauceLabs', | ||
127 | browserName: 'safari', | ||
128 | platform: 'OS X 10.8' | ||
129 | }, | ||
130 | |||
131 | ipad_test: { | ||
132 | singleRun: true, | ||
133 | base: 'SauceLabs', | ||
134 | browserName: 'ipad', | ||
135 | platform:'OS X 10.8' | ||
136 | }, | ||
137 | |||
138 | android_test: { | ||
139 | singleRun: true, | ||
140 | base: 'SauceLabs', | ||
141 | browserName: 'android', | ||
142 | platform:'Linux' | ||
143 | } | ||
144 | |||
145 | } | ||
146 | |||
147 | }); | ||
148 | }; |
test/localkarma.conf.js
0 → 100644
1 | // Karma example configuration file | ||
2 | // NOTE: To configure Karma tests, do the following: | ||
3 | // 1. Copy this file and rename the copy with a .conf.js extension, for example: karma.conf.js | ||
4 | // 2. Configure the properties below in your conf.js copy | ||
5 | // 3. Run your tests | ||
6 | |||
7 | module.exports = function(config) { | ||
8 | config.set({ | ||
9 | // base path, that will be used to resolve files and exclude | ||
10 | basePath: '', | ||
11 | |||
12 | frameworks: ['qunit'], | ||
13 | |||
14 | // Set autoWatch to true if you plan to run `grunt karma` continuously, to automatically test changes as you make them. | ||
15 | autoWatch: false, | ||
16 | |||
17 | // Setting singleRun to true here will start up your specified browsers, run tests, and then shut down the browsers. Helpful to have in a CI environment, where you don't want to leave browsers running continuously. | ||
18 | singleRun: true, | ||
19 | |||
20 | // Start these browsers, currently available: | ||
21 | // - Chrome | ||
22 | // - ChromeCanary | ||
23 | // - Firefox | ||
24 | // - Opera | ||
25 | // - Safari (only Mac) | ||
26 | // - PhantomJS | ||
27 | // - IE (only Windows) | ||
28 | // Example usage: | ||
29 | // browsers: [], | ||
30 | // List of files / patterns to load in the browser | ||
31 | // Add any new src files to this list. | ||
32 | // If you add new unit tests, they will be picked up automatically by Karma, | ||
33 | // unless you've added them to a nested directory, in which case you should | ||
34 | // add their paths to this list. | ||
35 | |||
36 | files: [ | ||
37 | '../node_modules/video.js/dist/video-js/video.js', | ||
38 | '../node_modules/videojs-contrib-media-sources/videojs-media-sources.js', | ||
39 | '../test/karma-qunit-shim.js', | ||
40 | "../src/videojs-hls.js", | ||
41 | "../src/flv-tag.js", | ||
42 | "../src/exp-golomb.js", | ||
43 | "../src/h264-stream.js", | ||
44 | "../src/aac-stream.js", | ||
45 | "../src/segment-parser.js", | ||
46 | "../src/stream.js", | ||
47 | "../src/m3u8/m3u8-parser.js", | ||
48 | "../tmp/manifests.js", | ||
49 | "../tmp/expected.js", | ||
50 | "tsSegment-bc.js", | ||
51 | "../src/bin-utils.js", | ||
52 | "../src/async-queue.js", | ||
53 | '../test/*.js' | ||
54 | ], | ||
55 | |||
56 | plugins: [ | ||
57 | 'karma-qunit', | ||
58 | 'karma-chrome-launcher', | ||
59 | 'karma-firefox-launcher', | ||
60 | 'karma-ie-launcher', | ||
61 | 'karma-opera-launcher', | ||
62 | 'karma-phantomjs-launcher', | ||
63 | 'karma-safari-launcher' | ||
64 | ], | ||
65 | |||
66 | // list of files to exclude | ||
67 | exclude: [ | ||
68 | |||
69 | ], | ||
70 | |||
71 | |||
72 | // test results reporter to use | ||
73 | // possible values: 'dots', 'progress', 'junit' | ||
74 | reporters: ['progress'], | ||
75 | |||
76 | |||
77 | // web server port | ||
78 | port: 9876, | ||
79 | |||
80 | |||
81 | // cli runner port | ||
82 | runnerPort: 9100, | ||
83 | |||
84 | |||
85 | // enable / disable colors in the output (reporters and logs) | ||
86 | colors: true, | ||
87 | |||
88 | |||
89 | // level of logging | ||
90 | // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG | ||
91 | //logLevel: config.LOG_INFO, | ||
92 | |||
93 | // If browser does not capture in given timeout [ms], kill it | ||
94 | captureTimeout: 60000 | ||
95 | }); | ||
96 | }; | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
-
Please register or sign in to post a comment