forked from 0x2620/pandora
use updateDuration all the time; dont pass clips with 0 duration to VideoPlayer
This commit is contained in:
parent
8ffe27353c
commit
7924bb1d2c
1 changed files with 4 additions and 12 deletions
|
@ -36,12 +36,6 @@ pandora.ui.editPanel = function() {
|
||||||
function getEdit(callback) {
|
function getEdit(callback) {
|
||||||
pandora.api.getEdit({id: ui.edit}, function(result) {
|
pandora.api.getEdit({id: ui.edit}, function(result) {
|
||||||
edit = result.data;
|
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);
|
sortClips(callback);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -66,7 +60,9 @@ pandora.ui.editPanel = function() {
|
||||||
function getVideos() {
|
function getVideos() {
|
||||||
var videos = {};
|
var videos = {};
|
||||||
pandora.site.video.resolutions.forEach(function(resolution) {
|
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);
|
return pandora.getClipVideos(clip, resolution);
|
||||||
}));
|
}));
|
||||||
});
|
});
|
||||||
|
@ -544,11 +540,7 @@ pandora.ui.editPanel = function() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function updateVideos() {
|
function updateVideos() {
|
||||||
edit.duration = 0;
|
updateDuration();
|
||||||
edit.clips.forEach(function(clip) {
|
|
||||||
clip.position = edit.duration;
|
|
||||||
edit.duration += clip.duration;
|
|
||||||
});
|
|
||||||
that.options({
|
that.options({
|
||||||
duration: edit.duration,
|
duration: edit.duration,
|
||||||
smallTimelineURL: getSmallTimelineURL(),
|
smallTimelineURL: getSmallTimelineURL(),
|
||||||
|
|
Loading…
Reference in a new issue