mirror of
https://github.com/videojs/video.js.git
synced 2025-07-17 01:42:41 +02:00
Reformat var
statements
Declare them in a single line at the top of the function and initialize them later.
This commit is contained in:
72
test/unit/controls.js
vendored
72
test/unit/controls.js
vendored
@ -1,51 +1,49 @@
|
|||||||
module('Controls');
|
module('Controls');
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
test('should hide volume control if it\'s not supported', function() {
|
test('should hide volume control if it\'s not supported', function() {
|
||||||
var
|
var noop, player, volumeControl, muteToggle;
|
||||||
noop = function(){},
|
noop = function(){};
|
||||||
player = {
|
player = {
|
||||||
id: noop,
|
id: noop,
|
||||||
on: noop,
|
on: noop,
|
||||||
ready: noop,
|
ready: noop,
|
||||||
tech: {
|
tech: {
|
||||||
features: {
|
features: {
|
||||||
volumeControl: false
|
volumeControl: false
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
volumeControl = new vjs.VolumeControl(player),
|
};
|
||||||
muteToggle = new vjs.MuteToggle(player);
|
volumeControl = new vjs.VolumeControl(player);
|
||||||
|
muteToggle = new vjs.MuteToggle(player);
|
||||||
|
|
||||||
equal(volumeControl.el().style.display, 'none', 'volumeControl is not hidden');
|
equal(volumeControl.el().style.display, 'none', 'volumeControl is not hidden');
|
||||||
equal(muteToggle.el().style.display, 'none', 'muteToggle is not hidden');
|
equal(muteToggle.el().style.display, 'none', 'muteToggle is not hidden');
|
||||||
});
|
});
|
||||||
|
|
||||||
test('should test and toggle volume control on `loadstart`', function(){
|
test('should test and toggle volume control on `loadstart`', function(){
|
||||||
var
|
var noop, listeners, player, volumeControl, muteToggle;
|
||||||
noop = function(){},
|
noop = function(){};
|
||||||
listeners = [],
|
listeners = [];
|
||||||
player = {
|
player = {
|
||||||
id: noop,
|
id: noop,
|
||||||
on: function(event, callback){
|
on: function(event, callback){
|
||||||
listeners.push(callback);
|
listeners.push(callback);
|
||||||
},
|
|
||||||
ready: noop,
|
|
||||||
volume: function(){
|
|
||||||
return 1;
|
|
||||||
},
|
|
||||||
muted: function(){
|
|
||||||
return false;
|
|
||||||
},
|
|
||||||
tech: {
|
|
||||||
features: {
|
|
||||||
volumeControl: true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
volumeControl = new vjs.VolumeControl(player),
|
ready: noop,
|
||||||
muteToggle = new vjs.MuteToggle(player);
|
volume: function(){
|
||||||
|
return 1;
|
||||||
|
},
|
||||||
|
muted: function(){
|
||||||
|
return false;
|
||||||
|
},
|
||||||
|
tech: {
|
||||||
|
features: {
|
||||||
|
volumeControl: true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
volumeControl = new vjs.VolumeControl(player);
|
||||||
|
muteToggle = new vjs.MuteToggle(player);
|
||||||
|
|
||||||
equal(volumeControl.el().style.display,
|
equal(volumeControl.el().style.display,
|
||||||
'',
|
'',
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
module('HTML5');
|
module('HTML5');
|
||||||
|
|
||||||
test('should detect whether the volume can be changed', function(){
|
test('should detect whether the volume can be changed', function(){
|
||||||
var
|
var testVid, ConstVolumeVideo;
|
||||||
testVid = vjs.TEST_VID,
|
testVid = vjs.TEST_VID;
|
||||||
ConstVolumeVideo = function(){
|
ConstVolumeVideo = function(){
|
||||||
this.volume = 1;
|
this.volume = 1;
|
||||||
this.__defineSetter__('volume', function(){});
|
this.__defineSetter__('volume', function(){});
|
||||||
};
|
};
|
||||||
vjs.TEST_VID = new ConstVolumeVideo();
|
vjs.TEST_VID = new ConstVolumeVideo();
|
||||||
|
|
||||||
ok(!vjs.Html5.canControlVolume());
|
ok(!vjs.Html5.canControlVolume());
|
||||||
|
Reference in New Issue
Block a user