RTCForge API Reference v1.1.1
    Preparing search index...

    Class ReferenceSfuMedia

    Reference implementation of SfuMediaInterface and CascadePipeInterface. It owns the correct in-memory bookkeeping of a room's routes and cascade links (so getRoutes and idempotent add/remove work out of the box) and delegates the actual media forwarding to an injected SfuMediaDriver. This is the missing keystone between rtcforge-sfu (control plane) and a real media plane, without coupling the two packages.

    const media = new ReferenceSfuMedia({
    onPipeLink: (roomId, from, to) => pipeBetweenNodes(roomId, from, to), // your mediasoup pipe
    onUnpipeLink: (roomId, from, to) => unpipeBetweenNodes(roomId, from, to),
    })
    const bridge = new SfuBridge(router, media)
    const cascade = new CascadeBridge(tree, media)

    Implements

    Index

    Constructors

    Methods

    • Snapshot of the cascade links currently tracked for a room (from>to keys).

      Parameters

      • roomId: string

      Returns string[]

    • Establish a media pipe carrying roomId from fromNodeId to toNodeId. May be async so the pipe setup can be awaited and surface failures.

      Parameters

      • roomId: string
      • fromNodeId: string
      • toNodeId: string

      Returns void