From fd294baec9adbbdb14d7a258b4d5468c4da0b0c5 Mon Sep 17 00:00:00 2001 From: j Date: Sat, 8 Jul 2023 14:09:23 +0530 Subject: [PATCH] make sure in/out/position is <= duration, closes #696 --- static/js/item.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/static/js/item.js b/static/js/item.js index 8de8740f..f828427d 100644 --- a/static/js/item.js +++ b/static/js/item.js @@ -31,6 +31,17 @@ pandora.ui.item = function() { // fixme: layers have value, subtitles has text? isVideoView && Ox.extend(result.data, pandora.getVideoOptions(result.data)); + if (isVideoView && result.data.duration) { + var videoPoints = pandora.user.ui.videoPoints[item], set = {}; + ['in', 'out', 'position'].forEach(point => { + if (videoPoints[point] > result.data.duration) { + set[point] = result.data.duration; + } + }) + if (!Ox.isEmpty(set)) { + pandora.UI.set('videoPoints.' + item, Ox.extend(videoPoints[point], set[point])) + } + } if (!result.data.rendered && [ 'clips', 'timeline', 'player', 'editor', 'map', 'calendar'