SrtConnectionInputNode class

Signature:

export declare class SrtConnectionInputNode extends SourceMediaNode

Extends: SourceMediaNode

Properties

Property Type Description

connectionId

number

The connection index on the listener (matches its onConnection etc.)

Methods

Method Modifiers Description

nudge(sourceName, programNumber, nudge)

Nudges the timestamps of one source’s program on this connection.

nudge is an ABSOLUTE target offset, in milliseconds, from the source’s own timestamps — not an increment: nudging 500 then 200 leaves the program 200ms ahead of the source, and nudging 0 removes the offset. The engine moves the output timestamps to the target gradually rather than jumping.

The nudge addresses that program’s timestamp corrector, which exists only once the source’s media has started arriving. Before then the returned Promise rejects with a TimestampNudgeError whose reason is "not_ready" ("nudge not ready: no timestamp corrector for …​ yet"); the node is not affected, so retry shortly. The corrector is created on the same context change that reports the source to you, so a nudge sent from that callback can still be "not_ready".

With no answer from the engine within 10 seconds (an engine older than this SDK never answers) it rejects with reason "timeout"; the nudge may still have been applied.

startRecording(sourceName, recording)

Starts recording this connection’s bytes as they arrive, before any demux, while the input runs: the contributor stays connected throughout. Starting again stops the current recording first. Events arrive on onRecording; a source that is not there yet fails the recording, not the input.

stopRecording(sourceName)

Stops a recording started with startRecording.