@seydx/rtsp / RelayEvents
Interface: RelayEvents
Defined in: relay.ts:81
Event map emitted by a relay.
Describes the signatures of every event a Relay can emit, used to type the on/off/emit surface inherited from the typed emitter.
Properties
end
end: () =>
void
Defined in: relay.ts:105
Fired when the upstream ends on its own (EOF or disconnect).
Indicates the source stopped producing packets without a caller-initiated stop; the relay then drains and closes its sinks, after which stop follows.
Returns
void
error
error: (
error) =>void
Defined in: relay.ts:113
Fired when the relay encounters a non-recoverable error.
Carries the offending error. Raised when the upstream fails to open or the pump loop throws; the relay tears itself down afterwards.
Parameters
error
unknown
Returns
void
sink:added
sink:added: (
sink) =>void
Defined in: relay.ts:121
Fired immediately after a sink is piped onto the relay.
Carries the newly attached Sink. Emitted before the sink has been synced to a keyframe, so the sink may not yet be receiving packets.
Parameters
sink
Returns
void
sink:removed
sink:removed: (
sink) =>void
Defined in: relay.ts:129
Fired once a previously attached sink has been detached and closed.
Carries the removed Sink. May be triggered by Relay.unpipe, by the sink closing itself, or by relay teardown.
Parameters
sink
Returns
void
start
start: (
info) =>void
Defined in: relay.ts:89
Fired once the upstream is open and the stream layout is resolved.
Carries the StreamInfo describing the tracks (and optional backchannel) the relay will fan out. Emitted exactly once per running cycle, after attached sinks have been initialized.
Parameters
info
Returns
void
stop
stop: () =>
void
Defined in: relay.ts:97
Fired after the upstream and every sink have been torn down.
Emitted on both explicit Relay.stop and end-of-stream teardown, signalling that the relay has returned to the idle state.
Returns
void