aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/nodes/RecordingBox/RecordingView.tsx
diff options
context:
space:
mode:
authorMichael Foiani <sotech117@michaels-mbp-3.devices.brown.edu>2022-04-21 16:48:51 -0400
committerMichael Foiani <sotech117@michaels-mbp-3.devices.brown.edu>2022-04-21 16:48:51 -0400
commit0af393318adafa885d66c0fc43ffbf23f91e3c73 (patch)
tree3134ce352a8f48c3475b1aa7940a154d9f60fb14 /src/client/views/nodes/RecordingBox/RecordingView.tsx
parentfd43ece4b97073b81553b5e8a8394d4404011005 (diff)
Integrate with jenny's videobox api
Diffstat (limited to 'src/client/views/nodes/RecordingBox/RecordingView.tsx')
-rw-r--r--src/client/views/nodes/RecordingBox/RecordingView.tsx18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/client/views/nodes/RecordingBox/RecordingView.tsx b/src/client/views/nodes/RecordingBox/RecordingView.tsx
index 9be972d53..8c1ab9e2b 100644
--- a/src/client/views/nodes/RecordingBox/RecordingView.tsx
+++ b/src/client/views/nodes/RecordingBox/RecordingView.tsx
@@ -6,7 +6,7 @@ import { MdBackspace } from 'react-icons/md';
import { FaCheckCircle } from 'react-icons/fa';
import { IconContext } from "react-icons";
-import { RecordingApi } from '../../../apis/recording/recordingApi';
+import { RecordingApi } from '../../../apis/recording/RecordingApi';
enum RecordingStatus {
@@ -39,8 +39,6 @@ export function RecordingView() {
const videoElementRef = useRef<HTMLVideoElement | null>(null);
const [finished, setFinished] = useState<Boolean>(false)
-
- const recordingApiRef = useRef<any | null>(null);
@@ -75,7 +73,11 @@ export function RecordingView() {
videoElementRef.current!.srcObject = null
videoElementRef.current!.src = blobUrl
- videoElementRef.current!.muted = false
+ videoElementRef.current!.muted = false
+
+ // clear the recording api
+ const presentation = RecordingApi.finish()
+ RecordingApi.clear()
}
@@ -202,7 +204,8 @@ export function RecordingView() {
const pause = () => {
if (recorder.current) {
if (recorder.current.state === "recording") {
- recorder.current.pause();
+ recorder.current.pause();
+ const err = RecordingApi.pause()
}
}
}
@@ -211,7 +214,7 @@ export function RecordingView() {
console.log('[RecordingView.tsx] startOrResume')
if (!recorder.current || recorder.current.state === "inactive") {
record();
- recordingApiRef.current.startAndInit()
+ const err = RecordingApi.initAndStart()
} else if (recorder.current.state === "paused") {
recorder.current.resume();
}
@@ -325,9 +328,6 @@ export function RecordingView() {
)}
</button> */}
</div>
-
- <RecordingApi ref={recordingApiRef}></RecordingApi>
-
</div>
</div>)
} \ No newline at end of file