makinuh commited on
Commit
6f26d39
·
verified ·
1 Parent(s): fe9baf2

Create index.html

Browse files
Files changed (1) hide show
  1. index.html +17 -0
index.html ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <script>
2
+ // ... other JavaScript code
3
+ async function init() {
4
+ try {
5
+ localStream = await navigator.mediaDevices.getUserMedia({ video: true, audio: true });
6
+ localVideo.srcObject = localStream;
7
+ roomId = uuid.v4();
8
+ clientId = uuid.v4();
9
+ socket = new WebSocket(`ws://${window.location.host}/ws/${roomId}/${clientId}`); // Relative url.
10
+ // ... rest of the init function
11
+ }
12
+ catch(error) {
13
+ console.error('Initialization error:', error);
14
+ }
15
+ }
16
+ // ... rest of the JavaScript code
17
+ </script>