Compare commits

...

2 commits

Author SHA1 Message Date
j
fd294baec9 make sure in/out/position is <= duration, closes #696 2023-07-08 14:09:23 +05:30
j
51038b7c59 update outdated code 2023-07-08 14:08:53 +05:30
2 changed files with 13 additions and 1 deletions

View file

@ -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'

View file

@ -2476,6 +2476,7 @@ pandora.getVideoOptions = function(data) {
});
});
data.videoRatio = data.videoRatio || pandora.site.video.previewRatio;
return options;
};
@ -3212,7 +3213,7 @@ pandora.unloadWindow = function() {
&& pandora.user.ui.item
&& ['video', 'timeline'].indexOf(pandora.user.ui.itemView) > -1
&& pandora.UI.set(
'videoPosition.' + pandora.user.ui.item,
'videoPoints.' + pandora.user.ui.item,
pandora.$ui[
pandora.user.ui.itemView == 'video' ? 'player' : 'editor'
].options('position')