From 64e265d9cba009469081fdf4ba3272c78a3a76a8 Mon Sep 17 00:00:00 2001 From: mehekj Date: Mon, 20 Sep 2021 22:25:03 -0400 Subject: partially added dragging timeline markers --- src/client/views/nodes/AudioBox.scss | 61 +++++++---------- src/client/views/nodes/AudioBox.tsx | 129 ++++++++++++++++++----------------- src/client/views/nodes/VideoBox.tsx | 10 +++ 3 files changed, 99 insertions(+), 101 deletions(-) (limited to 'src/client/views/nodes') diff --git a/src/client/views/nodes/AudioBox.scss b/src/client/views/nodes/AudioBox.scss index cf9d97128..6adda4730 100644 --- a/src/client/views/nodes/AudioBox.scss +++ b/src/client/views/nodes/AudioBox.scss @@ -45,23 +45,24 @@ } .audiobox-record-interactive, - .audiobox-record { - pointer-events: all; - width: 100%; - height: 100%; - position: inherit; - display: flex; - position: relative; - cursor: default; + .audiobox-record { + pointer-events: all; + cursor: pointer; + width: 100%; + height: 100%; + position: relative; + display: flex; + flex-direction: row; + align-items: center; + justify-content: center; + gap: 10px; + color: white; + font-weight: bold; + } - .audiobox-record { - pointer-events: none; - color: white; - display: flex; - align-items: center; - justify-content: center; - font-size: $large-header; - } + .audiobox-record { + pointer-events: none; + } .recording { margin-top: auto; @@ -132,26 +133,6 @@ pointer-events: all; } - .audiobox-record-interactive, - .audiobox-record { - pointer-events: all; - cursor: pointer; - width: 100%; - height: 100%; - position: relative; - display: flex; - flex-direction: row; - align-items: center; - justify-content: center; - gap: 10px; - color: white; - font-weight: bold; - } - - .audiobox-record { - pointer-events: none; - } - .recording { margin-top: auto; margin-bottom: auto; @@ -281,6 +262,12 @@ .audioBox-total-time { right: 2px; } + + .audiobox-zoom { + bottom: 0; + left: 30px; + width: 70px; + } } } } @@ -305,4 +292,4 @@ .audiobox-container-interactive .audiobox-controls .audiobox-player .audiobox-buttons { width: 70px; } -} \ No newline at end of file +} diff --git a/src/client/views/nodes/AudioBox.tsx b/src/client/views/nodes/AudioBox.tsx index c79828470..830c73278 100644 --- a/src/client/views/nodes/AudioBox.tsx +++ b/src/client/views/nodes/AudioBox.tsx @@ -33,6 +33,7 @@ import { FieldView, FieldViewProps } from "./FieldView"; import { LinkDocPreview } from "./LinkDocPreview"; import { faLessThan } from "@fortawesome/free-solid-svg-icons"; import { Colors } from "../global/globalEnums"; +import e = require("connect-flash"); declare class MediaRecorder { constructor(e: any); // whatever MediaRecorder has @@ -336,8 +337,8 @@ export class AudioBox extends ViewBoxAnnotatableComponent< (this.layoutDoc.dontAutoPlayFollowedLinks ? "" : "Don't") + " play when link is selected", event: () => - (this.layoutDoc.dontAutoPlayFollowedLinks = - !this.layoutDoc.dontAutoPlayFollowedLinks), + (this.layoutDoc.dontAutoPlayFollowedLinks = + !this.layoutDoc.dontAutoPlayFollowedLinks), icon: "expand-arrows-alt", }); funcs.push({ @@ -637,77 +638,77 @@ export class AudioBox extends ViewBoxAnnotatableComponent< ) : ( -
- +
+ RECORD -
- )} +
+ )} ) : ( +
+
-
-
- {" "} - -
-
- -
-
- {this.renderTimeline} -
- {this.audio} -
- {this._trimming ? - formatTime(Math.round(NumCast(this.layoutDoc._currentTimecode))) - : formatTime(Math.round(NumCast(this.layoutDoc._currentTimecode) - NumCast(this._trimStart)))} -
-
- {this._trimming || !this._trimEnd ? - formatTime(Math.round(NumCast(this.duration))) - : formatTime(Math.round(NumCast(this.trimDuration)))} -
+ {" "} + +
+
+ +
+
+ {this.renderTimeline} +
+ {this.audio} +
+ {this._trimming ? + formatTime(Math.round(NumCast(this.layoutDoc._currentTimecode))) + : formatTime(Math.round(NumCast(this.layoutDoc._currentTimecode) - NumCast(this._trimStart)))} +
+
+ {this._trimming || !this._trimEnd ? + formatTime(Math.round(NumCast(this.duration))) + : formatTime(Math.round(NumCast(this.trimDuration)))}
- )} +
+ )}
); } diff --git a/src/client/views/nodes/VideoBox.tsx b/src/client/views/nodes/VideoBox.tsx index 90de3227f..7dd82ad13 100644 --- a/src/client/views/nodes/VideoBox.tsx +++ b/src/client/views/nodes/VideoBox.tsx @@ -60,9 +60,17 @@ export class VideoBox extends ViewBoxAnnotatableComponent { this.player && (this.layoutDoc._currentTimecode = this.player.currentTime); + this.layoutDoc.clipEnd = this.layoutDoc.clipEnd ? Math.min(this.duration, NumCast(this.layoutDoc.clipEnd)) : this.duration; + this._trimEnd = this._trimEnd ? Math.min(this.duration, this._trimEnd) : this.duration; try { this._youtubePlayer && (this.layoutDoc._currentTimecode = this._youtubePlayer.getCurrentTime?.()); } catch (e) { -- cgit v1.2.3-70-g09d2