File size: 755 Bytes
5ef1470
d3922d2
5ef1470
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
d3922d2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<!DOCTYPE html>
<html>
<head>
  <title>Video Call</title>
  <script src="https://webrtc.github.io/adapter/adapter-latest.js"></script>
</head>
<body>
  <h1>Video Call Room</h1>
  <video id="localVideo" autoplay playsinline></video>
  <video id="remoteVideo" autoplay playsinline></video>
  <script>
    // WebRTC connection setup
    const localVideo = document.getElementById('localVideo');
    const remoteVideo = document.getElementById('remoteVideo');
    const constraints = { video: true, audio: true };

    navigator.mediaDevices.getUserMedia(constraints).then(stream => {
      localVideo.srcObject = stream;
      // Handle further signaling and P2P connection logic here
    }).catch(error => console.error(error));
  </script>
</body>
</html>