diff options
author | Michael Foiani <sotech117@Michaels-MacBook-Pro-5.local> | 2022-06-12 10:01:14 -0400 |
---|---|---|
committer | Michael Foiani <sotech117@Michaels-MacBook-Pro-5.local> | 2022-06-12 10:01:14 -0400 |
commit | f95ea8c5ea8212fe56125822e509f1c7d999133c (patch) | |
tree | 4bae2a62ca3496c74b613c589303046d0b68bf14 | |
parent | 1688af3de54419029773fb85b78bca4500f7f0de (diff) |
fix small bug with video recorder. need to work on recording api bug
-rw-r--r-- | src/client/views/nodes/RecordingBox/RecordingView.tsx | 23 |
1 files changed, 8 insertions, 15 deletions
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) => { |