Class PlaybackNotification

    • Constructor Detail

      • PlaybackNotification

        public PlaybackNotification()
    • Method Detail

      • setConfig

        public abstract void setConfig​(PlaybackNotification.Config config)
        Configure and customize the notification shown for playback.
        Parameters:
        config - The configuration to build the notification.
      • setStreamTypes

        public void setStreamTypes​(PlaybackNotification.StreamType... types)
        Set the stream types to show notifications for.
        Parameters:
        types - The types of media for notification playback.
      • getStreamTypes

        public PlaybackNotification.StreamType[] getStreamTypes()
        Get the supported stream types for showing this notification.
        Returns:
        The stream types supported for playback from the notification.
      • isVisible

        public abstract boolean isVisible()
        Check is the notification is showing.
        Returns:
        True if the notification is visible and on-going.
      • show

        protected abstract boolean show()
        Starts a notification immediately unless the player is in an idle state, in which case the notification is started as soon as the player transitions away from being idle.

        The notification shows if the currently playing PlaybackNotification.StreamType is one of {@link this#getStreamTypes()}

        Returns:
        True if the notification was created and showing on the device.
      • cancel

        protected abstract void cancel()
        Cancels the notification by setting the player to null.

        This should be called when the player is released.