Class
caplin.streamlink.alerts

TriggerListener

Interface that should be implemented to receive trigger change callbacks from the TriggerProvider

A trivial implementation of TriggerListener would be:

// A caplin.streamlink.alerts.TriggerListener that can handle
// every possible callback.
//
// This trivial implementation just logs the callbacks
//


var triggerService = new caplin.streamlink.alerts.TriggerService(streamlink);

triggerService.addListener(
{
        onTriggerUpdated: function(trigger)
        {
                console.log("onTriggerUpdated(" + trigger.toString() + ")");
        },
        
        onTriggerAdded: function(trigger)
        {
                console.log("onTriggerAdded(" + trigger.toString() + ")");
        },
        
        onTriggerRemoved: function(trigger)
        {
                console.log("onTriggerRemoved(" + trigger.toString() + ")");
        },
        
        onServiceStatus: function(status)
        {
                console.log("onServiceStatus(" + status + ")");
        }
});

Constructor Summary

Attributes Name and Description
caplin.streamlink.alerts.TriggerListener()

Method Summary

Attributes Name and Description
void onServiceStatus(caplin.streamlink.ServiceStatus status)

Received when the trigger service availability changes.

void onTriggerAdded(caplin.streamlink.alerts.Trigger trigger)

Received when a trigger gets added to container.

void onTriggerRemoved(caplin.streamlink.alerts.Trigger trigger)

Received when a trigger gets removed from container.

void onTriggerUpdated(caplin.streamlink.alerts.Trigger trigger)

Received when a trigger is updated.

Constructor Detail

caplin.streamlink.alerts.TriggerListener()

Method Detail

void onServiceStatus(caplin.streamlink.ServiceStatus status)

Received when the trigger service availability changes.

Parameters
caplin.streamlink.ServiceStatus status the updated caplin.streamlink.ServiceStatus.

void onTriggerAdded(caplin.streamlink.alerts.Trigger trigger)

Received when a trigger gets added to container.

Parameters
caplin.streamlink.alerts.Trigger trigger the caplin.streamlink.alerts.Trigger that was added.

void onTriggerRemoved(caplin.streamlink.alerts.Trigger trigger)

Received when a trigger gets removed from container.

Parameters
caplin.streamlink.alerts.Trigger trigger the caplin.streamlink.alerts.Trigger that was removed.

void onTriggerUpdated(caplin.streamlink.alerts.Trigger trigger)

Received when a trigger is updated.

Parameters
caplin.streamlink.alerts.Trigger trigger the caplin.streamlink.alerts.Trigger that was updated.