From 271712498ad4021c06a15563c84f99f091696bea Mon Sep 17 00:00:00 2001 From: mehekj Date: Thu, 30 Sep 2021 16:38:07 -0400 Subject: added trim button to video --- src/client/views/nodes/VideoBox.tsx | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'src') diff --git a/src/client/views/nodes/VideoBox.tsx b/src/client/views/nodes/VideoBox.tsx index 896f6ff88..a8ea1ed90 100644 --- a/src/client/views/nodes/VideoBox.tsx +++ b/src/client/views/nodes/VideoBox.tsx @@ -417,6 +417,7 @@ export class VideoBox extends ViewBoxAnnotatableComponent { this.Pause(); + this.setPlayheadTime(Math.max(Math.min(this.timeline?.trimEnd || 0, this.player!.currentTime), this.timeline?.trimStart || 0)); this._stackedTimeline.current?.StopTrimming(); }); @@ -425,6 +426,18 @@ export class VideoBox extends ViewBoxAnnotatableComponent { + this.heightPercent >= 100 && this.onTimelineHdlDown(e); + this.timeline && setupMoveUpEvents(this, e, returnFalse, returnFalse, action((e: PointerEvent, doubleTap?: boolean) => { + if (doubleTap) { + this.startTrim(TrimScope.All); + } else if (this.timeline) { + this.Pause(); + this.timeline.IsTrimming !== TrimScope.None ? this.finishTrim() : this.startTrim(TrimScope.Clip); + } + })); + } + playLink = (doc: Doc) => { const startTime = Math.max(0, (this._stackedTimeline.current?.anchorStart(doc) || 0)); const endTime = this._stackedTimeline.current?.anchorEnd(doc); @@ -534,6 +547,11 @@ export class VideoBox extends ViewBoxAnnotatableComponent + , + {this.timeline?.IsTrimming !== TrimScope.None ? "finish trimming" : "start trim"}} key="trim" placement="bottom"> +
+ +
,]} ; } -- cgit v1.2.3-70-g09d2