adjust in-outedness

This commit is contained in:
Sanj 2012-05-15 03:39:18 +05:30
parent 1500a97c35
commit bffdcfca9b

View File

@ -11,7 +11,8 @@
var optionTypes = { var optionTypes = {
'strings': ['api', 'base', 'resolution', 'action', 'id'], 'strings': ['api', 'base', 'resolution', 'action', 'id'],
'integers': ['in', 'out', 'width', 'interval'], 'integers': ['width', 'interval'],
'floats': ['in', 'out'],
'arrays': ['layers', 'keys'], 'arrays': ['layers', 'keys'],
'booleans': [] 'booleans': []
//'functions': ['callback'] FIXME: lets not. //'functions': ['callback'] FIXME: lets not.
@ -184,11 +185,11 @@
//first, handle if video has crossed out-point or is before in-point //first, handle if video has crossed out-point or is before in-point
if (that.o.out != 0) { 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].currentTime = that.o.out;
that.$video[0].pause(); 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].currentTime = that.o['in'];
that.$video[0].pause(); that.$video[0].pause();
} }
@ -341,6 +342,10 @@
var attr = prefix + v; var attr = prefix + v;
options[v] = $element.hasAttr(attr) ? parseInt($element.attr(attr)) : undefined; 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) { $.each(optionTypes['arrays'], function(i,v) {
var attr = prefix + v; var attr = prefix + v;
options[v] = $element.hasAttr(attr) ? $.map($element.attr(attr).split(","), $.trim) : undefined; options[v] = $element.hasAttr(attr) ? $.map($element.attr(attr).split(","), $.trim) : undefined;