From 417ffc21deeb4be5e2644846f2818ec63b4cbaa6 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Wed, 28 Oct 2020 18:05:04 +0100 Subject: poster image size --- animism-align/frontend/app/constants.js | 7 +++++++ animism-align/frontend/app/utils/annotation.utils.js | 3 +++ .../annotations/annotationForms/annotationForm.video.js | 10 +++++++++- .../frontend/app/views/media/containers/media.index.js | 6 ++++-- animism-align/frontend/app/views/media/media.css | 4 ++++ .../app/views/viewer/player/components.inline/inline.video.js | 3 +++ .../app/views/viewer/player/components.media/media.css | 1 + .../frontend/app/views/viewer/player/player.transcript.css | 4 +++- 8 files changed, 34 insertions(+), 4 deletions(-) (limited to 'animism-align/frontend/app') diff --git a/animism-align/frontend/app/constants.js b/animism-align/frontend/app/constants.js index b6b3bf2..647efbc 100644 --- a/animism-align/frontend/app/constants.js +++ b/animism-align/frontend/app/constants.js @@ -99,6 +99,13 @@ export const CURTAIN_COLOR_LOOKUP = CURTAIN_COLORS.reduce((a,b) => { return a }, {}) +export const IMAGE_BACKGROUND_SIZE_OPTIONS = [ + { label: 'cover', name: 'cover' }, + { label: 'contain', name: 'contain' }, + { label: '90% width', name: '90% auto' }, + { label: '90% height', name: 'auto 90%' }, +] + export const DISPLAY_SIZE = 2000 export const DISPLAY_QUALITY= 80 export const THUMBNAIL_SIZE = 320 diff --git a/animism-align/frontend/app/utils/annotation.utils.js b/animism-align/frontend/app/utils/annotation.utils.js index 41e0e3b..d76f473 100644 --- a/animism-align/frontend/app/utils/annotation.utils.js +++ b/animism-align/frontend/app/utils/annotation.utils.js @@ -20,6 +20,9 @@ export const thumbnailURL = media => { // console.log(media) switch (media.type) { case 'video': + if (media.settings.poster) { + return media.settings.poster.url + } return media.settings.video.thumbnail_url case 'image': diff --git a/animism-align/frontend/app/views/align/components/annotations/annotationForms/annotationForm.video.js b/animism-align/frontend/app/views/align/components/annotations/annotationForms/annotationForm.video.js index 0199b46..45b538b 100644 --- a/animism-align/frontend/app/views/align/components/annotations/annotationForms/annotationForm.video.js +++ b/animism-align/frontend/app/views/align/components/annotations/annotationForms/annotationForm.video.js @@ -1,6 +1,6 @@ import React, { Component } from 'react' -import { CURTAIN_COLOR_SELECT_OPTIONS } from 'app/constants' +import { CURTAIN_COLOR_SELECT_OPTIONS, IMAGE_BACKGROUND_SIZE_OPTIONS } from 'app/constants' import { Select, Checkbox } from 'app/common' import { AnnotationFormFullscreen } from './annotationForm.utility' @@ -78,6 +78,14 @@ export const AnnotationFormVideo = ({ annotation, media, handleSettingsSelect, h defaultOption='Pick a color' onChange={handleSettingsSelect} /> +