WebSocketServer.clientsByCamera

This commit is contained in:
2026-07-04 18:09:16 +05:00
parent e0437edf18
commit eb001771b5
4 changed files with 29 additions and 20 deletions

View File

@@ -12,7 +12,8 @@
<body>
<video id="v" controls autoplay muted></video>
<script>
const wsUrl = `${location.protocol === 'https:' ? 'wss' : 'ws'}://${location.host}/ws`;
const cameraId = new URLSearchParams(location.search).get('camera') ?? 'v1';
const wsUrl = `${location.protocol === 'https:' ? 'wss' : 'ws'}://${location.host}/ws/${cameraId}`;
const player = mpegts.createPlayer(
{ type: 'mpegts', isLive: true, url: wsUrl },
{ liveBufferLatencyChasing: true, liveBufferLatencyMaxLatency: 1.5 }