aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/nodes/RecordingBox/RecordingView.tsx
diff options
context:
space:
mode:
authorJenny Yu <jennyyu212@outlook.com>2022-06-07 08:51:41 -0700
committerJenny Yu <jennyyu212@outlook.com>2022-06-07 08:51:41 -0700
commit6493d95e92c8ed58bb3a8c07ea4ca28dae82ea1d (patch)
tree4d472a9e36102b7c8619da9eb46283908bebe88e /src/client/views/nodes/RecordingBox/RecordingView.tsx
parent2e42d66be1439de347305cfd43c6f7e7042127c6 (diff)
removing decorations on recording box
Diffstat (limited to 'src/client/views/nodes/RecordingBox/RecordingView.tsx')
-rw-r--r--src/client/views/nodes/RecordingBox/RecordingView.tsx20
1 files changed, 12 insertions, 8 deletions
diff --git a/src/client/views/nodes/RecordingBox/RecordingView.tsx b/src/client/views/nodes/RecordingBox/RecordingView.tsx
index 87716e9cc..5826abd65 100644
--- a/src/client/views/nodes/RecordingBox/RecordingView.tsx
+++ b/src/client/views/nodes/RecordingBox/RecordingView.tsx
@@ -9,6 +9,7 @@ import { Networking } from '../../../Network';
import { Upload } from '../../../../server/SharedMediaTypes';
import { RecordingApi } from '../../../util/RecordingApi';
+import { emptyFunction, returnFalse, setupMoveUpEvents } from '../../../../Utils';
interface MediaSegment {
videoChunks: any[],
@@ -193,12 +194,15 @@ export function RecordingView(props: IRecordingViewProps) {
}
}
- const startOrResume = () => {
- if (!videoRecorder.current || videoRecorder.current.state === "inactive") {
- record();
- } else if (videoRecorder.current.state === "paused") {
- videoRecorder.current.resume();
- }
+ const startOrResume = (e: React.PointerEvent) => {
+ // the code to start or resume does not get triggered if we start dragging the button
+ setupMoveUpEvents({}, e, returnFalse, returnFalse, () => {
+ if (!videoRecorder.current || videoRecorder.current.state === "inactive") {
+ record();
+ } else if (videoRecorder.current.state === "paused") {
+ videoRecorder.current.resume();
+ }
+ })
}
const clearPrevious = () => {
@@ -240,8 +244,8 @@ export function RecordingView(props: IRecordingViewProps) {
<div className="controls-inner-container">
<div className="record-button-wrapper">
{recording ?
- <button className="stop-button" onClick={pause} /> :
- <button className="record-button" onClick={startOrResume} />
+ <button className="stop-button" onPointerDown={pause} /> :
+ <button className="record-button" onPointerDown={startOrResume} />
}
</div>