aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/nodes/RecordingBox
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2024-09-02 09:26:37 -0400
committerbobzel <zzzman@gmail.com>2024-09-02 09:26:37 -0400
commitcda69e48361fce8d71a4dc66edd9dd976a27f52d (patch)
tree82b9a1a5967ae88a9534f89f7eaed3aeb289652f /src/client/views/nodes/RecordingBox
parentc01828308714874589d1f60c33ca59df4c656c0c (diff)
parenta958577d4c27b276aa37484e3f895e196138b17c (diff)
Merge branch 'master' into alyssa-starter
Diffstat (limited to 'src/client/views/nodes/RecordingBox')
-rw-r--r--src/client/views/nodes/RecordingBox/RecordingBox.tsx5
-rw-r--r--src/client/views/nodes/RecordingBox/RecordingView.tsx14
2 files changed, 8 insertions, 11 deletions
diff --git a/src/client/views/nodes/RecordingBox/RecordingBox.tsx b/src/client/views/nodes/RecordingBox/RecordingBox.tsx
index 07381c7d0..7ba313e92 100644
--- a/src/client/views/nodes/RecordingBox/RecordingBox.tsx
+++ b/src/client/views/nodes/RecordingBox/RecordingBox.tsx
@@ -55,8 +55,7 @@ export class RecordingBox extends ViewBoxBaseComponent<FieldViewProps>() {
this.dataDoc[this._props.fieldKey] = new VideoField(this.result.accessPaths.client);
// stringify the presentation and store it
if (presentation?.movements) {
- const presCopy = { ...presentation };
- presCopy.movements = presentation.movements.map(movement => ({ ...movement, doc: movement.doc[Id] })) as any;
+ const presCopy = { ...presentation, movements: presentation.movements.map(movement => ({ ...movement, doc: (movement.doc as Doc)[Id] })) };
this.dataDoc[this.fieldKey + '_presentation'] = JSON.stringify(presCopy);
}
};
@@ -210,7 +209,7 @@ ScriptingGlobals.add(function getCurrentRecording() {
});
// eslint-disable-next-line prefer-arrow-callback
ScriptingGlobals.add(function getWorkspaceRecordings() {
- return new List<any>(['Record Workspace', `Record Webcam`, ...DocListCast(Doc.UserDoc().workspaceRecordings)]);
+ return new List<string | Doc>(['Record Workspace', `Record Webcam`, ...DocListCast(Doc.UserDoc().workspaceRecordings)]);
});
// eslint-disable-next-line prefer-arrow-callback
ScriptingGlobals.add(function isWorkspaceRecording() {
diff --git a/src/client/views/nodes/RecordingBox/RecordingView.tsx b/src/client/views/nodes/RecordingBox/RecordingView.tsx
index b8451fe60..37ffca2d6 100644
--- a/src/client/views/nodes/RecordingBox/RecordingView.tsx
+++ b/src/client/views/nodes/RecordingBox/RecordingView.tsx
@@ -1,6 +1,4 @@
-/* eslint-disable jsx-a11y/label-has-associated-control */
/* eslint-disable react/button-has-type */
-/* eslint-disable jsx-a11y/control-has-associated-label */
import * as React from 'react';
import { useEffect, useRef, useState } from 'react';
import { IconContext } from 'react-icons';
@@ -14,7 +12,7 @@ import { ProgressBar } from './ProgressBar';
import './RecordingView.scss';
export interface MediaSegment {
- videoChunks: any[];
+ videoChunks: Blob[];
endTime: number;
startTime: number;
presentation?: Presentation;
@@ -91,15 +89,15 @@ export function RecordingView(props: IRecordingViewProps) {
}, []);
useEffect(() => {
- let interval: any = null;
+ let interval: null | NodeJS.Timeout = null;
if (recording) {
interval = setInterval(() => {
setRecordingTimer(unit => unit + 1);
}, 10);
} else if (!recording && recordingTimer !== 0) {
- clearInterval(interval);
+ interval && clearInterval(interval);
}
- return () => clearInterval(interval);
+ return interval ? () => clearInterval(interval!) : undefined;
}, [recording]);
const setVideoProgressHelper = (curProgrss: number) => {
@@ -127,9 +125,9 @@ export function RecordingView(props: IRecordingViewProps) {
if (!videoRecorder.current) videoRecorder.current = new MediaRecorder(await startShowingStream());
// temporary chunks of video
- let videoChunks: any = [];
+ let videoChunks: Blob[] = [];
- videoRecorder.current.ondataavailable = (event: any) => {
+ videoRecorder.current.ondataavailable = (event: BlobEvent) => {
if (event.data.size > 0) videoChunks.push(event.data);
};