|
|
|
|
@ -1,10 +1,13 @@ |
|
|
|
|
import { useRef } from 'react' |
|
|
|
|
|
|
|
|
|
import { VideoPlayer } from 'features/VideoPlayer' |
|
|
|
|
import { Icon } from 'features/Icon' |
|
|
|
|
|
|
|
|
|
import { readToken } from 'helpers' |
|
|
|
|
|
|
|
|
|
import { ScModal } from './styled' |
|
|
|
|
import { isProduction } from 'config/env' |
|
|
|
|
|
|
|
|
|
import { ScModal, ScCloseButton } from './styled' |
|
|
|
|
|
|
|
|
|
interface VideoPropsType { |
|
|
|
|
isOpenPopupVideo: boolean, |
|
|
|
|
@ -15,29 +18,30 @@ const urls = { |
|
|
|
|
production: 'https://instat-stream-production.s3.eu-west-1.amazonaws.com/media/highlights/demo/demohighlight.mp4', |
|
|
|
|
stage: 'https://instat-stream-staging.s3.eu-west-1.amazonaws.com/media/highlights/demo/demohighlight.mp4', |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
export const VideoHighlight = ({ |
|
|
|
|
isOpenPopupVideo, |
|
|
|
|
setIsOpenPopupVideo, |
|
|
|
|
} :VideoPropsType) => { |
|
|
|
|
const videoRef = useRef<HTMLVideoElement>(null) |
|
|
|
|
|
|
|
|
|
return ( |
|
|
|
|
// eslint-disable-next-line
|
|
|
|
|
<ScModal |
|
|
|
|
isOpen={isOpenPopupVideo} |
|
|
|
|
close={() => setIsOpenPopupVideo(false)} |
|
|
|
|
withCloseButton={false} |
|
|
|
|
> |
|
|
|
|
<VideoPlayer |
|
|
|
|
width='100%' |
|
|
|
|
height='100%' |
|
|
|
|
src={`${urls.stage}?access_token=${readToken()}`} |
|
|
|
|
src={`${isProduction ? urls.production : urls.stage}?access_token=${readToken()}`} |
|
|
|
|
ref={videoRef} |
|
|
|
|
playing={Boolean(true)} |
|
|
|
|
muted={false} |
|
|
|
|
isFullscreen={false} |
|
|
|
|
controls={Boolean(true)} |
|
|
|
|
// crossOrigin='use-credentials'
|
|
|
|
|
/> |
|
|
|
|
<ScCloseButton onClick={() => setIsOpenPopupVideo(false)}> |
|
|
|
|
<Icon refIcon='Close' styles={{ marginTop: '3px' }} /> |
|
|
|
|
</ScCloseButton> |
|
|
|
|
</ScModal> |
|
|
|
|
) |
|
|
|
|
} |
|
|
|
|
|