Skip to main content
Version: v1.17.0

Class: Config

The Config class is a singleton that holds the configuration for the application

Constructors​

new Config()​

new Config(ingestEndpoint?, logLevel?, streamConfig?, logger?, networkReconnectConfig?): Config

Parameters​

• ingestEndpoint?: string

• logLevel?: LogLevels

• streamConfig?: StreamConfig = BASIC_LANDSCAPE

• logger?: Partial <Logger>

• networkReconnectConfig?: NetworkReconnectConfig = defaultNetworkReconnectConfig

Returns​

Config

Properties​

BASIC_FULL_HD_LANDSCAPE​

BASIC_FULL_HD_LANDSCAPE: StreamConfig


BASIC_FULL_HD_PORTRAIT​

BASIC_FULL_HD_PORTRAIT: StreamConfig


BASIC_LANDSCAPE​

BASIC_LANDSCAPE: StreamConfig


BASIC_PORTRAIT​

BASIC_PORTRAIT: StreamConfig


LOG_LEVEL​

LOG_LEVEL: typeof LogLevels = LogLevels


STANDARD_LANDSCAPE​

STANDARD_LANDSCAPE: StreamConfig


STANDARD_PORTRAIT​

STANDARD_PORTRAIT: StreamConfig

Accessors​

ingestEndpoint​

get ingestEndpoint(): undefined | string

Get the ingest endpoint from the config file.

set ingestEndpoint(newIngestEndpoint): void

Set the ingest endpoint to the new value, and validates that the new value is valid. If the rtmps ingest server is provided, this function attempts to converts it to a valid 'https' endpoint. If the provided ingest endpoint is invalid, it throws an error.

Parameters​

• newIngestEndpoint: undefined | string

The new value of the ingestEndpoint property.

Returns​

undefined | string

The ingest endpoint.


logLevel​

get logLevel(): undefined | LogLevels

Get the log level.

set logLevel(newLogLevel): void

Set the log level to the given value.

Parameters​

• newLogLevel: unknown

The new log level to set.

Returns​

undefined | LogLevels

The log level.


logger​

get logger(): undefined | Partial <Logger>

Get the logger property from the config.

set logger(newLogger): void

Set the logger property.

Parameters​

• newLogger: undefined | Partial <Logger>

The new logger to set.

Returns​

undefined | Partial <Logger>

The logger property is being returned.


networkReconnectConfig​

get networkReconnectConfig(): undefined | NetworkReconnectConfig

Get the network reconnect configuration

set networkReconnectConfig(newNetworkReconnectConfig): void

Set the network reconnect config property.

Parameters​

• newNetworkReconnectConfig: undefined | NetworkReconnectConfig

The new network reconnect config to set.

Returns​

undefined | NetworkReconnectConfig

The network reconnect config property is being returned.


streamConfig​

get streamConfig(): StreamConfig

Get the stream config.

set streamConfig(newStreamConfig): void

Set the streamConfig property to the newStreamConfig parameter.

The function is a setter, so it has a special name

Parameters​

• newStreamConfig: unknown

The new stream configuration.

Returns​

StreamConfig

The streamConfig property is a getter that returns the streamConfig property of the class.