From a5da5e6246a6fd7500fed8b206fc3540be509eab Mon Sep 17 00:00:00 2001
From: Jenny Yu <jennyyu212@outlook.com>
Date: Fri, 22 Apr 2022 19:53:44 -0400
Subject: uploading not working (cannot find ffmpeg)

---
 .../views/nodes/RecordingBox/RecordingBox.tsx      | 37 +++++++++++++++-------
 1 file changed, 26 insertions(+), 11 deletions(-)

(limited to 'src/client/views/nodes/RecordingBox/RecordingBox.tsx')

diff --git a/src/client/views/nodes/RecordingBox/RecordingBox.tsx b/src/client/views/nodes/RecordingBox/RecordingBox.tsx
index 6d444d324..1e17e2ddd 100644
--- a/src/client/views/nodes/RecordingBox/RecordingBox.tsx
+++ b/src/client/views/nodes/RecordingBox/RecordingBox.tsx
@@ -1,24 +1,39 @@
+import { action, observable } from "mobx";
 import { observer } from "mobx-react";
 import * as React from "react";
+import { AudioField } from "../../../../fields/URLField";
+import { Upload } from "../../../../server/SharedMediaTypes";
 import { ViewBoxBaseComponent } from "../../DocComponent";
 import { FieldView } from "../FieldView";
+import { VideoBox } from "../VideoBox";
 import { RecordingView } from './RecordingView';
 
 
 @observer
-export class RecordingBox extends ViewBoxBaseComponent(){
+export class RecordingBox extends ViewBoxBaseComponent() {
 
-    public static LayoutString(fieldKey: string) { return FieldView.LayoutString(RecordingBox, fieldKey); }
+      public static LayoutString(fieldKey: string) { return FieldView.LayoutString(RecordingBox, fieldKey); }
 
-    private _ref: React.RefObject<HTMLDivElement> = React.createRef();
+      private _ref: React.RefObject<HTMLDivElement> = React.createRef();
 
-    constructor(props: any) {
-        super(props);
-    }
+      constructor(props: any) {
+            super(props);
+      }
 
-    render() {
-        return <div className="recordingBox" ref={this._ref}>
-            <RecordingView/>
-        </div>;
-    }
+      @observable result: Upload.FileInformation | undefined = undefined
+
+      @action
+      setResult = (info: Upload.FileInformation) => {
+            console.log("Setting result to " + info)
+            this.result = info
+            console.log(this.result.accessPaths.agnostic.client)
+            this.props.Document[this.fieldKey] = new AudioField(this.result.accessPaths.agnostic.client);
+      }
+
+      render() {
+            return <div className="recordingBox" ref={this._ref}>
+                  {!this.result ? <RecordingView setResult={this.setResult} /> :
+                        <p>video box</p>}
+            </div>;
+      }
 }
-- 
cgit v1.2.3-70-g09d2

