aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/nodes/RecordingBox/RecordingBox.tsx
diff options
context:
space:
mode:
authormonoguitari <113245090+monoguitari@users.noreply.github.com>2023-08-22 15:42:55 -0400
committermonoguitari <113245090+monoguitari@users.noreply.github.com>2023-08-22 15:42:55 -0400
commit7a2f4ea7d58b816e84949c58d66310ac6a18edd6 (patch)
tree8f6153d58ae49fecc943ac30193ef837c097f230 /src/client/views/nodes/RecordingBox/RecordingBox.tsx
parentec6a5f5d5684ca66cd21bb8fef91c86852dd126f (diff)
uptodate
Diffstat (limited to 'src/client/views/nodes/RecordingBox/RecordingBox.tsx')
-rw-r--r--src/client/views/nodes/RecordingBox/RecordingBox.tsx69
1 files changed, 55 insertions, 14 deletions
diff --git a/src/client/views/nodes/RecordingBox/RecordingBox.tsx b/src/client/views/nodes/RecordingBox/RecordingBox.tsx
index 3237ce6cd..5502a1e08 100644
--- a/src/client/views/nodes/RecordingBox/RecordingBox.tsx
+++ b/src/client/views/nodes/RecordingBox/RecordingBox.tsx
@@ -9,7 +9,7 @@ import { VideoBox } from '../VideoBox';
import { RecordingView } from './RecordingView';
import { DocumentType } from '../../../documents/DocumentTypes';
import { Presentation } from '../../../util/TrackMovements';
-import { Doc } from '../../../../fields/Doc';
+import { Doc, DocListCast } from '../../../../fields/Doc';
import { Id } from '../../../../fields/FieldSymbols';
import { BoolCast, DocCast } from '../../../../fields/Types';
import { ScriptingGlobals } from '../../../util/ScriptingGlobals';
@@ -17,6 +17,11 @@ import { DocumentManager } from '../../../util/DocumentManager';
import { Docs } from '../../../documents/Documents';
import { CollectionFreeFormView } from '../../collections/collectionFreeForm/CollectionFreeFormView';
import { CurrentUserUtils } from '../../../util/CurrentUserUtils';
+import { DocumentView } from '../DocumentView';
+import { SettingsManager } from '../../../util/SettingsManager';
+import { PropertiesView } from '../../PropertiesView';
+import { PropertiesSection } from '../../PropertiesSection';
+import { PropertiesDocContextSelector } from '../../PropertiesDocContextSelector';
@observer
export class RecordingBox extends ViewBoxBaseComponent<FieldViewProps>() {
@@ -91,19 +96,29 @@ ScriptingGlobals.add(function toggleRecording(_readOnly_: boolean) {
//if recordingbox is true; when we press the stop button. changed vals temporarily to see if changes happening
console.log('grabbing screen!')
RecordingBox.screengrabber.Pause?.();
+ const remDoc = RecordingBox.screengrabber.rootDoc;
setTimeout(() => {
RecordingBox.screengrabber?.Finish?.();
RecordingBox.screengrabber!.rootDoc.overlayX = 400; //was 100
RecordingBox.screengrabber!.rootDoc.overlayY = 100;
- console.log(RecordingBox.screengrabber?.rootDoc)
+ // DocListCast(Doc.MyOverlayDocs.data)
+ // .filter(doc => doc.slides === RecordingBox.screengrabber!.rootDoc)
+ // .forEach(Doc.RemFromMyOverlay);
+ console.log(RecordingBox.screengrabber)
RecordingBox.screengrabber = undefined;
}, 100);
+ //could break if recording takes too long to turn into videobox. If so, either increase time on setTimeout below or find diff place to do this
+ setTimeout(() => {
+ Doc.RemFromMyOverlay(remDoc);
+
+ }, 1000)
Doc.UserDoc().isRecording = false;
- // console.log(RecordingBox.screengrabber.dataDoc);
+
// Doc.AddDocToList(Doc.UserDoc(), "workspaceRecordings", RecordingBox.screengrabber.dataDoc);
Doc.AddDocToList(Doc.UserDoc(), "workspaceRecordings", RecordingBox.screengrabber.rootDoc);
- // console.log(RecordingBox.screengrabber.rootDoc)
- // console.log(RecordingBox.screengrabber.dataDoc.data?.valueOf);
+
+ // let recView = Array.from(DocumentManager.Instance.DocumentViews).find(view => view.ComponentView instanceof CollectionFreeFormView);
+ // console.log(recView)
} else {
//when we first press mic
const screengrabber = Docs.Create.WebCamDocument('', {
@@ -125,23 +140,49 @@ ScriptingGlobals.add(function toggleRecording(_readOnly_: boolean) {
}
}, 'toggle recording');
ScriptingGlobals.add(function toggleRecPlayback(value: Doc) {
+ let docval = undefined;
+ Doc.UserDoc().isRecPlayback = true;
+ Doc.UserDoc().currentRecording = value;
console.log(value)
- const screenvid = Docs.Create.VideoDocument('', {_width: 384, _height: 216});
-
- let ffView = Array.from(DocumentManager.Instance.DocumentViews).find(view => view.ComponentView instanceof CollectionFreeFormView);
- (ffView?.ComponentView as CollectionFreeFormView).props.addDocument?.(value);
-
+ value.overlayX = 100;
+ value.overlayY = 100;
+ Doc.AddToMyOverlay(value);
+ DocumentManager.Instance.AddViewRenderedCb(value, docView => {
+ docval =
+ Doc.UserDoc().currentRecording = docView.ComponentView as VideoBox;
+ // docval.Play();
+ })
+ // let ffView = Array.from(DocumentManager.Instance.DocumentViews).find(view => view.ComponentView instanceof CollectionFreeFormView);
+ // (ffView?.ComponentView as CollectionFreeFormView).props.addDocument?.(value);
});
+ScriptingGlobals.add(function addRectoWorkspace() {
+ console.log("adding rec to doc");
+
+})
+ScriptingGlobals.add(function playWorkspaceRec(value: VideoBox) {
+ value.Play();
+})
+ScriptingGlobals.add(function pauseWorkspaceRec(value: VideoBox) {
+ value.Pause();
+})
+ScriptingGlobals.add(function closeWorkspaceRec(value: VideoBox) {
+ value.Pause();
+ Doc.RemFromMyOverlay(value.rootDoc);
+ Doc.UserDoc().currentRecording = undefined;
+ Doc.UserDoc().isRecPlayback = false;
+})
-ScriptingGlobals.add(function getCurrRecording() {
- console.log(RecordingBox.screengrabber);
-});
ScriptingGlobals.add(function getWorkspaceRecordings() {
return Doc.UserDoc().workspaceRecordings
});
ScriptingGlobals.add(function getIsRecording() {
return Doc.UserDoc().isRecording;
})
-
+ScriptingGlobals.add(function getIsRecPlayback() {
+ return Doc.UserDoc().isRecPlayback;
+})
+ScriptingGlobals.add(function getCurrentRecording() {
+ return Doc.UserDoc().currentRecording;
+})