-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvideo.html
87 lines (84 loc) · 2.3 KB
/
video.html
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
<html>
<head>
<title>ScrollPlay Test</title>
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
#video_container {
display: block;
position: relative;
}
#inner_text {
position: absolute;
height: 100%;
display: flex;
flex-flow: column nowrap;
justify-content: space-between;
z-index: 100;
margin-inline: 5rem;
font-size: 3em;
padding-block: 5rem;
color: #fff;
font-family: "helvetica";
text-shadow: 2px 2px 1px black;
}
#canvas {
position: -webkit-sticky;
position: -moz-sticky;
position: -o-sticky;
position: -ms-sticky;
position: sticky;
top: 0;
left: 0;
width: 100%;
height: 100vh;
object-fit: cover;
object-position: center center;
}
video {
width:100%;
height:100%;
}
#more_content,
#initial_content {
height: 100vh;
display: flex;
align-items: center;
justify-content: center;
background: blue;
color: white;
font-size: 3rem;
font-family: sans-serif;
}
#more_content {
background-color: green;
}
</style>
<script type="text/javascript" src="scrollPlay.js?1.10" /></script>
</head>
<body>
<div id="initial_content">
<h1>Initial Content</h1>
</div>
<div id="container">
<canvas id="canvas">
<video id="video" tabindex="0" autobuffer="autobuffer" preload="preload" muted playsinline>
<!-- <source type='video/webm' src="https://static.pkmo.dev/533_handbrake_test_05.webm"></source> -->
<!-- <source type='video/mp4' src="https://static.pkmo.dev/533_handbrake_test_02.mp4"></source> -->
<source type='video/mp4; codecs="avc1.42E01E, mp4a.40.2"' src="https://static.pkmo.dev/opt2_1080px_12fps_210902.mp4">
</source>
<p>Sorry, your browser does not support the <video> element.</p>
</video>
</canvas>
</div>
<div id="more_content">
<h1>Additional Content</h1>
</div>
<script>
const scroll = new ScrollPlay({ speed: 300, video: "video", inertia: 6 });
</script>
</body>
</html>