before its fucked again
This commit is contained in:
@@ -7,45 +7,77 @@
|
||||
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;600;800&display=swap" rel="stylesheet">
|
||||
<style>
|
||||
:root {
|
||||
--bg-color: #0f172a;
|
||||
--text-primary: #f8fafc;
|
||||
--text-secondary: #94a3b8;
|
||||
--accent-color: #3b82f6;
|
||||
--glass-bg: rgba(30, 41, 59, 0.7);
|
||||
--glass-border: rgba(255, 255, 255, 0.1);
|
||||
--bg-color: #000000;
|
||||
--text-primary: #ffffff;
|
||||
--text-secondary: #aaaaaa;
|
||||
--accent-color: #555555;
|
||||
--glass-bg: #111111;
|
||||
--glass-border: #333333;
|
||||
}
|
||||
body {
|
||||
font-family: 'Inter', sans-serif;
|
||||
background-color: var(--bg-color);
|
||||
color: var(--text-primary);
|
||||
margin: 0;
|
||||
padding: 2rem;
|
||||
height: 100vh;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
overflow: hidden; /* Prevent body scroll */
|
||||
}
|
||||
.header {
|
||||
padding: 1.5rem 2rem 0.5rem 2rem;
|
||||
}
|
||||
h1 { margin: 0; font-size: 1.8rem; }
|
||||
|
||||
.main-content {
|
||||
display: flex;
|
||||
flex: 1;
|
||||
padding: 1rem 2rem 2rem 2rem;
|
||||
gap: 2rem;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.controls {
|
||||
flex: 0 0 350px;
|
||||
background: var(--glass-bg);
|
||||
border: 1px solid var(--glass-border);
|
||||
padding: 1.5rem;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.preview-container {
|
||||
flex: 1;
|
||||
background: var(--glass-bg);
|
||||
border: 1px solid var(--glass-border);
|
||||
padding: 1.5rem;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
}
|
||||
h1 { margin-top: 0; }
|
||||
.controls {
|
||||
background: var(--glass-bg);
|
||||
border: 1px solid var(--glass-border);
|
||||
border-radius: 12px;
|
||||
padding: 2rem;
|
||||
|
||||
.preview-header {
|
||||
width: 100%;
|
||||
max-width: 600px;
|
||||
text-align: center;
|
||||
margin-bottom: 2rem;
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
|
||||
.preview-header h3 {
|
||||
margin: 0;
|
||||
color: var(--text-primary);
|
||||
}
|
||||
|
||||
input, button, select {
|
||||
font-family: inherit;
|
||||
padding: 0.8rem 1rem;
|
||||
border-radius: 8px;
|
||||
border: 1px solid var(--glass-border);
|
||||
margin-bottom: 1rem;
|
||||
width: 90%;
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
font-size: 1rem;
|
||||
}
|
||||
input, select {
|
||||
background: rgba(0,0,0,0.2);
|
||||
background: rgba(0,0,0,0.5);
|
||||
color: white;
|
||||
outline: none;
|
||||
}
|
||||
@@ -57,120 +89,219 @@
|
||||
border: none;
|
||||
transition: all 0.2s;
|
||||
}
|
||||
button:hover { background: #2563eb; transform: translateY(-2px); }
|
||||
button:disabled { background: #475569; cursor: not-allowed; transform: none; }
|
||||
button:hover { background: #777777; transform: translateY(-2px); }
|
||||
button:disabled { background: #333333; cursor: not-allowed; transform: none; }
|
||||
|
||||
.video-wrapper {
|
||||
flex: 1;
|
||||
width: 100%;
|
||||
background: #000;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
overflow: hidden;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
video {
|
||||
width: 100%;
|
||||
max-width: 800px;
|
||||
border-radius: 12px;
|
||||
background: #000;
|
||||
height: 100%;
|
||||
object-fit: contain;
|
||||
display: none;
|
||||
}
|
||||
.status { color: var(--text-secondary); margin-bottom: 1rem; }
|
||||
|
||||
.video-placeholder {
|
||||
color: var(--text-secondary);
|
||||
text-align: center;
|
||||
position: absolute;
|
||||
}
|
||||
|
||||
.status { color: var(--text-secondary); margin-bottom: 1rem; text-align: center; }
|
||||
|
||||
.label {
|
||||
display: block;
|
||||
text-align: left;
|
||||
width: 90%;
|
||||
margin: 0 auto 0.5rem auto;
|
||||
margin: 0 0 0.5rem 0;
|
||||
color: var(--text-secondary);
|
||||
font-size: 0.9rem;
|
||||
}
|
||||
|
||||
.section-header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
margin: 1.5rem 0 1rem 0;
|
||||
}
|
||||
.section-header h3 { margin: 0; font-size: 1.1rem; }
|
||||
.section-header button { width: auto; margin: 0; padding: 0.4rem 0.8rem; font-size: 0.85rem;}
|
||||
|
||||
/* Source Grid */
|
||||
.sources-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
|
||||
gap: 15px;
|
||||
width: 90%;
|
||||
grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
|
||||
gap: 10px;
|
||||
max-height: 250px;
|
||||
overflow-y: auto;
|
||||
margin: 0 auto 1.5rem auto;
|
||||
margin: 0 0 1.5rem 0;
|
||||
padding: 10px;
|
||||
background: rgba(0,0,0,0.2);
|
||||
border-radius: 8px;
|
||||
background: rgba(0,0,0,0.5);
|
||||
border: 1px solid var(--glass-border);
|
||||
}
|
||||
|
||||
/* Single Item Override */
|
||||
.sources-grid.single-item {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
.sources-grid.single-item .source-item {
|
||||
width: 250px;
|
||||
min-width: 250px;
|
||||
flex-shrink: 0;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.source-item {
|
||||
cursor: pointer;
|
||||
border-radius: 6px;
|
||||
padding: 8px;
|
||||
background: rgba(255,255,255,0.05);
|
||||
transition: all 0.2s ease;
|
||||
text-align: center;
|
||||
border: 2px solid transparent;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
.source-item:hover {
|
||||
background: rgba(255,255,255,0.1);
|
||||
}
|
||||
.source-item.selected {
|
||||
background: rgba(59, 130, 246, 0.2);
|
||||
border-color: var(--accent-color);
|
||||
background: rgba(255, 255, 255, 0.2);
|
||||
border-color: var(--text-primary);
|
||||
}
|
||||
.source-item img {
|
||||
width: 100%;
|
||||
border-radius: 4px;
|
||||
margin-bottom: 8px;
|
||||
object-fit: cover;
|
||||
margin-bottom: 4px;
|
||||
object-fit: contain;
|
||||
aspect-ratio: 16/9;
|
||||
background: #000;
|
||||
}
|
||||
.source-item span {
|
||||
display: block;
|
||||
font-size: 0.85rem;
|
||||
font-size: 0.8rem;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
color: #e2e8f0;
|
||||
line-height: 1.2;
|
||||
padding-top: 4px;
|
||||
}
|
||||
|
||||
/* Stats Panel */
|
||||
.stats-panel {
|
||||
background: rgba(0,0,0,0.4);
|
||||
border-radius: 8px;
|
||||
background: rgba(0,0,0,0.7);
|
||||
padding: 1rem;
|
||||
width: 90%;
|
||||
margin: 1rem auto;
|
||||
margin-top: 1rem;
|
||||
text-align: left;
|
||||
display: none;
|
||||
font-family: monospace;
|
||||
font-size: 1.1rem;
|
||||
color: #10b981; /* green text */
|
||||
font-size: 0.95rem;
|
||||
color: #aaaaaa; /* grey text */
|
||||
}
|
||||
|
||||
/* Custom Scrollbar */
|
||||
::-webkit-scrollbar {
|
||||
width: 8px;
|
||||
height: 8px;
|
||||
}
|
||||
::-webkit-scrollbar-track {
|
||||
background: var(--glass-bg);
|
||||
border-left: 1px solid var(--glass-border);
|
||||
}
|
||||
::-webkit-scrollbar-thumb {
|
||||
background: var(--accent-color);
|
||||
}
|
||||
::-webkit-scrollbar-thumb:hover {
|
||||
background: #777777;
|
||||
}
|
||||
|
||||
/* Responsive Layout */
|
||||
@media (max-width: 900px) {
|
||||
body {
|
||||
overflow-y: auto;
|
||||
height: auto;
|
||||
}
|
||||
.main-content {
|
||||
flex-direction: column;
|
||||
overflow: visible;
|
||||
padding: 1rem;
|
||||
}
|
||||
.controls {
|
||||
flex: none;
|
||||
width: 100%;
|
||||
overflow: visible;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.preview-container {
|
||||
min-height: 400px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Broadcaster Client</h1>
|
||||
<div class="header">
|
||||
<h1>Broadcaster Client</h1>
|
||||
</div>
|
||||
|
||||
<div class="controls" id="controlsPanel">
|
||||
<label class="label">Server Connection</label>
|
||||
<input type="text" id="serverUrl" placeholder="Server URL (e.g. http://localhost:3000)" value="http://localhost:3000">
|
||||
<input type="password" id="serverPassword" placeholder="Stream Password">
|
||||
|
||||
<div style="display:flex; justify-content:space-between; align-items:center; width: 90%; margin: 10px auto;">
|
||||
<h3 style="margin:0;">Media Sources</h3>
|
||||
<button id="getSourcesBtn" style="width:auto; margin:0; padding: 0.4rem 0.8rem;">Refresh Devices</button>
|
||||
<div class="main-content">
|
||||
<!-- Left Column: Controls -->
|
||||
<div class="controls" id="controlsPanel">
|
||||
<label class="label">Server Connection</label>
|
||||
<input type="text" id="serverUrl" placeholder="URL (e.g. http://localhost:3000)" value="http://localhost:3000">
|
||||
<input type="password" id="serverPassword" placeholder="Stream Password">
|
||||
|
||||
<div class="section-header">
|
||||
<h3>Media Sources</h3>
|
||||
<button id="getSourcesBtn">Select new Source</button>
|
||||
</div>
|
||||
|
||||
<label class="label">Visual Source (Screen/Window)</label>
|
||||
<div id="sourcesGrid" class="sources-grid"></div>
|
||||
|
||||
<label class="label">Audio Source (Microphone/Virtual Sinks)</label>
|
||||
<select id="audioSelect"></select>
|
||||
|
||||
<div style="margin-top: auto;">
|
||||
<button id="startBtn" disabled style="margin-bottom: 0.5rem;">Start Broadcast</button>
|
||||
<div class="status" id="statusText">Not Broadcasting</div>
|
||||
<div class="status" id="viewerCount" style="display:none; font-weight: bold; color: var(--text-primary);">Viewers: 0</div>
|
||||
<button id="stopBtn" style="display:none; background:#444444; margin-bottom: 0.5rem;">Stop Broadcast</button>
|
||||
</div>
|
||||
|
||||
<div class="stats-panel" id="statsPanel">
|
||||
<div><strong>Res:</strong> <span id="statsRes">0x0</span></div>
|
||||
<div><strong>FPS:</strong> <span id="statsFps">0</span></div>
|
||||
<div><strong>Up:</strong> <span id="statsBitrate">0 kbps</span></div>
|
||||
<div><strong>V-Codec:</strong> <span id="statsVideoCodec">...</span></div>
|
||||
<div><strong>A-Codec:</strong> <span id="statsAudioCodec">...</span></div>
|
||||
|
||||
<div style="margin-top: 10px; height: 100px;">
|
||||
<canvas id="bitrateChart"></canvas>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<label class="label">Visual Source (Screen/Window)</label>
|
||||
<div id="sourcesGrid" class="sources-grid"></div>
|
||||
|
||||
<label class="label">Audio Source (Microphone/Pipewire Virtual Sinks)</label>
|
||||
<select id="audioSelect"></select>
|
||||
|
||||
<button id="startBtn" disabled style="margin-top: 1.5rem;">Start Broadcast</button>
|
||||
<div class="status" id="statusText">Not Broadcasting</div>
|
||||
<button id="stopBtn" style="display:none; background:#ef4444;">Stop Broadcast</button>
|
||||
|
||||
<div class="stats-panel" id="statsPanel">
|
||||
<div><strong>Resolution:</strong> <span id="statsRes">0x0</span></div>
|
||||
<div><strong>FPS:</strong> <span id="statsFps">0</span></div>
|
||||
<div><strong>Upstream:</strong> <span id="statsBitrate">0 kbps</span></div>
|
||||
<!-- Right Column: Big Preview -->
|
||||
<div class="preview-container">
|
||||
<div class="preview-header">
|
||||
</div>
|
||||
<div class="video-wrapper">
|
||||
<div id="videoPlaceholder" class="video-placeholder"></div>
|
||||
<video id="localVideo" autoplay playsinline muted></video>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<video id="localVideo" autoplay playsinline muted></video>
|
||||
|
||||
<!-- Use socket.io client script locally installed via npm -->
|
||||
<script src="./node_modules/socket.io-client/dist/socket.io.js"></script>
|
||||
<script src="./node_modules/chart.js/dist/chart.umd.js"></script>
|
||||
<script src="renderer.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user