| 
									
										
										
										
											2013-03-05 22:39:43 +02:00
										 |  |  | module('Player Minified'); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-06-24 12:47:47 -07:00
										 |  |  | test('should be able to access expected player API methods', function() { | 
					
						
							|  |  |  |   var player = PlayerTest.makePlayer(); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   // Native HTML5 Methods
 | 
					
						
							|  |  |  |   ok(player.play, 'play exists'); | 
					
						
							|  |  |  |   ok(player.pause, 'pause exists'); | 
					
						
							|  |  |  |   ok(player.paused, 'paused exists'); | 
					
						
							|  |  |  |   ok(player.src, 'src exists'); | 
					
						
							|  |  |  |   ok(player.currentTime, 'currentTime exists'); | 
					
						
							|  |  |  |   ok(player.duration, 'duration exists'); | 
					
						
							|  |  |  |   ok(player.buffered, 'buffered exists'); | 
					
						
							|  |  |  |   ok(player.volume, 'volume exists'); | 
					
						
							|  |  |  |   ok(player.muted, 'muted exists'); | 
					
						
							|  |  |  |   ok(player.width, 'width exists'); | 
					
						
							|  |  |  |   ok(player.height, 'height exists'); | 
					
						
							|  |  |  |   ok(player.requestFullScreen, 'requestFullScreen exists'); | 
					
						
							|  |  |  |   ok(player.cancelFullScreen, 'cancelFullScreen exists'); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   // Added player methods
 | 
					
						
							|  |  |  |   ok(player.ready, 'ready exists'); | 
					
						
							|  |  |  |   ok(player.on, 'on exists'); | 
					
						
							|  |  |  |   ok(player.off, 'off exists'); | 
					
						
							|  |  |  |   ok(player.one, 'one exists'); | 
					
						
							|  |  |  |   ok(player.bufferedPercent, 'bufferedPercent exists'); | 
					
						
							|  |  |  |   ok(player.dimensions, 'dimensions exists'); | 
					
						
							| 
									
										
										
										
											2013-08-09 14:29:22 -07:00
										 |  |  |   ok(player.usingNativeControls, 'usingNativeControls exists'); | 
					
						
							| 
									
										
										
										
											2013-06-24 12:47:47 -07:00
										 |  |  | 
 | 
					
						
							|  |  |  |   player.dispose(); | 
					
						
							|  |  |  | }); | 
					
						
							| 
									
										
										
										
											2013-03-05 22:39:43 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | 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 09:23:32 -07:00
										 |  |  |   var player = videojs('example_1'); | 
					
						
							| 
									
										
										
										
											2013-03-05 22:39:43 +02:00
										 |  |  |   ok(player.ready !== undefined, 'ready callback is defined'); | 
					
						
							|  |  |  |   player.dispose(); | 
					
						
							|  |  |  | }); | 
					
						
							| 
									
										
										
										
											2013-03-05 23:23:01 +02: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 09:23:32 -07:00
										 |  |  |   var player = videojs('example_1'); | 
					
						
							| 
									
										
										
										
											2013-03-05 23:23:01 +02:00
										 |  |  |   player.dispose(); | 
					
						
							|  |  |  |   ok(!document.getElementById(id), 'element is removed'); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   videoTag = PlayerTest.makeTag(); | 
					
						
							|  |  |  |   fixture.appendChild(videoTag); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-05-09 09:23:32 -07:00
										 |  |  |   player = videojs('example_1'); | 
					
						
							| 
									
										
										
										
											2013-03-05 23:23:01 +02:00
										 |  |  |   player.dispose(); | 
					
						
							|  |  |  | }); | 
					
						
							| 
									
										
										
										
											2013-06-03 13:19:46 -07:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-06-05 10:27:38 -07:00
										 |  |  | test('videojs.players should be availble after minification', function() { | 
					
						
							|  |  |  |   var videoTag = PlayerTest.makeTag(); | 
					
						
							|  |  |  |   var id = videoTag.id; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   var fixture = document.getElementById('qunit-fixture'); | 
					
						
							|  |  |  |   fixture.appendChild(videoTag); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   var player = videojs(id); | 
					
						
							| 
									
										
										
										
											2013-08-09 14:29:22 -07:00
										 |  |  |   ok(videojs.players[id] === player, 'videojs.players is available'); | 
					
						
							| 
									
										
										
										
											2013-06-05 10:27:38 -07:00
										 |  |  | 
 | 
					
						
							|  |  |  |   player.dispose(); | 
					
						
							|  |  |  | }); |