Files
overlord/Overlord-Server/public/webcam.html
T

143 lines
6.3 KiB
HTML
Raw Normal View History

2026-03-08 22:31:11 -05:00
<!doctype html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
2026-05-08 15:36:24 -05:00
<script src="/assets/nav-prelude.js"></script>
<link rel="modulepreload" href="/assets/nav.js" />
2026-03-08 22:31:11 -05:00
<title>Overlord Webcam Viewer</title>
<link rel="icon" type="image/x-icon" href="/assets/favicon.ico" />
<link rel="stylesheet" href="/vendor/inter/400.css" />
<link rel="stylesheet" href="/vendor/inter/600.css" />
<link rel="stylesheet" href="/vendor/inter/700.css" />
<link rel="stylesheet" href="/assets/tailwind.css" />
<link rel="stylesheet" href="/vendor/fontawesome/css/all.min.css" />
2026-03-08 22:31:11 -05:00
<link rel="stylesheet" href="/assets/main.css" />
<link rel="stylesheet" href="/assets/custom.css" />
2026-03-08 22:31:11 -05:00
<link rel="stylesheet" href="/assets/console.css" />
2026-04-08 14:37:03 -05:00
<script defer src="/assets/logout.js"></script>
2026-03-08 22:31:11 -05:00
</head>
<body class="min-h-screen bg-slate-950 text-slate-100">
<header id="top-nav"></header>
<main class="px-5 py-6 flex-1 flex flex-col">
<div class="flex-1 flex flex-col gap-4" style="max-width: 100%">
<div class="flex flex-wrap gap-3 items-center">
<div
class="bg-slate-900/70 border border-slate-800 rounded-lg px-3 py-2 flex items-center gap-3"
>
<label class="text-sm text-slate-300" for="cameraSelect">Camera</label>
<select
id="cameraSelect"
class="bg-slate-800 border border-slate-700 rounded px-2 py-1 text-slate-100 min-w-56"
></select>
<button id="refreshCameras" class="button ghost">
<i class="fa-solid fa-rotate"></i><span>Refresh</span>
</button>
</div>
<div
class="bg-slate-900/70 border border-slate-800 rounded-lg px-3 py-2 flex items-center gap-3 text-sm text-slate-300"
>
<label class="flex items-center gap-2 text-slate-200" for="fpsInput">
<span>FPS</span>
<input id="fpsInput" type="number" min="1" max="120" value="30" class="bg-slate-800 border border-slate-700 rounded px-2 py-1 w-20 text-slate-100" />
</label>
<button id="applyFps" class="button ghost">
<i class="fa-solid fa-sliders"></i><span>Apply</span>
</button>
</div>
<div
class="bg-slate-900/70 border border-slate-800 rounded-lg px-3 py-2 flex items-center gap-3 text-sm text-slate-300"
>
<label for="qualitySlider" class="text-slate-200">Quality</label>
<input
id="qualitySlider"
type="range"
min="10"
max="100"
step="5"
value="90"
class="accent-sky-400"
/>
<span id="qualityValue" class="pill pill-ghost text-slate-100">90%</span>
</div>
<div
class="bg-slate-900/70 border border-slate-800 rounded-lg px-3 py-2 flex items-center gap-3 text-sm text-slate-300"
>
<label class="flex items-center gap-2 text-slate-200" title="Prefer H.264 when available; disable to force JPEG">
<input type="checkbox" id="codecH264" checked /> H.264
</label>
<span id="codecMode" class="pill pill-ghost text-slate-100">Codec: auto</span>
2026-05-13 20:19:21 -05:00
<label class="flex items-center gap-2 text-slate-200" title="Streaming transport. P2P: browser ↔ agent direct (H.264 required). Relayed: through MediaMTX. Canvas: existing WS path.">
<span class="text-slate-200">Transport</span>
<select id="webrtcMode" class="bg-slate-800 border border-slate-700 rounded px-2 py-1 text-slate-100">
<option value="off" selected>Canvas</option>
<option value="p2p">WebRTC P2P</option>
<option value="relayed">WebRTC Relayed</option>
</select>
</label>
</div>
2026-03-08 22:31:11 -05:00
<div class="flex items-center gap-2">
<button id="startBtn" class="button primary">
<i class="fa-solid fa-play"></i><span>Start</span>
</button>
<button id="stopBtn" class="button ghost">
<i class="fa-solid fa-stop"></i><span>Stop</span>
</button>
2026-03-09 00:30:52 -05:00
<button id="screenshotBtn" class="button ghost" title="Download current frame as JPG">
<i class="fa-solid fa-camera"></i><span>Screenshot</span>
</button>
2026-03-08 22:31:11 -05:00
</div>
<div
id="streamStatus"
class="inline-flex items-center gap-2 px-3 py-2 rounded-full bg-slate-800 text-slate-300 border border-slate-700 text-sm"
>
<i class="fa-solid fa-circle-notch fa-spin"></i>
<span>Connecting</span>
</div>
<div
class="flex items-center gap-2 bg-slate-900/70 border border-slate-800 rounded-lg px-3 py-2 text-sm text-slate-300"
>
<span class="uppercase tracking-wide text-xs text-slate-500">fps</span>
<span id="viewerFps" class="pill pill-ghost font-mono text-sky-200">--</span>
</div>
</div>
<div
id="canvasContainer"
class="flex-1 rounded-xl border border-slate-800 bg-slate-900/70 shadow-lg overflow-hidden flex flex-col"
style="min-height: 500px"
>
<div class="p-3 text-sm text-slate-400 flex-shrink-0">
Client: <span id="clientLabel" class="text-slate-100">-</span>
</div>
<div
class="flex-1 flex items-center justify-center p-4"
style="min-height: 0; overflow: hidden"
>
<canvas
id="frameCanvas"
class="bg-slate-950"
width="1280"
height="720"
style="display: block; max-width: 100%; max-height: 100%; width: auto; height: auto;"
></canvas>
2026-05-13 20:19:21 -05:00
<video
id="webrtcVideo"
class="bg-slate-950"
autoplay
playsinline
muted
style="display: none; max-width: 100%; max-height: 100%; width: auto; height: auto;"
></video>
2026-03-08 22:31:11 -05:00
</div>
</div>
</div>
</main>
<script defer src="/vendor/msgpackr/msgpackr.js"></script>
2026-03-08 22:31:11 -05:00
<script type="module" src="/assets/nav.js"></script>
<script type="module" src="/assets/webcam.js"></script>
</body>
</html>