-
Notifications
You must be signed in to change notification settings - Fork 3
/
gum_resolutions.html
48 lines (40 loc) · 1.63 KB
/
gum_resolutions.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
<!DOCTYPE html>
<html>
<head>
<meta name=viewport content="width=device-width, initial-scale=1">
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Multi resolutions getUserMedia() demo</title>
</head>
<body>
<div> Open the system camera in different resolutions simultaneously.</div>
</body>
<script type="text/javascript" src="dimsum.js"></script>
<script>
var theStream;
var videoTagIndex = 0;
function gotStream(stream) {
theStream = stream;
const videoTagId = 'videotag' + videoTagIndex;
createVideoTag(videoTagId, 240, 180, stream);
videoTagIndex++;
document.getElementById("btn-resize").disabled = false;
}
createButton("btn1", "320x240", makeGetStreamX(320, 240, "btn1", gotStream));
createButton("btn2", "640x480", makeGetStreamX(640, 480, "btn2", gotStream));
createButton("btn3", "960x720", makeGetStreamX(960, 720, "btn3", gotStream));
createButton("btn4", "1280x720", makeGetStreamX(1280, 720, "btn4", gotStream));
document.body.appendChild(document.createElement("br"));
createButton("btn5", "1920x1080", makeGetStreamX(1920, 1080, "btn5", gotStream));
createButton("btn6", "3840x2160", makeGetStreamX(3840, 2160, "btn6", gotStream));
document.body.appendChild(document.createElement("br"));
function resizeMe() {
const leTag = document.getElementById("videotag0");
leTag.width = leTag.videoWidth;
leTag.height = leTag.videoHeight;
document.getElementById("btn-resize").disabled = true;
}
createButton("btn-resize", "Resize first <video> to its stream size", resizeMe);
document.getElementById("btn-resize").disabled = true;
document.body.appendChild(document.createElement("br"));
</script>
</html>