aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/nodes/RecordingBox
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2024-05-08 21:03:08 -0400
committerbobzel <zzzman@gmail.com>2024-05-08 21:03:08 -0400
commitb858bd3cad81da41e63b9f8e807e41421ca4aa34 (patch)
tree99355f0595194e136494d50c527c859209935191 /src/client/views/nodes/RecordingBox
parentb8907e69160d97d919fcd83eb86d60e3634205ca (diff)
lots of api cleanup and cycle removal
Diffstat (limited to 'src/client/views/nodes/RecordingBox')
-rw-r--r--src/client/views/nodes/RecordingBox/RecordingBox.tsx13
1 files changed, 4 insertions, 9 deletions
diff --git a/src/client/views/nodes/RecordingBox/RecordingBox.tsx b/src/client/views/nodes/RecordingBox/RecordingBox.tsx
index e46e40bfe..07381c7d0 100644
--- a/src/client/views/nodes/RecordingBox/RecordingBox.tsx
+++ b/src/client/views/nodes/RecordingBox/RecordingBox.tsx
@@ -50,9 +50,9 @@ export class RecordingBox extends ViewBoxBaseComponent<FieldViewProps>() {
this.result = info;
this.dataDoc.type = DocumentType.VID;
- this.dataDoc.layout = VideoBox.LayoutString(this.fieldKey);
+ this.dataDoc[this.fieldKey + '_recorded'] = this.dataDoc.layout; // save the recording layout to allow re-recording later
+ this.dataDoc.layout = VideoBox.LayoutString(this.fieldKey); // then convert the recording box to a video
this.dataDoc[this._props.fieldKey] = new VideoField(this.result.accessPaths.client);
- this.dataDoc[this.fieldKey + '_recorded'] = true;
// stringify the presentation and store it
if (presentation?.movements) {
const presCopy = { ...presentation };
@@ -143,18 +143,13 @@ export class RecordingBox extends ViewBoxBaseComponent<FieldViewProps>() {
public static resumeWorkspaceReplaying(doc: Doc) {
const docView = DocumentView.getDocumentView(doc);
- if (docView?.ComponentView instanceof VideoBox) {
- docView.ComponentView.Play();
- }
+ docView?.ComponentView?.Play?.();
Doc.UserDoc().workspaceReplayingState = mediaState.Playing;
}
public static pauseWorkspaceReplaying(doc: Doc) {
const docView = DocumentView.getDocumentView(doc);
- const videoBox = docView?.ComponentView as VideoBox;
- if (videoBox) {
- videoBox.Pause();
- }
+ docView?.ComponentView?.Pause?.();
Doc.UserDoc().workspaceReplayingState = mediaState.Paused;
}