Files
WebRTC-Broadcast/public/subscriber.html
2025-09-05 00:36:54 -04:00

124 lines
3.4 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Subscriber - WebRTC Broadcast</title>
<style>
body {
font-family: Arial, sans-serif;
max-width: 800px;
margin: 0 auto;
padding: 20px;
background-color: #f5f5f5;
}
.container {
background: white;
padding: 30px;
border-radius: 10px;
box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}
h1 {
color: #333;
text-align: center;
margin-bottom: 30px;
}
.controls {
display: flex;
gap: 10px;
justify-content: center;
margin-bottom: 20px;
}
button {
padding: 12px 24px;
font-size: 16px;
border: none;
border-radius: 5px;
cursor: pointer;
transition: background-color 0.3s;
}
.connect-btn {
background-color: #2196F3;
color: white;
}
.connect-btn:hover {
background-color: #1976D2;
}
.disconnect-btn {
background-color: #f44336;
color: white;
}
.disconnect-btn:hover {
background-color: #da190b;
}
.disconnect-btn:disabled, .connect-btn:disabled {
opacity: 0.6;
cursor: not-allowed;
}
video {
width: 100%;
max-width: 640px;
height: auto;
border: 2px solid #ddd;
border-radius: 5px;
display: block;
margin: 0 auto;
background-color: #000;
}
.status {
text-align: center;
margin: 20px 0;
padding: 10px;
border-radius: 5px;
}
.status.connected {
background-color: #d4edda;
color: #155724;
border: 1px solid #c3e6cb;
}
.status.disconnected {
background-color: #f8d7da;
color: #721c24;
border: 1px solid #f5c6cb;
}
.status.waiting {
background-color: #fff3cd;
color: #856404;
border: 1px solid #ffeaa7;
}
.video-placeholder {
width: 100%;
max-width: 640px;
height: 360px;
background-color: #f0f0f0;
border: 2px dashed #ccc;
display: flex;
align-items: center;
justify-content: center;
margin: 0 auto;
color: #666;
font-size: 18px;
border-radius: 5px;
}
</style>
</head>
<body>
<div class="container">
<h1>Subscriber Interface</h1>
<div class="status" id="status">Disconnected</div>
<div class="controls">
<button id="connectBtn" class="connect-btn">Connect to Stream</button>
<button id="disconnectBtn" class="disconnect-btn" disabled>Disconnect</button>
</div>
<video id="remoteVideo" autoplay playsinline style="display: none;"></video>
<div id="videoPlaceholder" class="video-placeholder">
Waiting for stream...
</div>
</div>
<script type="module" src="./js/subscriber.ts"></script>
</body>
</html>