Viewers who are part of a session without joining the room.
Why this exists. Joining a MediaSFU room auto-consumes WebRTC: the SDK
creates consumers from the server's newProducer events, unconditionally —
there is no receive-nothing mode. For a large passive audience watching over
HLS that is pure waste: transports, consumers and layout churn for media they
will never render. Joining and then pausing the consumers is worse than it
looks, because the layout pass keeps resuming them.
So an HLS viewer does not join at all. They hold a viewer session instead —
enough to be counted, to raise a hand, and to be told when the host approves —
and they only perform a real SDK join at the moment they reach the floor.
How that session is stored is deliberately not decided here. The transport,
lifecycle and state machine are the SDK's business; issuing playback URLs and
tracking presence belong to whatever backend you run. You supply a
ViewerSessionProvider; this drives it. Same reasoning as hlsFactory: the
SDK owns the mechanism, the app owns the dependency.
Viewers who are part of a session without joining the room.
Why this exists. Joining a MediaSFU room auto-consumes WebRTC: the SDK creates consumers from the server's
newProducerevents, unconditionally — there is no receive-nothing mode. For a large passive audience watching over HLS that is pure waste: transports, consumers and layout churn for media they will never render. Joining and then pausing the consumers is worse than it looks, because the layout pass keeps resuming them.So an HLS viewer does not join at all. They hold a viewer session instead — enough to be counted, to raise a hand, and to be told when the host approves — and they only perform a real SDK join at the moment they reach the floor.
How that session is stored is deliberately not decided here. The transport, lifecycle and state machine are the SDK's business; issuing playback URLs and tracking presence belong to whatever backend you run. You supply a
ViewerSessionProvider; this drives it. Same reasoning ashlsFactory: the SDK owns the mechanism, the app owns the dependency.