diff options
| author | monoguitari <113245090+monoguitari@users.noreply.github.com> | 2023-08-22 15:43:17 -0400 |
|---|---|---|
| committer | monoguitari <113245090+monoguitari@users.noreply.github.com> | 2023-08-22 15:43:17 -0400 |
| commit | 072cf7eca410e860e0b4e1e22495756fc3884515 (patch) | |
| tree | 2764deeaf201d0411f15ffa78e54a2d3e8f21945 /src/client/views/nodes/RecordingBox | |
| parent | e7362c2cdedf388b8be5a0ab077a72dd2c286d60 (diff) | |
| parent | 7a2f4ea7d58b816e84949c58d66310ac6a18edd6 (diff) | |
Merge remote-tracking branch 'origin/menu-shortcuts-4-jesus' into advanced-trails-2-jesus
Diffstat (limited to 'src/client/views/nodes/RecordingBox')
| -rw-r--r-- | src/client/views/nodes/RecordingBox/RecordingBox.tsx | 69 |
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; +}) |
