Methods
+ +-
+
+
+
-
+
+
+ + asyncWrap() + + +
+ + + +
+ -
+
+
+ ++ + + + + + + + + + + + + + + + + + + + + + + + + +
Nicely wraps an async in a promise so we can use in-line without try...catch.
+-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ -
+
+
+ + async autoscaleInit(proxy, autoscaleConfig, initConfig) + + +
+ + + +
+ -
+
+
+ ++ + + + + + + + + +
Attempts to make requests on the Stream Manager for Origin/Edge information.
+++ + + + + + + + + + + + + + + + + +Parameters:
+ ++ +
+ ++ + + + + + + +Name + + +Type + + + + + +Description ++ + + + + + + + +proxy
+ + +Object + + + + + + + + + + +The established Publisher or Subscriber instance of the Red5 Pro SDK.
+ + + + + + + + +autoscaleConfig
+ + +Object + + + + + + + + + + +The configuration object used in communicating with the Stream Manager.
+ + + + + + + + +initConfig
+ + +Object + + + + + + + + + + +The initialization configuration to be used in the
init
call on theproxy
instance once the Stream Manager call has been resolved.-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ -
+
+
+ + modifyInitConfigWithStreamManagerResponse(initConfig, respnose, autoscaleConfig) → {Object} + + +
+ + + +
+ -
+
+
+ ++ + + + + + + + + +
Modifies and returns new intialization configuration used for publisher or subscriber. +This configuration can vary based on target tech and the
+useProxy
attribute of the autoscale configuration.++ + + + + + + + + + + + + +Parameters:
+ ++ +
+ ++ + + + + + + +Name + + +Type + + + + + +Description ++ + + + + + + + +initConfig
+ + +Object + + + + + + + + + + +The initialization configuration to modify.
+ + + + + + + + +respnose
+ + +Object + + + + + + + + + + +The response configuration from the Stream Manager.
+ + + + + + + + +autoscaleConfig
+ + +Object + + + + + + + + + + +The original configuration used for accessing the Stream Manager API.
++ + + + + +Returns:
+ + + + + +Object + + + + + + + + + +-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ -
+
+
+ + async req(config) + + +
+ + + +
+ -
+
+
+ ++ + + + + + + + + +
Makes a request on the Stream Manager for Origin or Edge information based on passed in configuration.
+++ + + + + + + + + + + + + + + + + +Parameters:
+ ++ +
+ ++ + + + + + + +Name + + +Type + + + + + +Description ++ + + + + + + + +config
+ + +Object + + + + + + + + + + +The configuration object to use in constructing the URL request.
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Example
+ +
+ + + +// The following is an example of the configuration to pass + const autoscaleConfig = { + action: 'broadcast', // required, either 'broadcast' or 'subscribe' + protocol: 'https', // required, default=https + host: 'sm.company.org', // required, the FQDN of the Stream Manager + port: undefined, // optional, if `undefined` assumes it served over SSL + scope: 'live', // optional, default=live + streamName: 'mystream', // required + apiVersion: '3.0', // required, default=3.0 + region: undefined, // optional, when using the optional `region` query param + accessToken: undefined, // optional, when using security on Stream Manager + retryLimit: 0, // optional, default (no retry) + retryDelay: 1000, // optional, default=1000 + useProxy: true // optional, default=true. Enforces connection proxy for WebRTC clients + }
+
+
+
+
+ -
+
+
+ + timeout() + + +
+ + + +
+ -
+
+
+ ++ + + + + + + + + + + + + + + + + + + + + + + + + +
Promisified setTimeout.
+-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+