From f95ea8c5ea8212fe56125822e509f1c7d999133c Mon Sep 17 00:00:00 2001 From: Michael Foiani Date: Sun, 12 Jun 2022 10:01:14 -0400 Subject: fix small bug with video recorder. need to work on recording api bug --- .../views/nodes/RecordingBox/RecordingView.tsx | 23 ++++++++-------------- 1 file changed, 8 insertions(+), 15 deletions(-) (limited to 'src') diff --git a/src/client/views/nodes/RecordingBox/RecordingView.tsx b/src/client/views/nodes/RecordingBox/RecordingView.tsx index 208eaf45a..380ac050d 100644 --- a/src/client/views/nodes/RecordingBox/RecordingView.tsx +++ b/src/client/views/nodes/RecordingBox/RecordingView.tsx @@ -164,29 +164,22 @@ export function RecordingView(props: IRecordingViewProps) { } - const finish = (e: React.PointerEvent) => { - e.stopPropagation(); - console.log('finish', videoRecorder.current) - // if inactive, then we're done recording all the segments - if (videoRecorder.current && videoRecorder.current.state !== "inactive") { - console.log('stopping recorder', videoRecorder.current?.state) - - - - // call stop on the video recorder - videoRecorder.current?.stop(); + // if this is called, then we're done recording all the segments + const finish = (e: React.PointerEvent) => { + e.stopPropagation(); + + // call stop on the video recorder if active + videoRecorder.current?.state !== "inactive" && videoRecorder.current?.stop(); // end the streams (audio/video) to remove recording icon const stream = videoElementRef.current!.srcObject; stream instanceof MediaStream && stream.getTracks().forEach(track => track.stop()); - // clear the recoringApi - this is done in the stop method - // RecordingApi.Instance.clear(); + // clear the recoringApi + RecordingApi.Instance.clear(); // this will call upon progessbar to update videos to be in the correct order - console.log('setFinished to true', finished) setFinished(true); - } } const pause = (e: React.PointerEvent) => { -- cgit v1.2.3-70-g09d2