diff --git a/source/Ox.UI/js/Video/VideoElement.js b/source/Ox.UI/js/Video/VideoElement.js index 6331cf63..cacbf2eb 100644 --- a/source/Ox.UI/js/Video/VideoElement.js +++ b/source/Ox.UI/js/Video/VideoElement.js @@ -31,8 +31,7 @@ Ox.VideoElement = function(options, self) { self.loadedMetadata = false; loadItems(function() { var update = true; - self.numberOfItems = self.items.lenth; - if (self.currentItem > self.numberOfItems) { + if (self.currentItem >= self.numberOfItems) { self.currentItem = 0; } if (self.currentItemId != self.items[self.currentItem].id) { @@ -51,7 +50,7 @@ Ox.VideoElement = function(options, self) { setCurrentVideo(); } } - that.triggerEvent('durationchanged'); + that.triggerEvent('durationchange'); }); } }) @@ -149,7 +148,6 @@ Ox.VideoElement = function(options, self) { items = self.options.items.map(function(item) { return Ox.isObject(item) ? Ox.clone(item, true) : {src: item}; }); - next(); function getId(item) { @@ -169,7 +167,6 @@ Ox.VideoElement = function(options, self) { if(!item.out) { item.out = item.duration - item['in']; } - console.log('add item', item); currentTime += item.duration; item.id = getId(item); i++; @@ -205,7 +202,6 @@ Ox.VideoElement = function(options, self) { next = self.items[nextItem], $nextVideo = self.$videos[Ox.mod(self.currentVideo + 1, self.$videos.length)], nextVideo = $nextVideo[0]; - nextVideo.src = next.src; onLoadedMetadata($nextVideo, function() { nextVideo.currentTime = next['in'] || 0;