Class: Config
The Config class is a singleton that holds the configuration for the application
Constructors
constructor
• new Config(ingestEndpoint?, logLevel?, streamConfig?, logger?, networkReconnectConfig?)
Parameters
| Name | Type | Default value |
|---|---|---|
ingestEndpoint? | string | undefined |
logLevel? | LogLevels | undefined |
streamConfig | StreamConfig | BASIC_LANDSCAPE |
logger? | Partial<Logger> | undefined |
networkReconnectConfig | NetworkReconnectConfig | defaultNetworkReconnectConfig |
Properties
BASIC_FULL_HD_LANDSCAPE
• BASIC_FULL_HD_LANDSCAPE: StreamConfig = BASIC_FULL_HD_LANDSCAPE
BASIC_FULL_HD_PORTRAIT
• BASIC_FULL_HD_PORTRAIT: StreamConfig = BASIC_FULL_HD_PORTRAIT
BASIC_LANDSCAPE
• BASIC_LANDSCAPE: StreamConfig = BASIC_LANDSCAPE
BASIC_PORTRAIT
• BASIC_PORTRAIT: StreamConfig = BASIC_PORTRAIT
LOG_LEVEL
• LOG_LEVEL: typeof LogLevels = LogLevels
STANDARD_LANDSCAPE
• STANDARD_LANDSCAPE: StreamConfig = STANDARD_LANDSCAPE
STANDARD_PORTRAIT
• STANDARD_PORTRAIT: StreamConfig = STANDARD_PORTRAIT
Accessors
ingestEndpoint
• get ingestEndpoint(): undefined | string
Get the ingest endpoint from the config file.
Returns
undefined | string
The ingest endpoint.
• 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
| Name | Type | Description |
|---|---|---|
newIngestEndpoint | undefined | string | The new value of the ingestEndpoint property. |
Returns
void
logLevel
• get logLevel(): undefined | LogLevels
Get the log level.
Returns
undefined | LogLevels
The log level.
• set logLevel(newLogLevel): void
Set the log level to the given value.
Parameters
| Name | Type | Description |
|---|---|---|
newLogLevel | unknown | The new log level to set. |
Returns
void
logger
• get logger(): undefined | Partial<Logger>
Get the logger property from the config.
Returns
The logger property is being returned.
• set logger(newLogger): void
Set the logger property.
Parameters
| Name | Type | Description |
|---|---|---|
newLogger | undefined | Partial<Logger> | The new logger to set. |
Returns
void
networkReconnectConfig
• get networkReconnectConfig(): undefined | NetworkReconnectConfig
Get the network reconnect configuration
Returns
undefined | NetworkReconnectConfig
The network reconnect config property is being returned.
• set networkReconnectConfig(newNetworkReconnectConfig): void
Set the network reconnect config property.
Parameters
| Name | Type | Description |
|---|---|---|
newNetworkReconnectConfig | undefined | NetworkReconnectConfig | The new network reconnect config to set. |
Returns
void
streamConfig
• get streamConfig(): StreamConfig
Get the stream config.
Returns
The streamConfig property is a getter that returns the streamConfig property of the class.
• set streamConfig(newStreamConfig): void
Set the streamConfig property to the newStreamConfig parameter.
The function is a setter, so it has a special name
Parameters
| Name | Type | Description |
|---|---|---|
newStreamConfig | unknown | The new stream configuration. |
Returns
void