319 lines
7.8 KiB
HTML
319 lines
7.8 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8" />
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
|
|
<title>Strandcast</title>
|
|
<style>
|
|
/* --- RESET & BASICS --- */
|
|
* {
|
|
box-sizing: border-box;
|
|
margin: 0;
|
|
padding: 0;
|
|
}
|
|
|
|
body {
|
|
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
|
|
background: #0a0a0a;
|
|
color: #eee;
|
|
text-align: center;
|
|
min-height: 100vh;
|
|
display: flex;
|
|
flex-direction: column;
|
|
}
|
|
|
|
/* --- NAVIGATION BAR --- */
|
|
.navbar {
|
|
background-color: #111;
|
|
border-bottom: 1px solid #333;
|
|
padding: 15px 20px;
|
|
display: flex;
|
|
justify-content: space-between;
|
|
align-items: center;
|
|
}
|
|
|
|
.navbar .brand {
|
|
color: #00d2ff;
|
|
font-size: 18px;
|
|
font-weight: bold;
|
|
text-decoration: none;
|
|
}
|
|
|
|
.nav-links a {
|
|
color: #888;
|
|
text-decoration: none;
|
|
margin-left: 20px;
|
|
font-size: 14px;
|
|
padding: 5px;
|
|
}
|
|
|
|
.nav-links a:hover {
|
|
color: #fff;
|
|
}
|
|
|
|
.nav-links a.active {
|
|
color: #fff;
|
|
font-weight: bold;
|
|
border-bottom: 2px solid #00d2ff;
|
|
}
|
|
|
|
/* --- LAYOUT CONTAINERS --- */
|
|
.container {
|
|
flex: 1;
|
|
display: flex;
|
|
flex-direction: column;
|
|
align-items: center;
|
|
padding: 20px;
|
|
width: 100%;
|
|
}
|
|
|
|
h1 {
|
|
margin-bottom: 20px;
|
|
font-weight: 300;
|
|
font-size: 24px;
|
|
}
|
|
|
|
/* --- LOBBY STYLES --- */
|
|
#lobby-view {
|
|
width: 100%;
|
|
max-width: 500px;
|
|
}
|
|
|
|
.card {
|
|
background: #161616;
|
|
border: 1px solid #333;
|
|
border-radius: 12px;
|
|
padding: 20px;
|
|
box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
|
|
margin-bottom: 20px;
|
|
}
|
|
|
|
/* Stream List */
|
|
ul {
|
|
list-style: none;
|
|
padding: 0;
|
|
}
|
|
|
|
li {
|
|
background: #222;
|
|
margin: 8px 0;
|
|
padding: 15px;
|
|
border-radius: 8px;
|
|
/* Softer corners for mobile */
|
|
cursor: pointer;
|
|
border: 1px solid #333;
|
|
text-align: left;
|
|
display: flex;
|
|
justify-content: space-between;
|
|
align-items: center;
|
|
/* Make tap target easier */
|
|
min-height: 50px;
|
|
}
|
|
|
|
li:active {
|
|
background: #333;
|
|
transform: scale(0.98);
|
|
}
|
|
|
|
/* Inputs - 16px font prevents iOS zoom */
|
|
input[type='text'] {
|
|
width: 100%;
|
|
padding: 12px;
|
|
background: #000;
|
|
border: 1px solid #444;
|
|
color: white;
|
|
border-radius: 6px;
|
|
margin-bottom: 15px;
|
|
outline: none;
|
|
font-size: 16px;
|
|
}
|
|
|
|
input[type='file'] {
|
|
width: 100%;
|
|
padding: 10px;
|
|
background: #222;
|
|
color: #ccc;
|
|
border-radius: 6px;
|
|
margin-bottom: 15px;
|
|
border: 1px solid #333;
|
|
font-size: 14px;
|
|
}
|
|
|
|
button {
|
|
width: 100%;
|
|
padding: 14px;
|
|
/* Larger tap area */
|
|
cursor: pointer;
|
|
background: linear-gradient(135deg, #007bff, #0056b3);
|
|
color: white;
|
|
border: none;
|
|
border-radius: 8px;
|
|
font-weight: bold;
|
|
font-size: 16px;
|
|
/* Prevent sticky hover on mobile */
|
|
-webkit-tap-highlight-color: transparent;
|
|
}
|
|
|
|
button:active {
|
|
opacity: 0.8;
|
|
transform: scale(0.98);
|
|
}
|
|
|
|
button.leave-btn {
|
|
background: #d32f2f;
|
|
margin-top: 20px;
|
|
width: 100%;
|
|
}
|
|
|
|
/* --- STREAM VIEW --- */
|
|
#stream-view {
|
|
display: none;
|
|
width: 100%;
|
|
}
|
|
|
|
video {
|
|
width: 100%;
|
|
/* Maintain aspect ratio */
|
|
aspect-ratio: 16 / 9;
|
|
background: #000;
|
|
border-radius: 8px;
|
|
margin: 10px 0;
|
|
}
|
|
|
|
#status {
|
|
color: #00d2ff;
|
|
margin-top: 10px;
|
|
font-family: monospace;
|
|
background: #111;
|
|
display: inline-block;
|
|
padding: 8px 20px;
|
|
border-radius: 20px;
|
|
border: 1px solid #333;
|
|
font-size: 14px;
|
|
}
|
|
|
|
/* --- DEBUG METRICS --- */
|
|
#debug-metrics {
|
|
margin-top: 14px;
|
|
width: 100%;
|
|
display: grid;
|
|
grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
|
|
gap: 12px;
|
|
}
|
|
|
|
.metrics-card {
|
|
background: #111;
|
|
border: 1px solid #222;
|
|
border-radius: 10px;
|
|
padding: 12px 14px;
|
|
text-align: left;
|
|
font-family: monospace;
|
|
}
|
|
|
|
.metrics-title {
|
|
color: #00d2ff;
|
|
font-size: 12px;
|
|
text-transform: uppercase;
|
|
letter-spacing: 1px;
|
|
margin-bottom: 8px;
|
|
}
|
|
|
|
.metrics-line {
|
|
display: flex;
|
|
justify-content: space-between;
|
|
color: #ccc;
|
|
font-size: 12px;
|
|
margin: 4px 0;
|
|
}
|
|
|
|
.metrics-note {
|
|
color: #777;
|
|
font-size: 12px;
|
|
}
|
|
|
|
/* --- MOBILE MEDIA QUERY --- */
|
|
@media (max-width: 600px) {
|
|
.navbar {
|
|
flex-direction: column;
|
|
padding: 10px;
|
|
}
|
|
|
|
.navbar .brand {
|
|
margin-bottom: 10px;
|
|
}
|
|
|
|
.nav-links a {
|
|
margin: 0 10px;
|
|
}
|
|
|
|
.container {
|
|
padding: 10px;
|
|
}
|
|
|
|
.card {
|
|
padding: 15px;
|
|
}
|
|
|
|
h1 {
|
|
font-size: 20px;
|
|
}
|
|
}
|
|
</style>
|
|
</head>
|
|
|
|
<body>
|
|
<nav class="navbar">
|
|
<a href="/" class="brand">Strandcast</a>
|
|
<div class="nav-links">
|
|
<a href="/" class="active">Streams</a>
|
|
<a href="/monitor.html">Monitor</a>
|
|
</div>
|
|
</nav>
|
|
<div class="container">
|
|
<div id="lobby-view">
|
|
<h1>Join a Broadcast</h1>
|
|
<div class="card">
|
|
<h3 style="margin-bottom: 15px; color: #aaa; font-size: 12px; text-transform: uppercase; letter-spacing: 1px">
|
|
Active Streams
|
|
</h3>
|
|
<ul id="streamList">
|
|
<li style="color: #777; cursor: default; background: transparent; border: none; justify-content: center">
|
|
Searching...
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
<div class="card">
|
|
<h3 style="margin-bottom: 15px; color: #aaa; font-size: 12px; text-transform: uppercase; letter-spacing: 1px">
|
|
Go Live
|
|
</h3>
|
|
<input type="text" id="streamNameInput" placeholder="Stream Name" />
|
|
<div style="text-align: left; margin-bottom: 8px">
|
|
<label style="color: #666; font-size: 11px; font-weight: bold">SOURCE (OPTIONAL):</label>
|
|
</div>
|
|
<input type="file" id="videoFileInput" accept="video/*" />
|
|
<button onclick="startStream()">Start Broadcasting</button>
|
|
</div>
|
|
</div>
|
|
<div id="stream-view">
|
|
<h2 id="currentStreamTitle" style="color: #fff; margin-bottom: 10px; font-size: 18px">Stream Name</h2>
|
|
<video id="localVideo" autoplay muted playsinline></video>
|
|
<video id="remoteVideo" autoplay playsinline></video>
|
|
<div id="status">Status: Connecting...</div>
|
|
<div id="debug-metrics">
|
|
<div class="metrics-card">
|
|
<div class="metrics-title">Inbound (from upstream)</div>
|
|
<div id="upstreamMetrics" class="metrics-body metrics-note">Waiting for data...</div>
|
|
</div>
|
|
<div class="metrics-card">
|
|
<div class="metrics-title">Outbound (to downstream)</div>
|
|
<div id="downstreamMetrics" class="metrics-body metrics-note">Waiting for data...</div>
|
|
</div>
|
|
</div>
|
|
<button onclick="leaveStream()" class="leave-btn">Leave Stream</button>
|
|
</div>
|
|
</div>
|
|
<script src="/socket.io/socket.io.js"></script>
|
|
<script src="client.js"></script>
|
|
</body>
|
|
</html>
|