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 + ")");
}
});
Attributes | Name and Description |
---|---|
|
caplin.streamlink.alerts.TriggerListener()
|
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. |
►
caplin.streamlink.alerts.TriggerListener()
►
void
onServiceStatus(caplin.streamlink.ServiceStatus status)
Received when the trigger service availability changes.
caplin.streamlink.ServiceStatus | status | the updated caplin.streamlink.ServiceStatus. |
►
void
onTriggerAdded(caplin.streamlink.alerts.Trigger trigger)
Received when a trigger gets added to container.
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.
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.
caplin.streamlink.alerts.Trigger | trigger | the caplin.streamlink.alerts.Trigger that was updated. |