import React, { Component } from 'react'
import VimeoPlayer from 'app/utils/vendor/vimeo'
import { CURTAIN_COLOR_LOOKUP } from 'app/constants'
import { SpeakerIcon } from '../../nav/viewer.icons'
import { MediaCitation } from '../components.media'
import { posterURL } from 'app/utils/annotation.utils'
export const MediaVideo = ({ paragraph, media, currentParagraph, onAnnotationClick }) => {
if (!media.lookup) return
// const { color } = element
const className = currentParagraph ? 'media video current' : 'media video'
const annotation = paragraph.annotations[0]
const item = media.lookup[annotation.settings.media_id]
if (!item) return Media not found: {annotation.settings.media_id}
const color = CURTAIN_COLOR_LOOKUP[annotation.settings.color] || CURTAIN_COLOR_LOOKUP.white
const width = window.innerWidth
const height = window.innerHeight - (17 * 16)
const style = {
color: color.textColor,
height: height + 32,
backgroundColor: color.backgroundColor,
}
// if this is a fullscreen video, display the poster image
if (annotation.settings.fullscreen && !annotation.settings.inline) {
style.backgroundImage = 'url(' + posterURL(item) + ')'
if (annotation.settings.poster_size) {
style.backgroundSize = annotation.settings.poster_size
}
return (
)
}
const poster = annotation.settings.poster ? {
backgroundImage: 'url(' + posterURL(item) + ')',
} : {}
return (
)
}