Class
caplin.streamlink

ConnectionListener

Defines the interface for receiving information about changes in the state of the StreamLink connection, the data services available from the Liberator, and the DataSources that are normally connected to the Liberator.

You should implement this interface if your application needs to take particular actions when such state changes occur.

Your application should not call into StreamLink when the connection status changes; StreamLink manages the connection state and will recover the connection to the Liberator without your application intervening.

A trivial implementation would be as follows :

streamLink.addConnectionListener({
        onConnectionStatusChange: function(connectionStatusEvent) {
                console.log("Connection State : " + connectionStatusEvent.getConnectionState());
        },
        onServiceStatusChange: function(serviceStatusEvent) {
                console.log(serviceStatusEvent.getServiceName() + " is now " + serviceStatusEvent.getServiceStatus());
        },
        onSourceStatusChange: function(sourceStatusEvent) {
                console.log(sourceStatusEvent.getSourceName() + " is now " + sourceStatusEvent.getSourceStatus());
        },
        onStatisticsChange: function(statisticsEvent) {
                console.log("Latency : " + statisticsEvent.getAverageLatency());
        }
});

Constructor Summary

Attributes Name and Description
caplin.streamlink.ConnectionListener()

Method Summary

Attributes Name and Description
void onConnectionStatusChange( connectionStatusEvent)

*

Invoked when the state of the StreamLink connection changes.

void onServiceStatusChange( serviceStatusEvent)

*

Invoked when the state of a data service available from the Liberator changes.

void onSourceStatusChange( sourceStatusEvent)

*

Invoked when the state of one of the Integration Adapters connected to Liberator changes.

void onStatisticsChange( statisticsEvent)

*

Invoked when new connection statistics are available.

Constructor Detail

caplin.streamlink.ConnectionListener()

Method Detail

void onConnectionStatusChange( connectionStatusEvent)

*

Invoked when the state of the StreamLink connection changes. Implementing this method is optional.

*@param {caplin.streamlink.ConnectionStatusEvent} connectionStatusEvent The new status of the connection.

Parameters
connectionStatusEvent

void onServiceStatusChange( serviceStatusEvent)

*

Invoked when the state of a data service available from the Liberator changes. Implementing this method is optional.

*@param {caplin.streamlink.ServiceStatusEvent} serviceStatusEvent The new status of the data service.

Parameters
serviceStatusEvent

void onSourceStatusChange( sourceStatusEvent)

*

Invoked when the state of one of the Integration Adapters connected to Liberator changes. * Implementing this method is optional.

*@param {caplin.streamlink.SourceStatusEvent} sourceStatusEvent The new status of the Integration Adapter.

Parameters
sourceStatusEvent

void onStatisticsChange( statisticsEvent)

*

Invoked when new connection statistics are available. Implementing this method is optional.

*@param {caplin.streamlink.StatisticsEvent} statisticsEvent The new connection statistics.

Parameters
statisticsEvent