use [].some, not Ox.getObject
This commit is contained in:
parent
bb6f6d6471
commit
503c2b5978
1 changed files with 5 additions and 4 deletions
|
@ -123,10 +123,11 @@ Ox.VideoPreview = function(options, self) {
|
||||||
Ox.loop(0, self.options.width, step, function(x) {
|
Ox.loop(0, self.options.width, step, function(x) {
|
||||||
var position = getPosition(x),
|
var position = getPosition(x),
|
||||||
frame = self.options.getFrame(position);
|
frame = self.options.getFrame(position);
|
||||||
if (
|
if (!self.loaded.some(function(image) {
|
||||||
!Ox.getObject(self.loaded, 'frame', frame)
|
return image.frame == frame;
|
||||||
&& !Ox.getObject(self.queue, 'frame', frame)
|
}) && !self.queue.some(function(image) {
|
||||||
) {
|
return image.frame == frame;
|
||||||
|
})) {
|
||||||
self.queue.push({frame: frame, position: position});
|
self.queue.push({frame: frame, position: position});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue