Spaces:
Running
Running
NikolaSelic
commited on
Commit
•
812be88
1
Parent(s):
6026c67
Update index.html
Browse files- index.html +17 -0
index.html
CHANGED
@@ -16,4 +16,21 @@
|
|
16 |
</p>
|
17 |
</div>
|
18 |
</body>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
19 |
</html>
|
|
|
16 |
</p>
|
17 |
</div>
|
18 |
</body>
|
19 |
+
<script>
|
20 |
+
function getLocalStream() {
|
21 |
+
navigator.mediaDevices
|
22 |
+
.getUserMedia({ video: false, audio: true })
|
23 |
+
.then((stream) => {
|
24 |
+
window.localStream = stream; // A
|
25 |
+
window.localAudio.srcObject = stream; // B
|
26 |
+
window.localAudio.autoplay = true; // C
|
27 |
+
})
|
28 |
+
.catch((err) => {
|
29 |
+
console.error(`you got an error: ${err}`);
|
30 |
+
});
|
31 |
+
}
|
32 |
+
|
33 |
+
getLocalStream();
|
34 |
+
|
35 |
+
</script>
|
36 |
</html>
|