-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathgum-enum.html
More file actions
33 lines (33 loc) · 846 Bytes
/
gum-enum.html
File metadata and controls
33 lines (33 loc) · 846 Bytes
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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body>
<video width=200 height=200>
</video>
<script>
navigator.mediaDevices.getUserMedia({ video: {
facingMode: { ideal: 'environment' },
}, audio: false })
.then(function(stream) {
stream.addEventListener('inactive', () => {
console.log("STREAM TURNED INACTIVE");
})
const video = document.querySelector('video');
video.srcObject = stream;
video.muted = true;
video.onloadedmetadata = function(e) {
video.play();
navigator.mediaDevices.enumerateDevices().then(devices => {
console.log('GOT DEVICES', devices)
});
};
})
.catch(function(err) {
console.error(err);
});
</script>
</body>
</html>