From: rwldrn Date: Wed, 20 Jul 2011 20:15:04 +0000 (-0400) Subject: Initial fix X-Git-Tag: v0.8^2~31^2~1^2 X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=e2bfe53da0a15d2e20b9b68a35268ad2284c12db;p=popcorn-js.git Initial fix --- diff --git a/popcorn.js b/popcorn.js index 33c4926..8039631 100644 --- a/popcorn.js +++ b/popcorn.js @@ -180,13 +180,13 @@ start: -1, end: -1 }], - byEnd: [{ + byEnd: [{ start: -1, end: -1 }], startIndex: 0, - endIndex: 0, - previousUpdateTime: 0 + endIndex: 0, + previousUpdateTime: -1 } }; diff --git a/test/popcorn.unit.js b/test/popcorn.unit.js index 15178e4..aca4710 100644 --- a/test/popcorn.unit.js +++ b/test/popcorn.unit.js @@ -1270,6 +1270,37 @@ test("Configurable Defaults", function () { }); +test("Start Zero Immediately", function () { + + var $pop = Popcorn("#video"), + expects = 1, + count = 0; + + function plus() { + if ( ++count === expects ) { + // clean up added events after tests + Popcorn.removePlugin("zero"); + start(); + } + } + + stop(); + + $pop.pause().currentTime( 0 ); + + Popcorn.plugin( "zero", { + start: function() { + ok( true, "$pop.zero({ start:0, end: 2 }) ran without play()"); + plus(); + }, + end: function() {} + }); + + $pop.zero({ + start:0, + end: 2 + }); +}); test("Update Timer", function () { QUnit.reset();