зеркало из https://github.com/mozilla/popcorn-js.git
[#541] Wrote some unit tests in order to test the timeupdating functionality of the baseplayer
This commit is contained in:
Родитель
f0d3b4b9cb
Коммит
e5b7c63e3c
|
@ -59,7 +59,7 @@
|
|||
|
||||
setTimeout( function() {
|
||||
self.timeupdate.call( self );
|
||||
}, 15 );
|
||||
}, 250 );
|
||||
},
|
||||
|
||||
// By default, assumes this.resource is a DOM Element
|
||||
|
|
|
@ -32,6 +32,15 @@
|
|||
height: 250px;
|
||||
background: #FFAAAA;
|
||||
}
|
||||
|
||||
#video {
|
||||
position: absolute;
|
||||
left:620px;
|
||||
top: 260px;
|
||||
width: 300px;
|
||||
height: 175px;
|
||||
background: #FFAAAA;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
@ -43,5 +52,23 @@
|
|||
<div id="qunit-fixture"> </div>
|
||||
|
||||
<span id="player_1">This is a container for the player, auto-sized for testing purposes.</span>
|
||||
<div >
|
||||
<video id='video'
|
||||
controls
|
||||
width= '250px'
|
||||
poster="../../test/poster.png">
|
||||
|
||||
<source id='mp4'
|
||||
src="../../test/trailer.mp4"
|
||||
type='video/mp4; codecs="avc1, mp4a"'>
|
||||
|
||||
<source id='ogv'
|
||||
src="../../test/trailer.ogv"
|
||||
type='video/ogg; codecs="theora, vorbis"'>
|
||||
|
||||
<p>Your user agent does not support the HTML5 Video element.</p>
|
||||
|
||||
</video>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -119,16 +119,16 @@ test( "Default Functionality", function () {
|
|||
|
||||
player.pause();
|
||||
});
|
||||
|
||||
player.play();
|
||||
});
|
||||
|
||||
|
||||
test( "Extension and Method Overriding", function () {
|
||||
var expects = 4,
|
||||
var expects = 5,
|
||||
count = 0,
|
||||
player = Popcorn.baseplayer(),
|
||||
playerForPopcorn = Popcorn.baseplayer(),
|
||||
player2 = Popcorn("#video"),
|
||||
popcorn;
|
||||
|
||||
function plus() {
|
||||
|
@ -163,11 +163,14 @@ test( "Extension and Method Overriding", function () {
|
|||
|
||||
popcorn = Popcorn( playerForPopcorn )
|
||||
.exec( 2, function() {
|
||||
ok( Math.abs(player2.currentTime() - playerForPopcorn.currentTime) < 0.2, "Time update is within a reasonable range" );
|
||||
plus();
|
||||
ok( true, "Exec triggereed from popcorn after 2 seconds" );
|
||||
plus();
|
||||
});
|
||||
|
||||
player.load();
|
||||
player2.play();
|
||||
player.play();
|
||||
|
||||
// Each player will define its own criteria for when readyState should be changed
|
||||
|
|
Загрузка…
Ссылка в новой задаче