Interface that should be implemented to receive notification change callbacks from the NotificationProvider
A trivial implementation of NotificationListener
would be:
// A caplin.streamlink.alerts.NotificationListener that can handle
// every possible callback.
//
// This trivial implementation just logs the callbacks
//
var notificationService = new caplin.streamlink.alerts.NotificationService(streamlink);
notificationService.addListener(
{
onNotification: function(notification)
{
console.log("onNotification()(" + notification.toString() + ")");
},
onNotificationRemoved: function(notification)
{
console.log("onNotificationRemoved(" + notification.toString() + ")");
},
onServiceStatus: function(status)
{
console.log("onServiceStatus(" + status + ")");
}
});
Attributes | Name and Description |
---|---|
|
caplin.streamlink.alerts.NotificationListener()
|
Attributes | Name and Description |
---|---|
|
void
onNotification( notification)
* Received when notification gets added to the container. |
|
void
onNotificationRemoved( notification)
* Received when notification is removed from the container. |
|
void
onServiceStatus( status)
* Received when the notification service availability changes. |
►
caplin.streamlink.alerts.NotificationListener()
►
void
onNotification( notification)
*
Received when notification gets added to the container.
*@param {caplin.streamlink.alerts.Notification} notification caplin.streamlink.alerts.Notificationnotification |
►
void
onNotificationRemoved( notification)
*
Received when notification is removed from the container.
*@param {caplin.streamlink.alerts.Notification} notification caplin.streamlink.alerts.Notificationnotification |
►
void
onServiceStatus( status)
*
Received when the notification service availability changes.
*@param {caplin.streamlink.ServiceStatus} status the updated caplin.streamlink.ServiceStatus.status |