SrtInputNode class

Signature:

export declare class SrtInputNode extends SourceMediaNode

Extends: SourceMediaNode

Methods

Method Modifiers Description

addPassphrase(grant)

Adds or updates a (route, user) access grant on this listener. The route is the streamid’s r= value (or the bare streamid); the user is claimed via u= in the streamid and PROVEN by the passphrase (omit user for the anonymous identity). Omit passphrase for an explicit clear-allowed grant — protected and clear streams then share one listener. Once the table is non-empty every connection must match a grant; register grants before sources connect. While the table is EMPTY every caller is accepted, unless the listener was created with SrtInputSettings.requireGrants, when every caller is refused ("no_grants"). Listener mode only.

closeStream(streamIndex)

Closes a connected stream as specified by 'streamIndex'

nudge(sourceName, programNumber, nudge)

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

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.

removePassphrase(grant)

Removes a (route, user) access grant from this listener (omit user for the anonymous identity). Removing the LAST grant empties the table, which reopens the listener to every caller unless it was created with SrtInputSettings.requireGrants, when it refuses them all instead.

startRecording(sourceName, recording)

Starts recording one connection (by its source name)'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.