From 8e6787be9797b4c56401c427a000246f4b263187 Mon Sep 17 00:00:00 2001 From: rlx <0x0073@0x2620.org> Date: Sun, 25 Mar 2012 21:45:39 +0000 Subject: [PATCH] move full minute check from player into panel and editor, should fix #716 --- source/Ox.UI/js/Video/Ox.VideoEditor.js | 10 +++++++--- source/Ox.UI/js/Video/Ox.VideoPanel.js | 6 +++++- source/Ox.UI/js/Video/Ox.VideoPlayer.js | 9 --------- 3 files changed, 12 insertions(+), 13 deletions(-) diff --git a/source/Ox.UI/js/Video/Ox.VideoEditor.js b/source/Ox.UI/js/Video/Ox.VideoEditor.js index 3a70df05..0df41d0a 100644 --- a/source/Ox.UI/js/Video/Ox.VideoEditor.js +++ b/source/Ox.UI/js/Video/Ox.VideoEditor.js @@ -1124,6 +1124,8 @@ Ox.VideoEditor = function(options, self) { } function setPosition(position, playing) { + var minute = minute = parseInt(position / 60), + previousMinute = parseInt(self.options.position / 60); self.options.position = position; !playing && self.$player[0].options({ position: self.options.position @@ -1136,9 +1138,11 @@ Ox.VideoEditor = function(options, self) { self.$annotationPanel.options({ position: self.options.position }); - !playing && that.triggerEvent('position', { - position: self.options.position - }); + if (!playing || minute != previousMinute) { + that.triggerEvent('position', { + position: self.options.position + }); + } } function setSizes() { diff --git a/source/Ox.UI/js/Video/Ox.VideoPanel.js b/source/Ox.UI/js/Video/Ox.VideoPanel.js index 37c9ef71..054b7ebf 100644 --- a/source/Ox.UI/js/Video/Ox.VideoPanel.js +++ b/source/Ox.UI/js/Video/Ox.VideoPanel.js @@ -131,7 +131,6 @@ Ox.VideoPanel = function(options, self) { }, position: function(data) { setPosition(data.position); - that.triggerEvent('position', data); }, resolution: function(data) { that.triggerEvent('resolution', data); @@ -369,10 +368,15 @@ Ox.VideoPanel = function(options, self) { } function setPosition(position, playing) { + var minute = minute = parseInt(position / 60), + previousMinute = parseInt(self.options.position / 60); self.options.position = position; !playing && self.$video.options({position: self.options.position}); self.$timeline.options({position: self.options.position}); self.$annotationPanel.options({position: self.options.position}); + if (!playing || minute != previousMinute) { + that.triggerEvent('position', {position: self.options.position}); + } } function sortAnnotations(a, b) { diff --git a/source/Ox.UI/js/Video/Ox.VideoPlayer.js b/source/Ox.UI/js/Video/Ox.VideoPlayer.js index 5a77c11d..45b3f687 100644 --- a/source/Ox.UI/js/Video/Ox.VideoPlayer.js +++ b/source/Ox.UI/js/Video/Ox.VideoPlayer.js @@ -1694,10 +1694,7 @@ Ox.VideoPlayer = function(options, self) { } function playing() { - var minute, - previousMinute = parseInt(self.options.position / 60); self.options.position = self.$video.currentTime(); - minute = parseInt(self.options.position / 60); if ( (self.playInToOut && self.options.position >= self.options.out) || (self.options.playInToOut && self.options.position >= self.out) @@ -1721,12 +1718,6 @@ Ox.VideoPlayer = function(options, self) { that.triggerEvent('playing', { position: self.options.position }); - /* - temporarily disabled - minute != previousMinute && that.triggerEvent('position', { - position: minute * 60 - }); - */ } function playInToOut() {