From bffdcfca9ba2a223928e31839d9f5bed7dea5098 Mon Sep 17 00:00:00 2001 From: Sanj Date: Tue, 15 May 2012 03:39:18 +0530 Subject: [PATCH] adjust in-outedness --- itf/static/js/jquery.pandoravideo.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/itf/static/js/jquery.pandoravideo.js b/itf/static/js/jquery.pandoravideo.js index 0b7498f..ce6682c 100644 --- a/itf/static/js/jquery.pandoravideo.js +++ b/itf/static/js/jquery.pandoravideo.js @@ -11,7 +11,8 @@ var optionTypes = { 'strings': ['api', 'base', 'resolution', 'action', 'id'], - 'integers': ['in', 'out', 'width', 'interval'], + 'integers': ['width', 'interval'], + 'floats': ['in', 'out'], 'arrays': ['layers', 'keys'], 'booleans': [] //'functions': ['callback'] FIXME: lets not. @@ -184,11 +185,11 @@ //first, handle if video has crossed out-point or is before in-point if (that.o.out != 0) { - if (currentTime >= that.o.out) { + if (currentTime > (that.o.out + 2)) { that.$video[0].currentTime = that.o.out; that.$video[0].pause(); } - if (currentTime <= that.o['in']) { + if (currentTime < (that.o['in'] - 2)) { that.$video[0].currentTime = that.o['in']; that.$video[0].pause(); } @@ -341,6 +342,10 @@ var attr = prefix + v; options[v] = $element.hasAttr(attr) ? parseInt($element.attr(attr)) : undefined; }); + $.each(optionTypes['floats'], function(i,v) { + var attr = prefix + v; + options[v] = $element.hasAttr(attr) ? parseFloat($element.attr(attr)) : undefined; + }); $.each(optionTypes['arrays'], function(i,v) { var attr = prefix + v; options[v] = $element.hasAttr(attr) ? $.map($element.attr(attr).split(","), $.trim) : undefined;