-
Notifications
You must be signed in to change notification settings - Fork 112
/
index.html
69 lines (56 loc) · 1.5 KB
/
index.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Use getUserMedia with canvas</title>
<link rel="stylesheet" href="../main.css">
<style>
.none {
-webkit-filter: none;
filter: none;
}
.blur {
-webkit-filter: blur(3px);
filter: blur(3px);
}
.grayscale {
-webkit-filter: grayscale(1);
filter: grayscale(1);
}
.invert {
-webkit-filter: invert(1);
filter: invert(1);
}
.sepia {
-webkit-filter: sepia(1);
filter: sepia(1);
}
button#snapshot {
margin: 0 10px 25px 0;
width: 110px;
}
video {
object-fit: cover;
}
</style>
</head>
<body>
<div id="container">
<h1>修改媒体流,添加CSS样式滤镜</h1>
<video autoplay></video>
<label for="select">选择滤镜: </label>
<select id="filter">
<option value="none">None</option>
<option value="blur">Blur</option>
<option value="grayscale">Grayscale</option>
<option value="invert">Invert</option>
<option value="sepia">Sepia</option>
</select>
<button id="snapshot">开始捕捉</button>
<canvas></canvas>
<p>Draw a frame from the getUserMedia video stream onto the canvas element, then apply CSS filters.</p>
</div>
<script src="../adapter.js"></script>
<script src="main.js"></script>
</body>
</html>