allow selecting multiple annotations to get in/out range

This commit is contained in:
j 2025-01-22 17:42:30 +05:30
commit 96d4dfe71d
3 changed files with 65 additions and 4 deletions

View file

@ -1350,6 +1350,14 @@ Ox.VideoAnnotationPanel = function(options, self) {
if (Ox.isUndefined(data)) {
// doubleclick on small timeline
data = getAnnotation();
} else if (Ox.isArray(data.id)) {
var range = data.id.map(id => {
return Ox.getObjectById(self.annotations, id)
})
data['in'] = Ox.min(range.map(annotation => { return annotation["in"]; }))
data['out'] = Ox.max(range.map(annotation => { return annotation["out"]; }))
setPoint('in', data['in'], true);
setPoint('out', data.out, true);
} else if (!data.id && Ox.$elements[that.oxid]) {
// focus only if in the dom
that.gainFocus();