feat: vod display (#686)
* feat: preview for html5 supported videos * fix: handle out of limit tags * feat: support preview on the donwload screen * refactor: rework meta and preview handling to be more general * fix: missing meta * fix: do not allow maybe or probably types * fix: make the media check more strict --------- Co-authored-by: Levente Kiss <levente.kiss@solarpunk.bzz>
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
import { createStyles, makeStyles } from '@material-ui/core'
|
||||
import { ReactElement } from 'react'
|
||||
|
||||
const useStyles = makeStyles(() =>
|
||||
createStyles({
|
||||
video: {
|
||||
width: '100%',
|
||||
height: '100%',
|
||||
objectFit: 'cover',
|
||||
},
|
||||
}),
|
||||
)
|
||||
|
||||
interface VideoProps {
|
||||
src: string | undefined
|
||||
maxHeight?: string
|
||||
maxWidth?: string
|
||||
}
|
||||
|
||||
export function FitVideo(props: VideoProps): ReactElement {
|
||||
const classes = useStyles()
|
||||
|
||||
const inlineStyles: Record<string, string> = {}
|
||||
|
||||
props.maxHeight && (inlineStyles.maxHeight = props.maxHeight)
|
||||
props.maxWidth && (inlineStyles.maxWidth = props.maxWidth)
|
||||
|
||||
return <video className={classes.video} src={props.src} style={inlineStyles} controls />
|
||||
}
|
||||
Reference in New Issue
Block a user