Spaces:
Running
Running
Update index.html
Browse files- index.html +21 -17
index.html
CHANGED
|
@@ -1,19 +1,23 @@
|
|
| 1 |
-
<!
|
| 2 |
<html>
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 19 |
</html>
|
|
|
|
| 1 |
+
<!DOCTYPE html>
|
| 2 |
<html>
|
| 3 |
+
<head>
|
| 4 |
+
<title>Video Call</title>
|
| 5 |
+
<script src="https://webrtc.github.io/adapter/adapter-latest.js"></script>
|
| 6 |
+
</head>
|
| 7 |
+
<body>
|
| 8 |
+
<h1>Video Call Room</h1>
|
| 9 |
+
<video id="localVideo" autoplay playsinline></video>
|
| 10 |
+
<video id="remoteVideo" autoplay playsinline></video>
|
| 11 |
+
<script>
|
| 12 |
+
// WebRTC connection setup
|
| 13 |
+
const localVideo = document.getElementById('localVideo');
|
| 14 |
+
const remoteVideo = document.getElementById('remoteVideo');
|
| 15 |
+
const constraints = { video: true, audio: true };
|
| 16 |
+
|
| 17 |
+
navigator.mediaDevices.getUserMedia(constraints).then(stream => {
|
| 18 |
+
localVideo.srcObject = stream;
|
| 19 |
+
// Handle further signaling and P2P connection logic here
|
| 20 |
+
}).catch(error => console.error(error));
|
| 21 |
+
</script>
|
| 22 |
+
</body>
|
| 23 |
</html>
|