-
Notifications
You must be signed in to change notification settings - Fork 241
/
Copy pathvideo.tsx
61 lines (56 loc) · 1.2 KB
/
video.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
// import ReactPlayer from "react-player";
import { lazy } from 'react';
import styled from "styled-components";
import { VideoCompIcon } from "icons";
const ReactPlayer = lazy(() => import("react-player"));
export const Video = styled(ReactPlayer)`
height: 100% !important;
width: 100% !important;
`;
export const Container = styled.div`
height: 100%;
width: 100%;
display: flex;
align-items: center;
justify-content: center;
div > video {
object-fit: contain;
pointer-events: auto;
height: 100%;
width: 100%;
:focus-visible {
/* cover <video/> default css */
outline: 0px;
}
}
`;
const PlayTriangle = styled(VideoCompIcon)`
position: absolute;
left: 0;
top: 0;
right: 0;
bottom: 0;
margin: auto;
transition: 0.3s;
transform-origin: center;
`;
const PlayButton = styled.div`
height: 80px;
width: 80px;
left: 50%;
transform: translateX(-50%);
border-radius: 50%;
background: #4965f2;
border: 4px solid #ffffff;
box-shadow: 0 3px 6px 0 rgba(0, 0, 0, 0.15);
position: absolute;
transition: 0.3s;
transform-origin: center;
`;
export const playIcon = () => {
return (
<PlayButton>
<PlayTriangle />
</PlayButton>
);
};