From e2bfe53da0a15d2e20b9b68a35268ad2284c12db Mon Sep 17 00:00:00 2001 From: rwldrn Date: Wed, 20 Jul 2011 16:15:04 -0400 Subject: [PATCH] Initial fix --- popcorn.js | 6 +++--- test/popcorn.unit.js | 31 +++++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+), 3 deletions(-) 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(); -- 2.43.0