-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
57 lines (55 loc) · 2.67 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>WebRTC Video Streaming</title>
<script src="https://cdn.tailwindcss.com"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css">
<style>
body.dark .dark-mode-toggle {
display: none;
}
body:not(.dark) .light-mode-toggle {
display: none;
}
</style>
</head>
<body class="bg-gray-100 text-gray-900 dark:bg-gray-900 dark:text-gray-200">
<div class="container mx-auto p-4">
<h1 class="text-3xl font-bold text-center mb-6">WebRTC Video Streaming</h1>
<div class="flex flex-col md:flex-row justify-center mb-4 space-y-4 md:space-y-0 md:space-x-4">
<video id="localVideo" autoplay playsinline class="border rounded w-full md:w-1/2"></video>
<video id="remoteVideo" autoplay playsinline class="border rounded w-full md:w-1/2"></video>
</div>
<div class="flex flex-wrap justify-center gap-2 mb-6">
<button id="startButton" class="px-4 py-2 bg-blue-500 text-white rounded">Start</button>
<button id="callButton" class="px-4 py-2 bg-green-500 text-white rounded" disabled>Call</button>
<button id="hangupButton" class="px-4 py-2 bg-red-500 text-white rounded" disabled>Hang Up</button>
<button id="muteButton" class="px-4 py-2 bg-yellow-500 text-white rounded" disabled>Mute</button>
<button id="videoButton" class="px-4 py-2 bg-purple-500 text-white rounded" disabled>Toggle Video</button>
<button id="shareButton" class="px-4 py-2 bg-gray-500 text-white rounded" disabled>Share Screen</button>
</div>
<div class="flex justify-center">
<div class="w-full md:w-1/2 p-4 border rounded">
<div id="chatBox" class="overflow-y-auto h-64 mb-4 p-2 border rounded bg-gray-200 dark:bg-gray-800"></div>
<div class="flex">
<input type="text" id="chatInput" class="flex-grow p-2 border rounded" placeholder="Type a message...">
<button id="sendButton" class="px-4 py-2 bg-blue-500 text-white rounded ml-2">Send</button>
</div>
</div>
</div>
</div>
<script src="script.js"></script>
<script>
const darkModeToggle = document.querySelector('.dark-mode-toggle');
const lightModeToggle = document.querySelector('.light-mode-toggle');
darkModeToggle.addEventListener('click', () => {
document.documentElement.classList.add('dark');
});
lightModeToggle.addEventListener('click', () => {
document.documentElement.classList.remove('dark');
});
</script>
</body>
</html>