mirror of
https://github.com/videojs/video.js.git
synced 2025-07-13 01:30:17 +02:00
@dmlap added an error message if techOrder is not in options. closes #2097
This commit is contained in:
@ -20,6 +20,7 @@ CHANGELOG
|
|||||||
* @forbesjo added a vjs-button class to button controls ([view](https://github.com/videojs/video.js/pull/2084))
|
* @forbesjo added a vjs-button class to button controls ([view](https://github.com/videojs/video.js/pull/2084))
|
||||||
* @bc-bbay Load plugins before controls ([view](https://github.com/videojs/video.js/pull/2094))
|
* @bc-bbay Load plugins before controls ([view](https://github.com/videojs/video.js/pull/2094))
|
||||||
* @bc-bbay rename onEvent methods to handleEvent ([view](https://github.com/videojs/video.js/pull/2093))
|
* @bc-bbay rename onEvent methods to handleEvent ([view](https://github.com/videojs/video.js/pull/2093))
|
||||||
|
* @dmlap added an error message if techOrder is not in options ([view](https://github.com/videojs/video.js/pull/2097))
|
||||||
|
|
||||||
--------------------
|
--------------------
|
||||||
|
|
||||||
|
40
Gruntfile.js
40
Gruntfile.js
@ -269,6 +269,21 @@ module.exports = function(grunt) {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
browserify: {
|
browserify: {
|
||||||
|
options: {
|
||||||
|
transform: [
|
||||||
|
require('babelify').configure({
|
||||||
|
sourceMapRelative: './src/js'
|
||||||
|
}),
|
||||||
|
['browserify-versionify', {
|
||||||
|
placeholder: '__VERSION__',
|
||||||
|
version: pkg.version
|
||||||
|
}],
|
||||||
|
['browserify-versionify', {
|
||||||
|
placeholder: '__VERSION_NO_PATCH__',
|
||||||
|
version: version.majorMinor
|
||||||
|
}]
|
||||||
|
]
|
||||||
|
},
|
||||||
build: {
|
build: {
|
||||||
files: {
|
files: {
|
||||||
'build/temp/video.js': ['src/js/video.js']
|
'build/temp/video.js': ['src/js/video.js']
|
||||||
@ -281,19 +296,15 @@ module.exports = function(grunt) {
|
|||||||
banner: license,
|
banner: license,
|
||||||
plugin: [
|
plugin: [
|
||||||
[ 'browserify-derequire' ]
|
[ 'browserify-derequire' ]
|
||||||
],
|
]
|
||||||
transform: [
|
}
|
||||||
require('babelify').configure({
|
},
|
||||||
sourceMapRelative: './src/js'
|
test: {
|
||||||
}),
|
files: {
|
||||||
['browserify-versionify', {
|
'build/temp/tests.js': [
|
||||||
placeholder: '__VERSION__',
|
'test/globals-shim.js',
|
||||||
version: pkg.version
|
'test/unit/**/*.js',
|
||||||
}],
|
'test/api/**.js'
|
||||||
['browserify-versionify', {
|
|
||||||
placeholder: '__VERSION_NO_PATCH__',
|
|
||||||
version: version.majorMinor
|
|
||||||
}]
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -307,6 +318,9 @@ module.exports = function(grunt) {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
coveralls: {
|
coveralls: {
|
||||||
|
options: {
|
||||||
|
force: true
|
||||||
|
},
|
||||||
all: {
|
all: {
|
||||||
src: 'test/coverage/lcov.info'
|
src: 'test/coverage/lcov.info'
|
||||||
}
|
}
|
||||||
|
@ -76,6 +76,17 @@ class Player extends Component {
|
|||||||
// Run base component initializing with new options
|
// Run base component initializing with new options
|
||||||
super(null, options, ready);
|
super(null, options, ready);
|
||||||
|
|
||||||
|
|
||||||
|
// if the global option object was accidentally blown away by
|
||||||
|
// someone, bail early with an informative error
|
||||||
|
if (!this.options_ ||
|
||||||
|
!this.options_.techOrder ||
|
||||||
|
!this.options_.techOrder.length) {
|
||||||
|
throw new Error('No techOrder specified. Did you overwrite ' +
|
||||||
|
'videojs.options instead of just changing the ' +
|
||||||
|
'properties you want to override?');
|
||||||
|
}
|
||||||
|
|
||||||
this.tag = tag; // Store the original tag used to set options
|
this.tag = tag; // Store the original tag used to set options
|
||||||
|
|
||||||
// Store the tag attributes used to restore html5 element
|
// Store the tag attributes used to restore html5 element
|
||||||
|
10
test/globals-shim.js
Normal file
10
test/globals-shim.js
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
import window from 'global/window';
|
||||||
|
import sinon from 'sinon';
|
||||||
|
|
||||||
|
window.q = QUnit;
|
||||||
|
window.sinon = sinon;
|
||||||
|
|
||||||
|
// This may not be needed anymore, but double check before removing
|
||||||
|
window.fixture = document.createElement('div');
|
||||||
|
fixture.id = 'qunit-fixture';
|
||||||
|
document.body.appendChild(fixture);
|
15
test/index.html
Normal file
15
test/index.html
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
<!doctype html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<title>VideoJS Tests</title>
|
||||||
|
<link rel="stylesheet" href="../node_modules/qunitjs/qunit/qunit.css">
|
||||||
|
<link rel="stylesheet" href="../build/temp/video-js.min.css">
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="qunit"></div>
|
||||||
|
<script src="../node_modules/qunitjs/qunit/qunit.js"></script>
|
||||||
|
<script src="../build/temp/tests.js"></script>
|
||||||
|
<script src="api/api.js"></script>
|
||||||
|
</body>
|
||||||
|
</html>
|
@ -1,6 +0,0 @@
|
|||||||
var q = QUnit;
|
|
||||||
|
|
||||||
// This may not be needed anymore, but double check before removing
|
|
||||||
var fixture = document.createElement('div');
|
|
||||||
fixture.id = 'qunit-fixture';
|
|
||||||
document.body.appendChild(fixture);
|
|
@ -50,20 +50,16 @@ module.exports = function(config) {
|
|||||||
config.set({
|
config.set({
|
||||||
basePath: '',
|
basePath: '',
|
||||||
|
|
||||||
frameworks: ['browserify', 'qunit', 'sinon'],
|
frameworks: ['browserify', 'qunit'],
|
||||||
|
|
||||||
autoWatch: false,
|
autoWatch: false,
|
||||||
|
|
||||||
singleRun: true,
|
singleRun: true,
|
||||||
|
|
||||||
// customLaunchers: customLaunchers,
|
|
||||||
|
|
||||||
files: [
|
files: [
|
||||||
'../build/temp/video-js.min.css',
|
'../build/temp/video-js.min.css',
|
||||||
'../test/karma-qunit-shim.js',
|
|
||||||
'../test/unit/**/*.js',
|
|
||||||
'../build/temp/video.min.js',
|
'../build/temp/video.min.js',
|
||||||
'../test/api/**/*.js',
|
'../build/temp/tests.js',
|
||||||
],
|
],
|
||||||
|
|
||||||
preprocessors: {
|
preprocessors: {
|
||||||
@ -84,7 +80,6 @@ module.exports = function(config) {
|
|||||||
'karma-phantomjs-launcher',
|
'karma-phantomjs-launcher',
|
||||||
'karma-safari-launcher',
|
'karma-safari-launcher',
|
||||||
'karma-sauce-launcher',
|
'karma-sauce-launcher',
|
||||||
'karma-sinon',
|
|
||||||
'karma-browserify',
|
'karma-browserify',
|
||||||
'karma-coverage'
|
'karma-coverage'
|
||||||
],
|
],
|
||||||
|
@ -717,3 +717,14 @@ test('should be scrubbing while seeking', function(){
|
|||||||
equal(player.scrubbing(), true, 'player is scrubbing');
|
equal(player.scrubbing(), true, 'player is scrubbing');
|
||||||
ok(player.el().className.indexOf('scrubbing') !== -1, 'scrubbing class is present');
|
ok(player.el().className.indexOf('scrubbing') !== -1, 'scrubbing class is present');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test('should throw on startup no techs are specified', function() {
|
||||||
|
const techOrder = Options.techOrder;
|
||||||
|
|
||||||
|
Options.techOrder = null;
|
||||||
|
q.throws(function() {
|
||||||
|
videojs(TestHelpers.makeTag());
|
||||||
|
}, 'a falsey techOrder should throw');
|
||||||
|
|
||||||
|
Options.techOrder = techOrder;
|
||||||
|
});
|
||||||
|
Reference in New Issue
Block a user