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