From 7924bb1d2cd797d7e6ca5678ca09994eb30b9b4c Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Sat, 8 Feb 2014 08:09:13 +0000 Subject: [PATCH] use updateDuration all the time; dont pass clips with 0 duration to VideoPlayer --- static/js/editPanel.js | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/static/js/editPanel.js b/static/js/editPanel.js index 1404a0cb6..b35545b77 100644 --- a/static/js/editPanel.js +++ b/static/js/editPanel.js @@ -36,12 +36,6 @@ pandora.ui.editPanel = function() { function getEdit(callback) { pandora.api.getEdit({id: ui.edit}, function(result) { edit = result.data; - // fixme: duration should come from backend - edit.duration = 0; - edit.clips.forEach(function(clip) { - clip.position = edit.duration; - edit.duration += clip.duration; - }); sortClips(callback); }); } @@ -66,7 +60,9 @@ pandora.ui.editPanel = function() { function getVideos() { var videos = {}; pandora.site.video.resolutions.forEach(function(resolution) { - videos[resolution] = Ox.flatten(edit.clips.map(function(clip) { + videos[resolution] = Ox.flatten(edit.clips.filter(function(clip) { + return clip.duration; + }).map(function(clip) { return pandora.getClipVideos(clip, resolution); })); }); @@ -544,11 +540,7 @@ pandora.ui.editPanel = function() { } function updateVideos() { - edit.duration = 0; - edit.clips.forEach(function(clip) { - clip.position = edit.duration; - edit.duration += clip.duration; - }); + updateDuration(); that.options({ duration: edit.duration, smallTimelineURL: getSmallTimelineURL(),