123456789101112131415161718192021222324252627282930313233 |
- import { css } from '@emotion/core'
- import { breakpoints } from '../../theme'
- export type VideoPlayerStyleProps = {
- width?: string | number
- height?: string | number
- responsive?: boolean
- ratio?: string
- }
- export let makeStyles = ({
- width = '100%',
- height = '100%',
- responsive = true,
- ratio = '16:9',
- }: VideoPlayerStyleProps) => {
- let ratioPerc = ratio
- .split(':')
- .map((x) => Number(x))
- .reduce((x, y) => (y / x) * 100)
- return {
- containerStyles: css`
- max-width: ${breakpoints.medium};
- & .video-player {
- }
- `,
- playerStyles: css`
- width: ${width};
- height: ${height};
- `,
- }
- }
|