187 lines
5.4 KiB
HTML
187 lines
5.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>SFU Publisher - WebRTC Broadcast</title>
|
|
<style>
|
|
body {
|
|
font-family: Arial, sans-serif;
|
|
max-width: 900px;
|
|
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);
|
|
}
|
|
.sfu-badge {
|
|
background: linear-gradient(45deg, #2196F3, #21CBF3);
|
|
color: white;
|
|
padding: 5px 15px;
|
|
border-radius: 20px;
|
|
font-size: 12px;
|
|
font-weight: bold;
|
|
display: inline-block;
|
|
margin-bottom: 10px;
|
|
}
|
|
h1 {
|
|
color: #333;
|
|
text-align: center;
|
|
margin-bottom: 10px;
|
|
}
|
|
.subtitle {
|
|
text-align: center;
|
|
color: #666;
|
|
margin-bottom: 30px;
|
|
font-style: italic;
|
|
}
|
|
.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: all 0.3s;
|
|
}
|
|
.start-btn {
|
|
background-color: #4CAF50;
|
|
color: white;
|
|
}
|
|
.start-btn:hover:not(:disabled) {
|
|
background-color: #45a049;
|
|
transform: translateY(-2px);
|
|
}
|
|
.stop-btn {
|
|
background-color: #f44336;
|
|
color: white;
|
|
}
|
|
.stop-btn:hover:not(:disabled) {
|
|
background-color: #da190b;
|
|
transform: translateY(-2px);
|
|
}
|
|
.stop-btn:disabled, .start-btn:disabled {
|
|
opacity: 0.6;
|
|
cursor: not-allowed;
|
|
transform: none;
|
|
}
|
|
video {
|
|
width: 100%;
|
|
max-width: 640px;
|
|
height: auto;
|
|
border: 2px solid #ddd;
|
|
border-radius: 8px;
|
|
display: block;
|
|
margin: 0 auto;
|
|
box-shadow: 0 4px 8px rgba(0,0,0,0.1);
|
|
}
|
|
.status {
|
|
text-align: center;
|
|
margin: 20px 0;
|
|
padding: 15px;
|
|
border-radius: 8px;
|
|
font-weight: 500;
|
|
}
|
|
.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;
|
|
}
|
|
.stats {
|
|
display: flex;
|
|
justify-content: space-around;
|
|
margin: 20px 0;
|
|
}
|
|
.stat-item {
|
|
text-align: center;
|
|
padding: 10px;
|
|
}
|
|
.stat-value {
|
|
font-size: 24px;
|
|
font-weight: bold;
|
|
color: #2196F3;
|
|
}
|
|
.stat-label {
|
|
font-size: 12px;
|
|
color: #666;
|
|
text-transform: uppercase;
|
|
}
|
|
.sfu-benefits {
|
|
background: #e3f2fd;
|
|
padding: 15px;
|
|
border-radius: 8px;
|
|
margin-top: 20px;
|
|
border-left: 4px solid #2196F3;
|
|
}
|
|
.sfu-benefits h3 {
|
|
margin-top: 0;
|
|
color: #1976d2;
|
|
}
|
|
.sfu-benefits ul {
|
|
margin: 10px 0;
|
|
}
|
|
.sfu-benefits li {
|
|
color: #333;
|
|
margin: 5px 0;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<div class="container">
|
|
<div class="sfu-badge">SFU ARCHITECTURE</div>
|
|
<h1>Publisher Interface</h1>
|
|
<div class="subtitle">Selective Forwarding Unit - Scalable Broadcasting</div>
|
|
|
|
<div class="status" id="status">Disconnected</div>
|
|
|
|
<div class="stats">
|
|
<div class="stat-item">
|
|
<div class="stat-value" id="subscribersCount">0</div>
|
|
<div class="stat-label">Subscribers</div>
|
|
</div>
|
|
<div class="stat-item">
|
|
<div class="stat-value" id="producersCount">0</div>
|
|
<div class="stat-label">Streams</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="controls">
|
|
<button id="startBtn" class="start-btn">Start Broadcasting</button>
|
|
<button id="stopBtn" class="stop-btn" disabled>Stop Broadcasting</button>
|
|
</div>
|
|
|
|
<video id="localVideo" autoplay muted playsinline></video>
|
|
|
|
<div class="sfu-benefits">
|
|
<h3>🚀 SFU Benefits</h3>
|
|
<ul>
|
|
<li><strong>Scalable:</strong> Your bandwidth stays constant regardless of subscriber count</li>
|
|
<li><strong>Efficient:</strong> Server handles stream distribution and optimization</li>
|
|
<li><strong>Reliable:</strong> Server manages connection quality and recovery</li>
|
|
<li><strong>Adaptive:</strong> Automatic bitrate adjustment for different devices</li>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
|
|
<script type="module" src="./js/sfu-publisher-simple.ts"></script>
|
|
</body>
|
|
</html> |