From d94ac6fa8509a883f4f51f62887da9b9b5084740 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Thu, 22 Oct 2020 15:35:02 +0200 Subject: add uploadable poster image to videos and make them auto inline --- .../app/views/media/components/media.formVideo.js | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'animism-align/frontend/app/views/media/components') diff --git a/animism-align/frontend/app/views/media/components/media.formVideo.js b/animism-align/frontend/app/views/media/components/media.formVideo.js index a586bb8..493a10c 100644 --- a/animism-align/frontend/app/views/media/components/media.formVideo.js +++ b/animism-align/frontend/app/views/media/components/media.formVideo.js @@ -2,8 +2,10 @@ import React, { Component } from 'react' import { Link } from 'react-router-dom' import VimeoPlayer from '@u-wave/react-vimeo' +import actions from 'app/actions' import { capitalize } from 'app/utils' -import { TextInput, LabelDescription, Select, TextArea, Checkbox, SubmitButton, Loader } from 'app/common' +import { posterURL } from 'app/utils/annotation.utils' +import { TextInput, LabelDescription, Select, TextArea, Checkbox, SubmitButton, Loader, FileInputField } from 'app/common' import { getVimeoMetadata } from 'app/views/media/media.actions' @@ -62,12 +64,13 @@ export default class MediaVideoForm extends Component { } // uploadData['__image_filename'] = file.filename return actions.upload.upload(uploadData).then(data => { - this.handleSettingsChange("poster", data.res) + this.handleSettingsSelect("poster", data.res) }) } render() { const { data } = this.props + const poster_url = posterURL(data) return (
- {data.settings.video && + {poster_url && - {data.settings.poster && - - } + + + } -- cgit v1.2.3-70-g09d2