aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/nodes/RecordingBox/RecordingView.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/views/nodes/RecordingBox/RecordingView.tsx')
-rw-r--r--src/client/views/nodes/RecordingBox/RecordingView.tsx18
1 files changed, 8 insertions, 10 deletions
diff --git a/src/client/views/nodes/RecordingBox/RecordingView.tsx b/src/client/views/nodes/RecordingBox/RecordingView.tsx
index 35a6aa07e..15883632a 100644
--- a/src/client/views/nodes/RecordingBox/RecordingView.tsx
+++ b/src/client/views/nodes/RecordingBox/RecordingView.tsx
@@ -140,7 +140,6 @@ export function RecordingView(props: IRecordingViewProps) {
}
videoRecorder.current.onstop = () => {
- // RecordingApi.Instance.stop();
// if we have a last portion
if (videoChunks.length > 1) {
// append the current portion to the video pieces
@@ -149,9 +148,10 @@ export function RecordingView(props: IRecordingViewProps) {
endTime: recordingTimerRef.current,
startTime: videos?.lastElement()?.endTime || 0
};
+
// depending on if a presenation exists, add it to the video
- const { done: presError, value: presentation } = RecordingApi.Instance.yieldPresentation().next();
- setVideos(videos => [...videos, (!presError && trackScreen) ? { ...nextVideo, presentation } : nextVideo]);
+ const presentation = RecordingApi.Instance.yieldPresentation();
+ setVideos(videos => [...videos, (presentation != null && trackScreen) ? { ...nextVideo, presentation } : nextVideo]);
}
// reset the temporary chunks
@@ -174,8 +174,8 @@ export function RecordingView(props: IRecordingViewProps) {
const stream = videoElementRef.current!.srcObject;
stream instanceof MediaStream && stream.getTracks().forEach(track => track.stop());
- // clear the recoringApi
- RecordingApi.Instance.clear();
+ // finish/clear the recoringApi
+ RecordingApi.Instance.finish();
// this will call upon progessbar to update videos to be in the correct order
setFinished(true);
@@ -188,12 +188,10 @@ export function RecordingView(props: IRecordingViewProps) {
}
const start = (e: React.PointerEvent) => {
- // the code to start or resume does not get triggered if we start dragging the button
setupMoveUpEvents({}, e, returnTrue, returnFalse, e => {
- if (!videoRecorder.current || videoRecorder.current.state === "inactive") {
- record();
- // trackScreen &&
- }
+ // start recording if not already recording
+ if (!videoRecorder.current || videoRecorder.current.state === "inactive") record();
+
return true; // cancels propagation to documentView to avoid selecting it.
}, false, false);
}