diff --git a/popcorn.js b/popcorn.js index 9f63c0c39..1bd7278f5 100644 --- a/popcorn.js +++ b/popcorn.js @@ -337,10 +337,13 @@ callback.fired = true; - this.unlisten("timeupdate", guid ); - fn.call(self, event); + setTimeout(function() { + + callback.fired = false; + + }, 500 ); } }; diff --git a/test/popcorn.unit.js b/test/popcorn.unit.js index c1660c151..5db3bb29d 100644 --- a/test/popcorn.unit.js +++ b/test/popcorn.unit.js @@ -175,7 +175,9 @@ test("exec", function () { var popped = Popcorn("#video"), expects = 2, - count = 0; + count = 0, + hasLooped = false, + loop = 0; expect(expects); @@ -184,22 +186,18 @@ test("exec", function () { } stop( 10000 ); - - popped.exec( 4, function () { - - - ok(true, "exec callback fired"); - plus(); - - - equal( popped.data.events.timeupdate, null, "exec callback removed"); + ok(true, "exec callback fired " + loop++ ); plus(); - + + if ( !hasLooped ) { + + popped.currentTime(3).play(); + + hasLooped = true; + } }).currentTime(3).play(); - - });