NodeSettings interface

Settings common to all media nodes

Signature:

export interface NodeSettings<T extends MediaNodeState>

Properties

Property Type Description

id?

string

(Optional) Media Node identifier. If one is not specified, a random identifier will be generated.

onClose?

(() ⇒ Promise<void>) | (() ⇒ void)

(Optional) Called when the Node closes.

This may be by request, because the node naturally exits or an error has occurred. See onError to be notified of errors which may lead to the node closing.

onCreate?

(node: T) ⇒ void

(Optional) Callback to synchronously perform an action when node creation is complete (e.g. subscribe a downstream node before the first context/frame might arrive)

onError?

(error: Error) ⇒ void

(Optional) Called with any errors from the Node.

This includes both errors which will cause the node to exit, and those that do not but may e.g. indicate a connection has failed.