142 lines
2.5 KiB
HTML
142 lines
2.5 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<title>Live Stream Platform</title>
|
|
<style>
|
|
body {
|
|
font-family: 'Segoe UI', sans-serif;
|
|
margin: 0;
|
|
background: #f0f2f5;
|
|
}
|
|
|
|
/* Navbar */
|
|
nav {
|
|
background: #fff;
|
|
padding: 15px 20px;
|
|
display: flex;
|
|
justify-content: space-between;
|
|
align-items: center;
|
|
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
|
|
}
|
|
|
|
h1 {
|
|
margin: 0;
|
|
font-size: 1.2rem;
|
|
color: #333;
|
|
}
|
|
|
|
.btn-primary {
|
|
background: #0070f3;
|
|
color: white;
|
|
border: none;
|
|
padding: 10px 20px;
|
|
border-radius: 5px;
|
|
cursor: pointer;
|
|
font-weight: bold;
|
|
}
|
|
|
|
.btn-primary:hover {
|
|
background: #0051a2;
|
|
}
|
|
|
|
.btn-danger {
|
|
background: #e00;
|
|
color: white;
|
|
border: none;
|
|
padding: 10px 20px;
|
|
border-radius: 5px;
|
|
cursor: pointer;
|
|
}
|
|
|
|
/* Layout */
|
|
.container {
|
|
display: flex;
|
|
max-width: 1200px;
|
|
margin: 20px auto;
|
|
gap: 20px;
|
|
padding: 0 20px;
|
|
}
|
|
|
|
/* Sidebar (Stream List) */
|
|
.sidebar {
|
|
flex: 1;
|
|
background: white;
|
|
padding: 20px;
|
|
border-radius: 8px;
|
|
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
|
|
height: fit-content;
|
|
}
|
|
|
|
.stream-item {
|
|
display: flex;
|
|
justify-content: space-between;
|
|
padding: 10px;
|
|
border-bottom: 1px solid #eee;
|
|
align-items: center;
|
|
}
|
|
|
|
.stream-item button {
|
|
padding: 5px 15px;
|
|
cursor: pointer;
|
|
background: #eee;
|
|
border: none;
|
|
border-radius: 4px;
|
|
}
|
|
|
|
.stream-item button:hover {
|
|
background: #ddd;
|
|
}
|
|
|
|
/* Video Area */
|
|
.main-stage {
|
|
flex: 3;
|
|
background: #000;
|
|
border-radius: 8px;
|
|
overflow: hidden;
|
|
min-height: 480px;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
position: relative;
|
|
}
|
|
|
|
video {
|
|
width: 100%;
|
|
height: 100%;
|
|
object-fit: cover;
|
|
}
|
|
|
|
.placeholder {
|
|
color: #888;
|
|
font-size: 1.5rem;
|
|
}
|
|
|
|
.hidden {
|
|
display: none !important;
|
|
}
|
|
</style>
|
|
</head>
|
|
|
|
<body>
|
|
<nav>
|
|
<h1>WebRTC Live</h1>
|
|
<button id="goLiveBtn" class="btn-primary" onclick="promptForStream()">Start Streaming</button>
|
|
<button id="stopLiveBtn" class="btn-danger hidden" onclick="location.reload()">Stop Streaming</button>
|
|
</nav>
|
|
<div class="container">
|
|
<div class="sidebar">
|
|
<h3>Active Streams</h3>
|
|
<div id="streamList">Loading...</div>
|
|
</div>
|
|
<div class="main-stage">
|
|
<div id="videoPlaceholder" class="placeholder">Select a stream to watch</div>
|
|
<video id="videoDisplay" class="hidden" autoplay playsinline></video>
|
|
</div>
|
|
</div>
|
|
<script src="/socket.io/socket.io.js"></script>
|
|
<script src="client.js"></script>
|
|
</body>
|
|
|
|
</html> |