diff options
| author | Adam Soltys <[email protected]> | 2026-10-19 07:56:19 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2026-10-19 07:56:19 -0700 |
| commit | 926fe1f1958396deac929013d88847f6703665b6 (patch) | |
| tree | 91cb19e9f0945d2bb1d4409e8811d1c25f9fce9e /tools | |
| parent | debbfaa1f0173d5be08fe40c27b12764f18d41ad (diff) | |
| download | coinosv3-server-926fe1f1958396deac929013d88847f6703665b6.tar.gz coinosv3-server-926fe1f1958396deac929013d88847f6703665b6.zip | |
live: WebRTC through Cloudflare's SFU (Realtime) for the app's viewers, a fraction of a second behind the broadcaster where HLS is 3.5 s. The server only brokers it, and the app's secret stays here ($LIVE_CONFIG sfuAppId/sfuSecret):
- POST /live/<id>/rtc/publish (the sender, NIP-98) pushes its tracks.
- POST /live/<id>/rtc/watch hands a viewer an offer of them, and /rtc/answer takes its answer.
/stats says which publish is current (rtc), and ?watching=1 counts a WebRTC viewer, who never fetches the playlist. HLS carries on as before, for the recording and the other nostr apps.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_013ZDf1cyCQLkfjftYhymZAg
Diffstat (limited to 'tools')
| -rw-r--r-- | tools/live-ingest-test.js | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/tools/live-ingest-test.js b/tools/live-ingest-test.js index 3af0456..d1b15e0 100644 --- a/tools/live-ingest-test.js +++ b/tools/live-ingest-test.js @@ -86,6 +86,9 @@ try { check('...H.264 at most 1280 on its long side, AAC sound', v?.codec_name === 'h264' && Math.max(v.width, v.height) <= 1280 && v.height > v.width && au?.codec_name === 'aac', v && `${v.codec_name} ${v.width}x${v.height} ${au?.codec_name}`); const st = await (await fetch(`${HTTP}/${id}/stats`)).json(); check('the watcher who fetched the playlist is counted', st.viewers === 1 && st.state === 'live', JSON.stringify(st)); + // WebRTC (Cloudflare's SFU) needs its key in the config: here there's none, and the app keeps to HLS + check('with no SFU key, no WebRTC: stats say so, and watch/publish answer 501', st.rtc === null + && (await fetch(`${HTTP}/${id}/rtc/watch`, { method: 'POST' })).status === 501 && (await fetch(`${HTTP}/${id}/rtc/publish`, { method: 'POST', body: '{}' })).status === 501); console.log('\n[a sender that drops comes back]'); a.ws.close(); |
