home/ atoms/ hydra-webrtc-networked-streams

Hydra can use other browser windows as live video sources via WebRTC peer-to-peer streaming

Hydra’s rtc-patch-bay module enables any open Hydra window to share its canvas to other windows in real time over WebRTC. A sender window calls pb.setName('myGraphics') to advertise itself; a receiver window calls s0.initStream('myGraphics') to subscribe. Connections may take a few seconds; pb.list() shows available sources. The same mechanism works across machines as long as both have internet access and no firewall blocks the connection. This enables multi-performer collaborative visuals where each performer controls one stream and others composite them.

Examples

// Window 1:
pb.setName('myGraphics')
// Window 2:
s0.initStream('myGraphics')
src(s0).out()

Assessment

Describe the steps to share a Hydra canvas from one browser tab to another and composite it with a locally generated oscillator. Identify two failure modes.

“Any hydra instance can use other instances/windows containing hydra as input sources, as long as they are connected to the internet and not blocked by a firewall. Hydra uses webrtc (real time webstreaming) under the hood to share video streams between open windows.”
corpus · hydra-livecoding-networked-visuals-source-repo · chunk 3