aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/nodes/VideoBox.tsx
diff options
context:
space:
mode:
authorSkitty1238 <157652284+Skitty1238@users.noreply.github.com>2025-06-02 14:18:20 -0400
committerSkitty1238 <157652284+Skitty1238@users.noreply.github.com>2025-06-02 14:18:20 -0400
commit83bfca49c38e12dc575b5037c8fac25f3c21d6c5 (patch)
treed3e66b45d0e95e51d2b6f2672fd367776f19db35 /src/client/views/nodes/VideoBox.tsx
parente4b5aa5e72cca6dd51e9acf28017cde4233b5cc6 (diff)
parent76a21badf70c82388872ec5485858ab06e303bca (diff)
Merge branch 'master' into task_nodes_aarav
Diffstat (limited to 'src/client/views/nodes/VideoBox.tsx')
-rw-r--r--src/client/views/nodes/VideoBox.tsx17
1 files changed, 10 insertions, 7 deletions
diff --git a/src/client/views/nodes/VideoBox.tsx b/src/client/views/nodes/VideoBox.tsx
index fa099178c..b3cb0e1db 100644
--- a/src/client/views/nodes/VideoBox.tsx
+++ b/src/client/views/nodes/VideoBox.tsx
@@ -338,12 +338,17 @@ export class VideoBox extends ViewBoxAnnotatableComponent<FieldViewProps>() {
getAnchor = (addAsAnnotation: boolean, pinProps?: PinProps) => {
const timecode = Cast(this.layoutDoc._layout_currentTimecode, 'number', null);
const marquee = AnchorMenu.Instance.GetAnchor?.(undefined, addAsAnnotation);
+ const docAnchor = () =>
+ Docs.Create.ConfigDocument({
+ title: '#' + timecode,
+ _timecodeToShow: timecode,
+ annotationOn: this.Document,
+ });
if (!addAsAnnotation && marquee) marquee.backgroundColor = 'transparent';
- const anchor =
- addAsAnnotation && marquee
- ? CollectionStackedTimeline.createAnchor(this.Document, this.dataDoc, this.annotationKey, timecode || undefined, undefined, marquee, addAsAnnotation) || this.Document
- : Docs.Create.ConfigDocument({ title: '#' + timecode, _timecodeToShow: timecode, annotationOn: this.Document });
+ const visibleAnchor = () => addAsAnnotation && marquee && (CollectionStackedTimeline.createAnchor(this.Document, this.dataDoc, this.annotationKey, timecode || undefined, undefined, marquee, addAsAnnotation) || this.Document);
+ const anchor = visibleAnchor() || docAnchor();
PinDocView(anchor, { pinDocLayout: pinProps?.pinDocLayout, pinData: { ...(pinProps?.pinData ?? {}), temporal: true, pannable: true } }, this.Document);
+ addAsAnnotation && this.addDocument(anchor);
return anchor;
};
@@ -376,9 +381,7 @@ export class VideoBox extends ViewBoxAnnotatableComponent<FieldViewProps>() {
}
return this._stackedTimeline.getView(doc, options);
}
- return new Promise<Opt<DocumentView>>(res => {
- DocumentView.addViewRenderedCb(doc, dv => res(dv));
- });
+ return new Promise<Opt<DocumentView>>(res => DocumentView.addViewRenderedCb(doc, res));
};
// extracts video thumbnails and saves them as field of doc