diff options
-rw-r--r-- | src/client/views/collections/CollectionStackedTimeline.tsx | 9 | ||||
-rw-r--r-- | src/client/views/nodes/AudioBox.tsx | 3 | ||||
-rw-r--r-- | src/client/views/nodes/VideoBox.tsx | 3 |
3 files changed, 11 insertions, 4 deletions
diff --git a/src/client/views/collections/CollectionStackedTimeline.tsx b/src/client/views/collections/CollectionStackedTimeline.tsx index b6321043c..f533bee52 100644 --- a/src/client/views/collections/CollectionStackedTimeline.tsx +++ b/src/client/views/collections/CollectionStackedTimeline.tsx @@ -145,12 +145,21 @@ export class CollectionStackedTimeline extends CollectionSubView< })!; } + _disposer: IReactionDisposer | undefined; componentDidMount() { document.addEventListener("keydown", this.keyEvents, true); + this._disposer = reaction(() => this.currentTime, + () => { + if (CollectionStackedTimeline.SelectingRegion === this) { + this._markerEnd = this.currentTime; + } + + }); } @action componentWillUnmount() { + this._disposer?.(); document.removeEventListener("keydown", this.keyEvents, true); if (CollectionStackedTimeline.SelectingRegion === this) { CollectionStackedTimeline.SelectingRegion = undefined; diff --git a/src/client/views/nodes/AudioBox.tsx b/src/client/views/nodes/AudioBox.tsx index 7eb5639c0..2574b5a45 100644 --- a/src/client/views/nodes/AudioBox.tsx +++ b/src/client/views/nodes/AudioBox.tsx @@ -222,8 +222,7 @@ export class AudioBox extends ViewBoxAnnotatableComponent<ViewBoxAnnotatableProp (end - start) * 1000 ); // use setTimeout to play a specific duration } - } - if (seekTimeInSeconds < 0 && seekTimeInSeconds > -1) { + } else if (seekTimeInSeconds < 0 && seekTimeInSeconds > -1) { setTimeout(() => this.playFrom(0), -seekTimeInSeconds * 1000); } else { this.Pause(); diff --git a/src/client/views/nodes/VideoBox.tsx b/src/client/views/nodes/VideoBox.tsx index af65cce9f..b00fb75a3 100644 --- a/src/client/views/nodes/VideoBox.tsx +++ b/src/client/views/nodes/VideoBox.tsx @@ -510,8 +510,7 @@ export class VideoBox extends ViewBoxAnnotatableComponent<ViewBoxAnnotatableProp return this._playRegionTimer = setTimeout(() => this.Pause(), (this._playRegionDuration) * 1000); // use setTimeout to play a specific duration } - } - if (seekTimeInSeconds < 0 && seekTimeInSeconds > -1) { + } else if (seekTimeInSeconds < 0 && seekTimeInSeconds > -1) { setTimeout(() => this.playFrom(0), -seekTimeInSeconds * 1000); } else { this.Pause(); |