From 7ce56059b907240ed834dfc38a88233ad620ae49 Mon Sep 17 00:00:00 2001 From: mehekj Date: Tue, 21 Jun 2022 11:57:31 -0400 Subject: fade controls when scrubbing --- src/client/views/nodes/VideoBox.scss | 1 + src/client/views/nodes/VideoBox.tsx | 16 +++++++--------- 2 files changed, 8 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/client/views/nodes/VideoBox.scss b/src/client/views/nodes/VideoBox.scss index 47867b128..da29c291f 100644 --- a/src/client/views/nodes/VideoBox.scss +++ b/src/client/views/nodes/VideoBox.scss @@ -97,6 +97,7 @@ z-index: 2001; height: 40px; padding: 0 10px 0 7px; + transition: opacity 0.3s; .timecode-controls { display: flex; diff --git a/src/client/views/nodes/VideoBox.tsx b/src/client/views/nodes/VideoBox.tsx index c8bea2a44..bad7813ef 100644 --- a/src/client/views/nodes/VideoBox.tsx +++ b/src/client/views/nodes/VideoBox.tsx @@ -103,7 +103,7 @@ export class VideoBox extends ViewBoxAnnotatableComponent { e.stopPropagation(); - this._controlsVisible = true; clearTimeout(this._controlsFadeTimer); - this._controlsFadeTimer = setTimeout(action(() => this._controlsVisible = false), 3000); + this._controlsFadeTimer = setTimeout(action(() => this._controlsOpacity = 0), 3000); } @@ -449,8 +448,6 @@ export class VideoBox extends ViewBoxAnnotatableComponent this._controlsVisible = false), 3000) } else { document.removeEventListener('pointermove', this.controlsFade); @@ -509,10 +506,10 @@ export class VideoBox extends ViewBoxAnnotatableComponentLoading : -
+
this._fullScreen && e.stopPropagation()}> {this._fullScreen &&
+ style={{ left: this._controlsTransform && this._controlsTransform.X, top: this._controlsTransform && this._controlsTransform.Y, visibility: this._controlsOpacity ? 'visible' : 'hidden', opacity: this._controlsOpacity }}> {this.UIButtons}
}