2013-02-08 17:27:04 -05:00
|
|
|
module('HTML5');
|
2013-03-01 17:11:20 -05:00
|
|
|
|
|
|
|
test('should detect whether the volume can be changed', function(){
|
2013-03-05 13:38:47 -05:00
|
|
|
var testVid, ConstVolumeVideo;
|
2013-03-05 18:07:35 -05:00
|
|
|
if (!{}['__defineSetter__']) {
|
|
|
|
ok(true, 'your browser does not support this test, skipping it');
|
|
|
|
return;
|
|
|
|
}
|
2013-03-05 13:38:47 -05:00
|
|
|
testVid = vjs.TEST_VID;
|
|
|
|
ConstVolumeVideo = function(){
|
|
|
|
this.volume = 1;
|
|
|
|
this.__defineSetter__('volume', function(){});
|
|
|
|
};
|
2013-03-01 17:11:20 -05:00
|
|
|
vjs.TEST_VID = new ConstVolumeVideo();
|
|
|
|
|
|
|
|
ok(!vjs.Html5.canControlVolume());
|
|
|
|
vjs.TEST_VID = testVid;
|
|
|
|
});
|
2013-03-07 20:57:52 -05:00
|
|
|
|
|
|
|
test('should re-link the player if the tech is moved', function(){
|
|
|
|
var player, tech, el;
|
|
|
|
el = document.createElement('div');
|
|
|
|
el.innerHTML = '<div />';
|
2013-08-09 14:29:22 -07:00
|
|
|
|
2013-03-07 20:57:52 -05:00
|
|
|
player = {
|
|
|
|
id: function(){ return 'id'; },
|
|
|
|
el: function(){ return el; },
|
|
|
|
options_: {},
|
2013-08-09 14:29:22 -07:00
|
|
|
options: function(){ return {}; },
|
|
|
|
controls: function(){ return false; },
|
|
|
|
usingNativeControls: function(){ return false; },
|
|
|
|
on: function(){ return this; },
|
2013-03-07 20:57:52 -05:00
|
|
|
ready: function(){}
|
|
|
|
};
|
|
|
|
tech = new vjs.Html5(player, {});
|
2013-04-09 13:18:55 -07:00
|
|
|
vjs.Html5.movingMediaElementInDOM = false;
|
2013-03-07 20:57:52 -05:00
|
|
|
tech.createEl();
|
|
|
|
|
2013-03-08 10:13:01 -05:00
|
|
|
strictEqual(player, tech.el()['player']);
|
2013-08-09 14:29:22 -07:00
|
|
|
});
|