From 1f5d2e06c33d1fc05f028505054f1147dac94c0b Mon Sep 17 00:00:00 2001 From: Cloyir Date: Fri, 14 Aug 2026 18:59:33 +0100 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=BA=86=E9=9D=9E=E5=AE=89?= =?UTF-8?q?=E5=85=A8=E7=8E=AF=E5=A2=83=E4=B8=8B=E5=AE=A2=E6=9C=BA=E6=B5=8F?= =?UTF-8?q?=E8=A7=88=E4=B8=8D=E4=BA=86=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/viewer.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/public/viewer.js b/public/viewer.js index 072146e..5fe10dd 100644 --- a/public/viewer.js +++ b/public/viewer.js @@ -11,11 +11,20 @@ const peerConfig = { iceServers: [{ urls: "stun:stun.l.google.com:19302" }] }; let signal; let peer; -let viewerId = crypto.randomUUID(); +let viewerId = generateId(); let retryTimer; let playPromise; let remoteStream; +function generateId() { + const bytes = new Uint8Array(16); + crypto.getRandomValues(bytes); + bytes[6] = (bytes[6] & 0x0f) | 0x40; + bytes[8] = (bytes[8] & 0x3f) | 0x80; + const hex = Array.from(bytes, (b) => b.toString(16).padStart(2, "0")).join(""); + return `${hex.slice(0, 8)}-${hex.slice(8, 12)}-${hex.slice(12, 16)}-${hex.slice(16, 20)}-${hex.slice(20)}`; +} + player.muted = true; player.defaultMuted = true;