diff --git a/app/jsx/assignments_2/student/components/AttemptType/MediaAttempt.js b/app/jsx/assignments_2/student/components/AttemptType/MediaAttempt.js index a0a4def8788..47e2e8e71cd 100644 --- a/app/jsx/assignments_2/student/components/AttemptType/MediaAttempt.js +++ b/app/jsx/assignments_2/student/components/AttemptType/MediaAttempt.js @@ -21,36 +21,57 @@ import Button from '@instructure/ui-buttons/lib/components/Button' import closedCaptionLanguages from '../../../../shared/closedCaptionLanguages' import I18n from 'i18n!assignments_2_text_entry' import {IconAttachMediaLine} from '@instructure/ui-icons' -import React, {useState} from 'react' +import React from 'react' import UploadMedia from '@instructure/canvas-media' import {UploadMediaStrings, MediaCaptureStrings} from '../../../../shared/UploadMediaTranslations' import View from '@instructure/ui-layout/lib/components/View' -export default function MediaAttempt() { - const [mediaModalOpen, setMediaModalOpen] = useState(false) +const languages = Object.keys(closedCaptionLanguages).map(key => { + return {id: key, label: closedCaptionLanguages[key]} +}) - const languages = Object.keys(closedCaptionLanguages).map(key => { - return {id: key, label: closedCaptionLanguages[key]} - }) +export default class MediaAttempt extends React.Component { + state = { + mediaModalOpen: false, + mediaObjectUrl: null + } - return ( - - setMediaModalOpen(false)} - open={mediaModalOpen} - liveRegion={() => document.getElementById('flash_screenreader_holder')} - languages={languages} - /> - } - message={ - - } - /> - - ) + onDismiss = mediaObject => { + this.setState({mediaModalOpen: false, mediaObjectUrl: mediaObject.embedded_iframe_url}) + } + + render() { + if (this.state.mediaObjectUrl) { + // TODO: figure out how the heck we want to style this thing. + return