1
0
mirror of https://github.com/videojs/video.js.git synced 2024-12-12 11:15:04 +02:00
video.js/test/unit/api.js

54 lines
1.4 KiB
JavaScript
Raw Normal View History

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');
ok(player.ready !== undefined, 'ready callback is defined');
player.dispose();
});
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');
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');
player.dispose();
});
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();
});