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:
Levente Kiss
2025-02-12 11:35:46 +01:00
committed by GitHub
parent f695ac3a1c
commit bcd3d50b42
12 changed files with 170 additions and 93 deletions
+29
View File
@@ -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 />
}