|
| 1 | +<!doctype html> |
| 2 | +<html lang="en"> |
| 3 | + <head> |
| 4 | + <meta charset="utf-8" /> |
| 5 | + <meta name="viewport" content="width=device-width, initial-scale=1" /> |
| 6 | + <title>Kit App Streaming - Web Client Launcher</title> |
| 7 | + <style> |
| 8 | + html, body { height: 100%; margin: 0; font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji"; background: #0f1114; color: #e6e6e6; } |
| 9 | + .container { max-width: 840px; margin: 0 auto; padding: 32px 16px; } |
| 10 | + .card { background: #15181d; border: 1px solid #2a2f37; border-radius: 8px; padding: 20px; } |
| 11 | + .title { margin: 0 0 8px; font-size: 20px; } |
| 12 | + .muted { color: #9aa0a6; font-size: 13px; } |
| 13 | + .row { display: flex; gap: 8px; align-items: center; margin-top: 12px; } |
| 14 | + input { flex: 1; padding: 8px 10px; background: #0f1114; color: #e6e6e6; border: 1px solid #2a2f37; border-radius: 6px; } |
| 15 | + button { padding: 8px 12px; border-radius: 6px; border: 0; cursor: pointer; } |
| 16 | + .primary { background: #76b900; color: #0b0e11; } |
| 17 | + .secondary { background: #22262c; color: #e6e6e6; border: 1px solid #2a2f37; } |
| 18 | + a.link { color: #76b900; text-decoration: none; } |
| 19 | + a.link:hover { text-decoration: underline; } |
| 20 | + .warn { background: #3a2e00; border: 1px solid #5a4a00; color: #ffd666; padding: 10px 12px; border-radius: 6px; margin-top: 16px; font-size: 13px; } |
| 21 | + </style> |
| 22 | + </head> |
| 23 | + <body> |
| 24 | + <div class="container"> |
| 25 | + <h1 class="title">Kit App Streaming - Web Client Launcher</h1> |
| 26 | + <p class="muted">This page launches a WebRTC client and points it at your running Kit streaming server.</p> |
| 27 | + |
| 28 | + <div class="card"> |
| 29 | + <label for="server">Streaming server</label> |
| 30 | + <div class="row"> |
| 31 | + <input id="server" type="text" placeholder="host:port" /> |
| 32 | + <button class="secondary" id="copy">Copy</button> |
| 33 | + <button class="primary" id="open">Open Client</button> |
| 34 | + </div> |
| 35 | + <div class="warn" id="note" style="display:none"></div> |
| 36 | + <p class="muted" style="margin-top:12px"> |
| 37 | + Don’t see a client? You can use the official WebRTC client. If you already host it at <code>/ov-web-client/</code> on this server, the button above will open it. Otherwise, clone and run the client locally, then paste the server here. |
| 38 | + </p> |
| 39 | + <ul class="muted"> |
| 40 | + <li>Expected format: <code>jordanh-dev.hrd.nvidia.com:47995</code></li> |
| 41 | + <li>Self-signed certificates are typical in development; accept the browser warning if prompted.</li> |
| 42 | + </ul> |
| 43 | + </div> |
| 44 | + |
| 45 | + <p style="margin-top:16px" class="muted"> |
| 46 | + Tip: This page can be opened automatically from the Playground when streaming is ready. |
| 47 | + </p> |
| 48 | + </div> |
| 49 | + |
| 50 | + <script> |
| 51 | + (function () { |
| 52 | + const params = new URLSearchParams(window.location.search); |
| 53 | + const serverParam = params.get('server') || ''; |
| 54 | + const input = document.getElementById('server'); |
| 55 | + const copy = document.getElementById('copy'); |
| 56 | + const open = document.getElementById('open'); |
| 57 | + const note = document.getElementById('note'); |
| 58 | + input.value = serverParam; |
| 59 | + |
| 60 | + copy.addEventListener('click', async () => { |
| 61 | + try { |
| 62 | + await navigator.clipboard.writeText(input.value); |
| 63 | + copy.textContent = 'Copied'; |
| 64 | + setTimeout(() => (copy.textContent = 'Copy'), 1200); |
| 65 | + } catch {} |
| 66 | + }); |
| 67 | + |
| 68 | + function openOvClient() { |
| 69 | + const server = input.value.trim(); |
| 70 | + if (!server) { |
| 71 | + input.focus(); |
| 72 | + return; |
| 73 | + } |
| 74 | + |
| 75 | + // Prefer a locally hosted ov-web-client if available (static under this UI origin), |
| 76 | + // falling back to relative path so reverse proxies can host it. |
| 77 | + const localClient = `/ov-web-client/?server=${encodeURIComponent(server)}`; |
| 78 | + // Open in a new tab; if the local path 404s, user can still copy the address. |
| 79 | + window.open(localClient, '_blank', 'noopener,noreferrer'); |
| 80 | + note.style.display = 'block'; |
| 81 | + note.textContent = 'If the client does not load, ensure ov-web-client is hosted at /ov-web-client/ or run it locally and paste the server address there.'; |
| 82 | + } |
| 83 | + |
| 84 | + open.addEventListener('click', openOvClient); |
| 85 | + |
| 86 | + // Auto-open when server is provided |
| 87 | + if (serverParam) { |
| 88 | + setTimeout(openOvClient, 250); |
| 89 | + } |
| 90 | + })(); |
| 91 | + </script> |
| 92 | + </body> |
| 93 | + </html> |
| 94 | + |
| 95 | + |
0 commit comments