From fd7352edac26862ae225a43e151dad120278ef40 Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Sun, 14 Jul 2013 10:41:30 +0000 Subject: [PATCH] fix adding,removing,sorting video items and related updates --- source/Ox.UI/js/Video/VideoEditPanel.js | 6 +++++- source/Ox.UI/js/Video/VideoElement.js | 3 +++ source/Ox.UI/js/Video/VideoPlayer.js | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/source/Ox.UI/js/Video/VideoEditPanel.js b/source/Ox.UI/js/Video/VideoEditPanel.js index d568d9b5..01b8732d 100644 --- a/source/Ox.UI/js/Video/VideoEditPanel.js +++ b/source/Ox.UI/js/Video/VideoEditPanel.js @@ -140,7 +140,11 @@ Ox.VideoEditPanel = function(options, self) { }) .bindEvent({ durationchange: function(data) { - that.options({duration: data.duration}); + self.options.duration = data.duration; + self.$timeline && self.$timeline.replaceWith( + self.$timeline = getTimeline() + ); + setPosition(self.$video.options('position'), true); }, fullscreen: function(data) { self.options.fullscreen = data.fullscreen; diff --git a/source/Ox.UI/js/Video/VideoElement.js b/source/Ox.UI/js/Video/VideoElement.js index 341c4ebb..1ed38b41 100644 --- a/source/Ox.UI/js/Video/VideoElement.js +++ b/source/Ox.UI/js/Video/VideoElement.js @@ -57,6 +57,7 @@ Ox.VideoElement = function(options, self) { } } onLoadedMetadata(self.$video, function() { + that.triggerEvent('seeked'); that.triggerEvent('durationchange', { duration: that.duration() }); @@ -300,6 +301,8 @@ Ox.VideoElement = function(options, self) { onLoadedMetadata(self.$video, function() { self.video.currentTime = currentTime; }); + } else { + that.triggerEvent('seeked'); } } diff --git a/source/Ox.UI/js/Video/VideoPlayer.js b/source/Ox.UI/js/Video/VideoPlayer.js index 08d6d2aa..604f7f21 100644 --- a/source/Ox.UI/js/Video/VideoPlayer.js +++ b/source/Ox.UI/js/Video/VideoPlayer.js @@ -1272,7 +1272,7 @@ Ox.VideoPlayer = function(options, self) { ); setPosition(self.$video.currentTime()); that.triggerEvent('durationchange', { - duration:self.options.duration + duration: self.options.duration }); }