StreamSwitchHardNode class

Signature:

export declare class StreamSwitchHardNode<Pins extends string> extends ProcessorMediaNode<Pins>

Extends: ProcessorMediaNode<Pins>

Properties

Property Type Description

activeSource

Pins | undefined

The currently active source (that is, the source which has been requested to be active - may not yet be present on the output until the corresponding event is raised).

Methods

Method Modifiers Description

switchSource(newSource)

Switch to a new active source at its first valid keyframe; the old source’s still-arriving frames stop emitting at the same instant. For the gapless-playlist pattern (where the previous source’s tail must keep playing while the next source warms up), use NorskControl.streamSourceSequence() instead.

The target pin must already be carrying streams; a switch to a pin whose source has not produced a context yet is refused by the engine and the switcher stays where it was. The refusal is reported through StreamSwitchHardSettings.onSwitchError and returned as the StreamSwitchResult; the promise resolves either way, never rejects. reflects the engine’s answer, not the request.