Planning inputs.
Candidate node ids to draw from (the origin is excluded automatically).
OptionalcapacityOf?: (nodeId: string) => numberOptional per-node capacity lookup overriding viewersPerNode for leaf seating.
Maximum children per node; must be >= 1.
Identifier of the origin node (tree root).
Total number of viewers to seat.
Default viewer capacity per node (and the origin's assumed capacity); must be >= 1.
The computed CascadePlan, including any unmetViewers shortfall.
Compute a balanced cascade fan-out tree that distributes a room's media to a large viewer population across many SFU nodes.
Starting from the origin, nodes are drawn from
availableNodeIdsand attached tier by tier, each parent taking up tofanoutchildren, until the current tier can seatviewerCountviewers (atviewersPerNodeeach) or the node pool is exhausted. Leaf nodes are then filled with viewer slots up to their per-node capacity. This shallow, wide tree keeps forwarding hops low while scaling to very large audiences (for example a live stream to 1M viewers).