forked from muaz-khan/DetectRTC
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsimple-demo.html
29 lines (24 loc) · 959 Bytes
/
simple-demo.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
<script src="https://cdn.webrtc-experiment.com/DetectRTC.js"> </script>
<script>
navigator.mediaDevices.getUserMedia({audio: true, video: true }).then(function(stream) {
var temp = document.createElement('video');
temp.srcObject = stream;
temp.volume = 0;
temp.play();
DetectRTC.load(function() {
document.write('<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0">');
DetectRTC.audioInputDevices.forEach(function(device) {
document.write(JSON.stringify(device, null, '<br>'));
document.write('<hr>');
});
document.write('--------------<hr>');
DetectRTC.videoInputDevices.forEach(function(device) {
document.write(JSON.stringify(device, null, '<br>'));
document.write('<hr>');
});
stream.getTracks().forEach(function(track) {
track.stop();
});
});
});
</script>