import React, { useEffect, useState } from 'react' import styled from 'styled-components' import { PageProps } from 'gatsby' import moment from 'moment' import awsvideoconfig from '../../aws-video-exports' import { fetchVodAsset } from '../../shared/api/vod-fetch' import { fetchMediasSectionsFiltered } from '../../shared/api' import Layout from '../../shared/components/Layout' import VideoPlayerComponent from '../../shared/components/VideoPlayer' import { VideoOnDemand, MediasSections } from '../../models' import { useWindowDimensions } from '../../shared/hooks' import { screenSizes } from '../../shared/constants' import AmplifyLogo from '../../assets/logo/logo-light.svg' type VideoPlayerProps = { video: VideoOnDemand | undefined } const VideoPlayer = ({ video }: VideoPlayerProps) => { const videoJsOptions = { autoplay: false, controls: true, sources: [ { src: `https://${awsvideoconfig.awsOutputVideo}/public/${video?.id}/${video?.id}.m3u8`, type: 'application/x-mpegURL', }, ], } return } type IframeVideoPlayerProps = { asset: VideoOnDemand } const IFrameWrapper = styled.div` display: flex; background-color: black; justify-content: center; ` const IframeVideoPlayer = ({ asset }: IframeVideoPlayerProps) => { const { width } = useWindowDimensions() return (