2021-11-04 00:37:17 +08:00
|
|
|
import styled from 'styled-components';
|
|
|
|
import ReactPlayer from 'react-player';
|
|
|
|
|
|
|
|
const VideoPlayerWrapper = styled.div`
|
|
|
|
position: relative;
|
|
|
|
width: 100%;
|
|
|
|
height: 100%;
|
2021-12-10 22:55:37 +08:00
|
|
|
|
|
|
|
${({ fullscreen }) => fullscreen && `
|
|
|
|
position: fixed;
|
|
|
|
top: 0;
|
|
|
|
left: 0;
|
|
|
|
width: 100vw;
|
|
|
|
height: 100vh;
|
|
|
|
z-index: 99;
|
|
|
|
`}
|
2021-11-04 00:37:17 +08:00
|
|
|
`;
|
|
|
|
|
|
|
|
const AutoPlayWarning = styled.p`
|
|
|
|
position: absolute;
|
|
|
|
z-index: 100;
|
|
|
|
font-size: x-large;
|
|
|
|
color: white;
|
|
|
|
width: 100%;
|
|
|
|
background-color: rgba(6,23,42,0.5);
|
|
|
|
bottom: 20%;
|
|
|
|
vertical-align: middle;
|
|
|
|
text-align: center;
|
|
|
|
pointer-events: none;
|
|
|
|
`;
|
|
|
|
|
|
|
|
const VideoPlayer = styled(ReactPlayer)`
|
|
|
|
width: 100%;
|
|
|
|
height: 100%;
|
|
|
|
& > iframe {
|
|
|
|
display: flex;
|
|
|
|
flex-flow: column;
|
|
|
|
flex-grow: 1;
|
|
|
|
flex-shrink: 1;
|
|
|
|
position: relative;
|
|
|
|
overflow-x: hidden;
|
|
|
|
overflow-y: auto;
|
|
|
|
border-style: none;
|
|
|
|
border-bottom: none;
|
|
|
|
}
|
|
|
|
`;
|
|
|
|
|
|
|
|
const MobileControlsOverlay = styled.span`
|
|
|
|
position: absolute;
|
|
|
|
top:0;
|
|
|
|
left: 0;
|
|
|
|
width: 100%;
|
|
|
|
height: 100%;
|
|
|
|
background-color: transparent;
|
|
|
|
`;
|
|
|
|
|
|
|
|
const HoverToolbar = styled.div`
|
|
|
|
${({ toolbarStyle }) => toolbarStyle === 'hoverToolbar' && `
|
|
|
|
display: none;
|
|
|
|
|
|
|
|
:hover > & {
|
|
|
|
display: flex;
|
|
|
|
}
|
|
|
|
`}
|
|
|
|
|
|
|
|
${({ toolbarStyle }) => toolbarStyle === 'dontShowMobileHoverToolbar' && `
|
|
|
|
display: none;
|
|
|
|
`}
|
|
|
|
|
|
|
|
${({ toolbarStyle }) => toolbarStyle === 'showMobileHoverToolbar' && `
|
|
|
|
display: flex;
|
|
|
|
z-index: 2;
|
|
|
|
`}
|
|
|
|
`;
|
|
|
|
|
2022-04-09 04:30:21 +08:00
|
|
|
const ProgressBar = styled.div`
|
2022-05-07 01:30:41 +08:00
|
|
|
position: absolute;
|
|
|
|
bottom: 0;
|
2022-04-09 04:30:21 +08:00
|
|
|
height: 5px;
|
|
|
|
width: 100%;
|
|
|
|
|
|
|
|
background-color: transparent;
|
|
|
|
`;
|
|
|
|
|
|
|
|
const Loaded = styled.div`
|
|
|
|
height: 100%;
|
|
|
|
background-color: gray;
|
|
|
|
`;
|
|
|
|
|
|
|
|
const Played = styled.div`
|
|
|
|
height: 100%;
|
|
|
|
background-color: #DF2721;
|
|
|
|
`;
|
|
|
|
|
2022-04-26 04:13:48 +08:00
|
|
|
const ButtonsWrapper = styled.div`
|
|
|
|
position: absolute;
|
|
|
|
right: auto;
|
|
|
|
left: 0;
|
|
|
|
bottom: 0;
|
|
|
|
top: 0;
|
|
|
|
display: flex;
|
2022-05-03 01:56:30 +08:00
|
|
|
|
|
|
|
[dir="rtl"] & {
|
|
|
|
right: 0;
|
|
|
|
left : auto;
|
|
|
|
}
|
2022-04-26 04:13:48 +08:00
|
|
|
`;
|
|
|
|
|
2021-11-04 00:37:17 +08:00
|
|
|
export default {
|
|
|
|
VideoPlayerWrapper,
|
|
|
|
AutoPlayWarning,
|
|
|
|
VideoPlayer,
|
|
|
|
MobileControlsOverlay,
|
|
|
|
HoverToolbar,
|
2022-04-09 04:30:21 +08:00
|
|
|
ProgressBar,
|
|
|
|
Loaded,
|
|
|
|
Played,
|
2022-04-26 04:13:48 +08:00
|
|
|
ButtonsWrapper,
|
2021-11-04 00:37:17 +08:00
|
|
|
};
|