Set up your notification system

You can listen for notifications and you can add your own notifications to the notification history.

The core of the Primetime Player notification system is the Notification class, which represents a standalone notification.

The NotificationHistory class provides a mechanism for accumulating notifications. It stores a log of notification (NotificationHistoryItem) objects that represents a collection of Notifications.

Your application can perform two basic operations with notifications:

  • Listen for notifications
  • Add notifications to the notification history
  1. Listen for state changes.
  2. Implement the MediaPlayer.PlaybackEventListener.onStateChanged callback.
  3. The PSDK passes two parameters to the callback:
    • The new state (MediaPlayer.PlayerState)
    • A MediaPlayerNotification object, which contains the following: