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(caplin.streamlink.ConnectionStatusEvent connectionStatusEvent)

Invoked when the state of the StreamLink connection changes.

void onServiceStatusChange(caplin.streamlink.ServiceStatusEvent serviceStatusEvent)

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

void onSourceStatusChange(caplin.streamlink.SourceStatusEvent sourceStatusEvent)

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

void onStatisticsChange(caplin.streamlink.StatisticsEvent statisticsEvent)

Invoked when new connection statistics are available.

Constructor Detail

caplin.streamlink.ConnectionListener()

Method Detail

void onConnectionStatusChange(caplin.streamlink.ConnectionStatusEvent connectionStatusEvent)

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

Parameters
caplin.streamlink.ConnectionStatusEvent connectionStatusEvent The new status of the connection.

void onServiceStatusChange(caplin.streamlink.ServiceStatusEvent serviceStatusEvent)

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

Parameters
caplin.streamlink.ServiceStatusEvent serviceStatusEvent The new status of the data service.

void onSourceStatusChange(caplin.streamlink.SourceStatusEvent sourceStatusEvent)

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

Parameters
caplin.streamlink.SourceStatusEvent sourceStatusEvent The new status of the Integration Adapter.

void onStatisticsChange(caplin.streamlink.StatisticsEvent statisticsEvent)

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

Parameters
caplin.streamlink.StatisticsEvent statisticsEvent The new connection statistics.