From 27b514747188f12e0b0eeeb124576c556316923d Mon Sep 17 00:00:00 2001
From: Tyler Schicke <tyler_schicke@brown.edu>
Date: Mon, 22 Apr 2019 22:57:18 -0400
Subject: Changes

---
 src/client/views/nodes/AudioBox.tsx | 27 +++++----------------------
 1 file changed, 5 insertions(+), 22 deletions(-)

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

diff --git a/src/client/views/nodes/AudioBox.tsx b/src/client/views/nodes/AudioBox.tsx
index 1493ff25b..be12dced3 100644
--- a/src/client/views/nodes/AudioBox.tsx
+++ b/src/client/views/nodes/AudioBox.tsx
@@ -1,36 +1,19 @@
 import React = require("react");
 import { FieldViewProps, FieldView } from './FieldView';
-import { FieldWaiting } from '../../../fields/Field';
 import { observer } from "mobx-react";
-import { ContextMenu } from "../../views/ContextMenu";
-import { observable, action } from 'mobx';
-import { KeyStore } from '../../../fields/KeyStore';
-import { AudioField } from "../../../fields/AudioField";
 import "./AudioBox.scss";
-import { NumberField } from "../../../fields/NumberField";
+import { Cast } from "../../../new_fields/Types";
+import { AudioField } from "../../../new_fields/URLField";
 
+const defaultField: AudioField = new AudioField(new URL("http://techslides.com/demos/samples/sample.mp3"));
 @observer
 export class AudioBox extends React.Component<FieldViewProps> {
 
     public static LayoutString() { return FieldView.LayoutString(AudioBox); }
 
-    constructor(props: FieldViewProps) {
-        super(props);
-    }
-
-
-
-    componentDidMount() {
-    }
-
-    componentWillUnmount() {
-    }
-
-
     render() {
-        let field = this.props.Document.Get(this.props.fieldKey);
-        let path = field === FieldWaiting ? "http://techslides.com/demos/samples/sample.mp3" :
-            field instanceof AudioField ? field.Data.href : "http://techslides.com/demos/samples/sample.mp3";
+        let field = Cast(this.props.Document[this.props.fieldKey], AudioField, defaultField);
+        let path = field.url.href;
 
         return (
             <div>
-- 
cgit v1.2.3-70-g09d2

