2013-03-05 23:39:43 +03:00
|
|
|
module('Player Minified');
|
|
|
|
|
|
|
|
var PlayerTest = {
|
|
|
|
makeTag: function(){
|
|
|
|
var videoTag = document.createElement('video');
|
|
|
|
videoTag.id = 'example_1';
|
|
|
|
videoTag.className = 'video-js vjs-default-skin';
|
|
|
|
return videoTag;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
test('should export ready api call to public', function() {
|
|
|
|
var videoTag = PlayerTest.makeTag();
|
|
|
|
|
|
|
|
var fixture = document.getElementById('qunit-fixture');
|
|
|
|
fixture.appendChild(videoTag);
|
|
|
|
|
2013-05-09 19:23:32 +03:00
|
|
|
var player = videojs('example_1');
|
2013-03-05 23:39:43 +03:00
|
|
|
ok(player.ready !== undefined, 'ready callback is defined');
|
|
|
|
player.dispose();
|
|
|
|
});
|
2013-03-06 00:23:01 +03:00
|
|
|
|
|
|
|
test('should be able to initialize player twice on the same tag using string reference', function() {
|
|
|
|
var videoTag = PlayerTest.makeTag();
|
|
|
|
var id = videoTag.id;
|
|
|
|
|
|
|
|
var fixture = document.getElementById('qunit-fixture');
|
|
|
|
fixture.appendChild(videoTag);
|
|
|
|
|
2013-05-09 19:23:32 +03:00
|
|
|
var player = videojs('example_1');
|
2013-03-06 00:23:01 +03:00
|
|
|
player.dispose();
|
|
|
|
ok(!document.getElementById(id), 'element is removed');
|
|
|
|
|
|
|
|
videoTag = PlayerTest.makeTag();
|
|
|
|
fixture.appendChild(videoTag);
|
|
|
|
|
2013-05-09 19:23:32 +03:00
|
|
|
player = videojs('example_1');
|
2013-03-06 00:23:01 +03:00
|
|
|
player.dispose();
|
|
|
|
});
|
2013-06-03 23:19:46 +03:00
|
|
|
|
|
|
|
test('requestFullScreen and cancelFullScreen methods should exist', function() {
|
|
|
|
var videoTag = PlayerTest.makeTag();
|
|
|
|
var id = videoTag.id;
|
|
|
|
|
|
|
|
var fixture = document.getElementById('qunit-fixture');
|
|
|
|
fixture.appendChild(videoTag);
|
|
|
|
|
|
|
|
var player = videojs('example_1');
|
|
|
|
ok(player.requestFullScreen, 'requestFullScreen exists');
|
|
|
|
ok(player.requestFullScreen, 'cancelFullScreen exists');
|
|
|
|
|
|
|
|
player.dispose();
|
|
|
|
});
|