diff options
| author | bobzel <zzzman@gmail.com> | 2022-09-21 16:43:54 -0400 |
|---|---|---|
| committer | bobzel <zzzman@gmail.com> | 2022-09-21 16:43:54 -0400 |
| commit | 69719257b8275cb19d63960a6ec552a0c118d988 (patch) | |
| tree | 2707d83e90e645f0c40777c00f6b6a8d3d0857cd /src/client/views/nodes/VideoBox.tsx | |
| parent | 52000387f2d4a56c1f6028cdda1cd140c3bfe4c6 (diff) | |
fixed navigating to cropped video regions.
Diffstat (limited to 'src/client/views/nodes/VideoBox.tsx')
| -rw-r--r-- | src/client/views/nodes/VideoBox.tsx | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/src/client/views/nodes/VideoBox.tsx b/src/client/views/nodes/VideoBox.tsx index aabe3eb25..4bcd79641 100644 --- a/src/client/views/nodes/VideoBox.tsx +++ b/src/client/views/nodes/VideoBox.tsx @@ -948,6 +948,14 @@ export class VideoBox extends ViewBoxAnnotatableComponent<ViewBoxAnnotatableProp ); }; + scrollFocus = (doc: Doc, smooth: boolean) => { + if (doc !== this.rootDoc) { + const showTime = Cast(doc._timecodeToShow, 'number', null); + showTime !== undefined && setTimeout(() => this.Seek(showTime), 100); + return 0.1; + } + }; + // renders CollectionStackedTimeline @computed get renderTimeline() { return ( @@ -981,15 +989,15 @@ export class VideoBox extends ViewBoxAnnotatableComponent<ViewBoxAnnotatableProp </div> ); } + @computed get isCropped() { + return this.dataDoc.videoCrop; // bcz: hack to identify a cropped video + } // renders annotation layer @computed get annotationLayer() { return <div className="videoBox-annotationLayer" style={{ transition: this.transition, height: `${this.heightPercent}%` }} ref={this._annotationLayer} />; } - @computed get isCropped() { - return this.dataDoc.viewScaleMin; // bcz: hack to identify a cropped video - } crop = (region: Doc | undefined, addCrop?: boolean) => { if (!region) return; const cropping = Doc.MakeCopy(region, true); @@ -997,7 +1005,7 @@ export class VideoBox extends ViewBoxAnnotatableComponent<ViewBoxAnnotatableProp Doc.GetProto(region).lockedPosition = true; Doc.GetProto(region).title = 'region:' + this.rootDoc.title; Doc.GetProto(region).isPushpin = true; - region._timecodeToHide = region._timecodeToShow; + region._timecodeToHide = NumCast(region._timecodeToShow) + 0.0001; this.addDocument(region); const anchx = NumCast(cropping.x); const anchy = NumCast(cropping.y); @@ -1021,6 +1029,7 @@ export class VideoBox extends ViewBoxAnnotatableComponent<ViewBoxAnnotatableProp croppingProto.data = ObjectField.MakeCopy(this.rootDoc[this.fieldKey] as ObjectField); croppingProto['data-nativeWidth'] = anchw; croppingProto['data-nativeHeight'] = anchh; + croppingProto.videoCrop = true; croppingProto.currentTimecode = this.layoutDoc._currentTimecode; croppingProto.viewScale = viewScale; croppingProto.viewScaleMin = viewScale; |
