diff options
| author | Michael Foiani <sotech117@michaels-mbp-5.devices.brown.edu> | 2022-06-13 14:56:03 -0400 |
|---|---|---|
| committer | Michael Foiani <sotech117@michaels-mbp-5.devices.brown.edu> | 2022-06-13 14:56:03 -0400 |
| commit | f8bfda0b0139db5f8bf1de602ce211a091d5d9ef (patch) | |
| tree | a3f851c63a6259451a140eb3e20dffcbce241cb8 /src/client/views/nodes/RecordingBox | |
| parent | 1dfb694ffa8f34a834387eb073ffb9bd3a678039 (diff) | |
revert to previous stable commit. lmao get ratioed by a mouse
Diffstat (limited to 'src/client/views/nodes/RecordingBox')
| -rw-r--r-- | src/client/views/nodes/RecordingBox/RecordingBox.tsx | 2 | ||||
| -rw-r--r-- | src/client/views/nodes/RecordingBox/RecordingView.tsx | 18 |
2 files changed, 11 insertions, 9 deletions
diff --git a/src/client/views/nodes/RecordingBox/RecordingBox.tsx b/src/client/views/nodes/RecordingBox/RecordingBox.tsx index a28677525..6fe67b6db 100644 --- a/src/client/views/nodes/RecordingBox/RecordingBox.tsx +++ b/src/client/views/nodes/RecordingBox/RecordingBox.tsx @@ -46,7 +46,7 @@ export class RecordingBox extends ViewBoxBaseComponent() { this.dataDoc.layout = VideoBox.LayoutString(this.fieldKey); this.dataDoc[this.props.fieldKey] = new VideoField(this.result.accessPaths.client); this.dataDoc[this.fieldKey + "-recorded"] = true; - // stringify the presentation and store it + // stringify the presenation and store it presentation?.movements && (this.dataDoc[this.fieldKey + "-presentation"] = JSON.stringify(presentation)); } diff --git a/src/client/views/nodes/RecordingBox/RecordingView.tsx b/src/client/views/nodes/RecordingBox/RecordingView.tsx index d4d19f3d8..ba9479f41 100644 --- a/src/client/views/nodes/RecordingBox/RecordingView.tsx +++ b/src/client/views/nodes/RecordingBox/RecordingView.tsx @@ -141,6 +141,7 @@ 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,10 +150,9 @@ 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 presentation = RecordingApi.Instance.yieldPresentation(); - setVideos(videos => [...videos, (presentation != null && trackScreen) ? { ...nextVideo, presentation } : nextVideo]); + const { done: presError, value: presentation } = RecordingApi.Instance.yieldPresentation().next(); + setVideos(videos => [...videos, (!presError && trackScreen) ? { ...nextVideo, presentation } : nextVideo]); } // reset the temporary chunks @@ -175,8 +175,8 @@ export function RecordingView(props: IRecordingViewProps) { const stream = videoElementRef.current!.srcObject; stream instanceof MediaStream && stream.getTracks().forEach(track => track.stop()); - // finish/clear the recoringApi - RecordingApi.Instance.finish(); + // clear the recoringApi + RecordingApi.Instance.clear(); // this will call upon progessbar to update videos to be in the correct order setFinished(true); @@ -189,10 +189,12 @@ 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 => { - // start recording if not already recording - if (!videoRecorder.current || videoRecorder.current.state === "inactive") record(); - + if (!videoRecorder.current || videoRecorder.current.state === "inactive") { + record(); + // trackScreen && + } return true; // cancels propagation to documentView to avoid selecting it. }, false, false); } |
