Class
caplin.streamlink

StreamLinkFactory

Factory that creates caplin.streamlink.StreamLink instances.

Constructor Summary

Attributes Name and Description
caplin.streamlink.StreamLinkFactory()

Method Summary

Attributes Name and Description
<static> caplin.streamlink.StreamLink create(Map configuration)

Creates a StreamLink object that has the supplied StreamLink configuration settings.

Constructor Detail

caplin.streamlink.StreamLinkFactory()

Method Detail

<static> caplin.streamlink.StreamLink create(Map configuration)

Creates a StreamLink object that has the supplied StreamLink configuration settings.

The configuration parameter is supplied using the following JSON attributes:
Attribute name Type Default Optional Description
liberator_urls string, [string], [[string]] None No The Liberator URL groups to connect to (see below).
keymaster_url string None (KeyMaster not used) Yes URL of KeyMaster for secure authentication of Liberator login requests.
keymaster_keep_alive_url string None (KeyMaster not used) Yes URL that StreamLink uses to check the connection to KeyMaster every keymaster_keep_alive_interval milliseconds.
keymaster_keep_alive_interval number 600000 milliseconds
(10 minutes)
Yes Interval in milliseconds at which StreamLink will poll KeyMaster (on keymaster_keep_alive_url) to keep the KeyMaster session open.
keymaster_attempts number 3 retries Yes

The number of times that StreamLink tries to get the user-credentials from KeyMaster before notifying an error.

Also the number of times that StreamLink allows KeyMaster to successively time out in response to a keep-alive poll (see http-timeout) before StreamLink notifies an error.

keymaster_keep_alive_listener KeymasterResponseListener None Yes The implementation of the caplin.streamlink.KeymasterResponseListener interface. This receives information about responses to keep-alive requests made to KeyMaster.
username string None Yes Liberator login user-name to use if logins are not being managed by KeyMaster.
password string None Yes Liberator login password to use if logins are not being managed by KeyMaster.
poll_interval number 1000 milliseconds
(1 second)
Yes Time interval in milliseconds between polls of the Liberator. This only applies to HTTP polling type connections (see 'RTTP connection types' in the document StreamLink Overview).
forever_frame_reconnect_count number 10000 Yes After receiving this number of messages, a forever frame connection will perform a fast reconnect to prevent memory leaks.
xhr_streaming_reconnect_count number 10000 Yes After receiving this number of messages, an xhr streaming connection will perform a fast reconnect to prevent memory leaks.
request_timeout number 10000 milliseconds
(10 seconds)
Yes Time in milliseconds allowed for the response to each request before StreamLink reconnects to the Liberator.
http_timeout number 30000 milliseconds
(30 seconds)
Yes Time in milliseconds allowed for an HTTP Request to finish successfully before StreamLink times out.
clock_offset_interval number 10000 milliseconds
(10 seconds)
Yes StreamLink calculates a new clock offset value every clock_offset_interval milliseconds.
clock_offset_window number 120000 milliseconds
(2 minutes)
Yes Time in milliseconds a calculated clock offset is valid for use in producing statistics.
latency_interval number 10000 milliseconds
(10 seconds)
Yes Time in milliseconds between calculating a new latency value.
latency_window number 120000 milliseconds
(2 minutes)
Yes Time in milliseconds a calculated latency is valid for use in producing statistics.
log_window_log_level caplin.streamlink.LogLevel caplin.streamlink.LogLevel.FINE Yes When the debug log window is shown, (see log_window_visible), only messages at or above the log level defined by log_window_log_level appear in the window.
log_window_visible boolean none Yes When true, the debug log window is shown when StreamLink first connects.
When false, the debug log window cannot be shown.
When left undefined the debug window can be shown if the page url contains a fragment of the form ?debug=[LogLevel name].

Failover configuration using liberator_urls.

A URL group is selected at random. StreamLink tries to connect to them sequentially.

If StreamLink did not successfully connect the next group will be tried.

URL's must include the protocol (http, https, ws, wss, poll, polls).

The protocol rttp means use the best non-ssl supported protocols.

The protocol rttps means use the best ssl supported protocols.

Examples:

 caplin.streamlink.StreamLinkFactory.create({
   liberator_urls: "rttp://liberator1:8080",
   username: "test@example.com",
   password: "my password"
 });
 
 caplin.streamlink.StreamLinkFactory.create({
   liberator_urls: ["rttp://liberator1:8080", "rttp://liberator2:8080"],
   keymaster_url: "keymaster",
   keymaster_keep_alive_url: "keymasterkeepaliveurl"
 });
 
 caplin.streamlink.StreamLinkFactory.create({
   liberator_urls: [
     ["rttp://liberator1:8080", "rttp://liberator2:8080"],
     ["rttp://liberator3:8080", "rttp://liberator4:8080"]
   ],
   keymaster_url: "keymaster",
   keymaster_keep_alive_url: "keymasterkeepaliveurl",
   keymaster_keep_alive_interval: 300000,
   http_timeout: 30000,
   keymaster_attempts: 3
 });
 

Parameters
Map configuration StreamLink configuration as JSON.
Returns
{caplin.streamlink.StreamLink} A StreamLink object.