From 8a5cba72c31014ea770473aa803f2c02ac35344f Mon Sep 17 00:00:00 2001 From: Steve Seguin Date: Fri, 5 Dec 2025 10:39:30 -0500 Subject: [PATCH] Delete docs.md --- docs.md | 32497 ------------------------------------------------------ 1 file changed, 32497 deletions(-) delete mode 100644 docs.md diff --git a/docs.md b/docs.md deleted file mode 100644 index 3830c80..0000000 --- a/docs.md +++ /dev/null @@ -1,32497 +0,0 @@ - - -# Conventions & Limits (v28) - -Encoding -- URL parameters that carry freeform text or URLs should be URL‑encoded. Examples: `label`, `password`, `endpage`, `avatarimg`, `bgimage`, `overlayimage`, `discordwebhook`, WHIP/WHEP URLs. -- The app decodes many fields internally via `decodeURIComponent(...)` (e.g., images, webhooks, endpage) and encodes some (e.g., password) before transport. When in doubt, encode. -- Booleans accept: `true` (presence), or strings `true/1/yes/on`; falsy strings `false/0/no/off` disable. -- Lists: comma‑separated (e.g., `view=SID1,SID2`, `include=SID3,SID4`). - -IDs and Names -- Stream ID (`push`/`id`/`permaid`): - - Allowed chars: A‑Z, a‑z, 0‑9, `_` (non‑word characters are replaced by `_`). - - Max length: trimmed to 70 characters (practical cap ~64 before internal salting). - - Auto‑generation: if empty, an 8‑char ID is generated. IDs shorter than 3 or `test` are warned as insecure on vdo.ninja if using default password. - - Screenshare ID (`screenshareid`) follows the same sanitization. -- Room name (`room`/`r`/`roomid`): - - Allowed chars: A‑Z, a‑z, 0‑9, `_` (non‑word characters become `_`). - - Max length: 30 characters (longer names are trimmed with a warning). -- Label (`label`/`l`): sanitized HTML‑safe and truncated to 100 chars. -- Passwords: accepted as provided; internally `encodeURIComponent` is applied. Hash/CRC checks use a maximum of 6 characters. - -Viewer selection & suffixes -- `view` accepts multiple IDs, comma‑separated. -- `:s` suffix on an ID allows only its screen‑share track (e.g., `view=ID1,ID2:s`). -- `include` can add allowed IDs on top of `view`. - -LAN, STUN/TURN, and relays -- LAN by default: WebRTC negotiates host candidates automatically; peers on the same network typically connect over LAN without extra parameters. -- Force LAN only: `&lanonly` prefers local/host candidates and avoids external routes. -- Force relays/turn: `&privacy`/`&relay` sets `iceTransportPolicy=relay` and throttles bitrate caps to protect shared TURN. Use only with your own TURN if possible. -- Candidate filtering/tcp: `&and-icefilter` and `&and-tcp` can restrict candidate types. - -Timing and limits -- `retrytimeout`: reconnect delay; clamped to a minimum of 5000 ms. -- `whipwait`/`whepwait`: default 2000 ms; clamped to ≥0. -- `autoend`: defaults to 10 minutes when present without a value. -- `audiobitrate`: clamped to 510 kbps max; disabled on iOS. -- `maxvideobitrate`/`bitrate`: auto‑adaptation may further constrain; privacy/relay mode caps to 4000–6000 kbps depending on context. - -Boolean defaults by context -- `stats`: on by default in some program views; passing `0/false/off` disables. -- `showdirector`: when numeric `2`, forces video‑only; otherwise A/V. -- IFrames: `nohistory` defaults to true inside IFRAME embeds. - -Misc -- Discord webhook: accepts full or shortened form; code normalizes to `https://discord.com/api/webhooks/...`. -- Endpage redirect: use `endpage` with a URL‑encoded link; optional `endpagetimer` delay (ms). -- OBS fixes: `obsfix` is numeric (default 1) for progressively stronger workarounds. - -FAQ (canonical answers) -- Does VDO.Ninja support H.265/HEVC? - - Yes, when the sending and receiving environments expose HEVC in WebRTC. Safari commonly supports HEVC publishing; modern Chrome can decode HEVC on many platforms. You can hint with `&codec=h265` (or `hevc`). Actual selection depends on encoder/decoder availability. Test page: https://vdo.ninja/h265 -- Should I URL‑encode parameters? - - Yes for free‑form strings and URLs (display names, passwords, image/overlay URLs, webhooks, redirect targets). The app decodes many of these; when in doubt, encode. -- How long can stream IDs be, and what characters are allowed? - - IDs are sanitized to alphanumerics and `_`; non‑word characters become `_`. IDs longer than ~64 are trimmed to 70; very short IDs (<3) or `test` warn as insecure when using default password. -- Does it work automatically over LAN? - - Yes. WebRTC will use local/host candidates by default when available; peers on the same network generally connect via LAN without flags. Use `&lanonly` to force LAN only; use `&privacy`/`&relay` to force relays (TURN). - - - - -# Core Concepts - -- Purpose: VDO.Ninja provides ultra‑low latency, peer‑to‑peer WebRTC links to capture and route audio/video between browsers and production apps (e.g., OBS) with minimal infrastructure. -- Topologies: Direct peer links, group rooms (director orchestrated), and optional relays/SFU helpers for scale or NAT traversal. -- Entities: Sources (publishers), Viewers (subscribers), Rooms (collections orchestrated by a director), Director/Co‑Director (control plane), and External APIs (iframe/remote). -- Identity: Streams use IDs (push/view). Rooms optionally use passwords/realms. Links encode behavior via URL parameters. -- Media pipeline: Browser getUserMedia → WebRTC PeerConnection → ICE/STUN/TURN → remote peer. Codecs and bitrates adjust per constraints; stats are available live. -- Latency vs resilience: Parameters trade off end‑to‑end latency, quality, and robustness (buffer, bitrate caps, codec choices, SVC/simulcast where available, packet loss strategies). -- Hostnames: Production instances include `vdo.ninja` and alternates. Self‑hosting handshake servers is possible; peer traffic remains P2P unless relayed. - -Key Terms -- Stream ID: Unique identifier for a published stream; viewers subscribe via this ID. Auto‑generated if not provided for guests. -- Room: Named space for multi‑party sessions managed by a director; can apply room‑wide settings (bitrate, permissions). -- Director: Room controller; can configure layout, permissions, and visibility; supports co‑director. -- Realm/Password: Namespace fence for stream/room IDs; the same ID in different realms does not collide. -- Remote control: Optional API/iframe mechanisms to observe stats and invoke actions when permitted. - -Notes -- v28 is the basis for behavior; when docs conflict, prefer `source-code/main.js` and `source-code/webrtc.js`. - - - - -# Code Insights (v28) - -This page summarizes implementation details from `source-code/main.js` and `source-code/webrtc.js` that inform behavior beyond parameter descriptions. - -- Controls persistence and sticky sessions - - `sticky`: Saves full URL to storage with a `permission` cookie and auto-redirects on load if accepted. Clears when declined. - - UI logic avoids sticky in iframes/OBS and hides Save Room when in studio software. - -- Preview and autoplay nuances - - `nopreview` flips to `minipreview=3` on iOS to comply with autoplay/device policies; `forcecontrols` repeatedly re-applies `