diff --git a/source/Ox.UI/js/Video/Ox.VideoPreview.js b/source/Ox.UI/js/Video/Ox.VideoPreview.js index 7c2b4eb0..37497569 100644 --- a/source/Ox.UI/js/Video/Ox.VideoPreview.js +++ b/source/Ox.UI/js/Video/Ox.VideoPreview.js @@ -47,11 +47,9 @@ Ox.VideoPreview = function(options, self) { // e.offsetX does not work in Firefox var position = getPosition(event.clientX - that.offset().left); self.$frame.attr({src: getClosestFrame(position)}); - Ox.print('closest frame:', self.$frame.attr('src')); self.timeout && clearTimeout(self.timeout); self.timeout = setTimeout(function() { self.$frame.attr({src: self.options.getFrame(position)}); - Ox.print('exact frame:', self.$frame.attr('src')); }, 250); return Ox.formatDuration(position, 2); } @@ -61,8 +59,8 @@ Ox.VideoPreview = function(options, self) { click: click, mouseenter: startLoading, mouseleave: function() { - self.$frame.attr({src: self.options.getFrame(self.options.position)}); stopLoading(); + self.$frame.attr({src: self.options.getFrame(self.options.position)}); } }) .appendTo(that.$element); @@ -143,6 +141,7 @@ Ox.VideoPreview = function(options, self) { function stopLoading() { self.queue = []; + self.timeout && clearTimeout(self.timeout); } self.setOption = function(key, value) { @@ -153,10 +152,10 @@ Ox.VideoPreview = function(options, self) { self.$frame.attr({src: self.options.getFrame(value)}); } else if (key == 'width') { that.css({width: value + 'px'}); + stopLoading(); self.$frame.attr({src: self.options.getFrame()}) .css(getFrameCSS()); self.$timeline.css({width: value + 'px'}); - stopLoading(); } }