-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
86 lines (70 loc) · 2.72 KB
/
index.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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="style.css">
<script src="https://webrtc.github.io/adapter/adapter-latest.js"></script>
<script src="https://cdn.scaledrone.com/scaledrone.min.js"></script>
<title>Video Chat</title>
</head>
<body>
<div class="container">
<div class="video-container">
<video id="remoteVideo" autoplay playsinline></video>
<div id="local-video-container">
<video id="localVideo" autoplay muted playsinline></video>
<div id="video-control">
<img id="switch-camera" class="video-control-button" src="images/camera-switch.png" alt="Switch Camera" onclick="switchCamera()">
<img id="mute-switch" class="video-control-button" src="images/mic.png" alt="Mute" onclick="toggleMute()">
</div>
</div>
</div>
<div class="message-container">
<!-- Add this code inside the message-container div, right after the opening tag -->
<div class="language-selection">
<label for="language"> Chat Language:</label>
<select id="language">
<option value="en" selected>English</option>
<option value="hi">Hindi</option>
<option value="es">Spanish</option>
<option value="fr">French</option>
<option value="uk">Ukraninan</option>
<option value="ru">Russian</option>
<!-- Add more languages as needed -->
</select>
</div>
<form id="message-form">
<input type="text" id="message-input" placeholder="Type your message" />
<button type="submit">Send</button>
</form>
<div id="messages"></div>
</div>
</div>
<!-- <br><br><br>
<h3>Made By Koustubh Sahu</h3> -->
<script>
function adjustVideoSize() {
const remoteVideo = document.querySelector('#remoteVideo');
const localVideo = document.querySelector('#localVideo');
if (remoteVideo.videoWidth > remoteVideo.videoHeight) {
remoteVideo.classList.add('full-height');
} else {
remoteVideo.classList.remove('full-height');
}
if (localVideo.videoWidth > localVideo.videoHeight) {
localVideo.classList.add('full-height');
} else {
localVideo.classList.remove('full-height');
}
}
document.addEventListener('DOMContentLoaded', () => {
const remoteVideo = document.querySelector('#remoteVideo');
const localVideo = document.querySelector('#localVideo');
remoteVideo.addEventListener('loadedmetadata', adjustVideoSize);
localVideo.addEventListener('loadedmetadata', adjustVideoSize);
});
</script>
<script src="server.js"></script>
</body>
</html>