Class PlaybackNotification.Config

java.lang.Object
com.brightcove.player.playback.PlaybackNotification.Config
Enclosing class:
PlaybackNotification

public static class PlaybackNotification.Config extends Object
The config used to create the on-going notification and update the notification content.
  • Field Details

    • context

      protected final android.content.Context context
    • adapter

    • notificationId

      protected int notificationId
    • channelNameResourceId

      protected int channelNameResourceId
    • smallIconResourceId

      protected int smallIconResourceId
    • channelImportance

      protected int channelImportance
    • usePlayPauseActions

      protected boolean usePlayPauseActions
    • useNextAction

      protected boolean useNextAction
    • usePreviousAction

      protected boolean usePreviousAction
    • useNextActionInCompactView

      protected boolean useNextActionInCompactView
    • usePreviousActionInCompactView

      protected boolean usePreviousActionInCompactView
    • useFastForwardAction

      protected boolean useFastForwardAction
    • useFastForwardActionInCompactView

      protected boolean useFastForwardActionInCompactView
    • useRewindAction

      protected boolean useRewindAction
    • useRewindActionInCompactView

      protected boolean useRewindActionInCompactView
    • colorized

      protected boolean colorized
    • notificationListener

      protected BrightcoveNotificationListener notificationListener
    • color

      protected int color
    • priority

      protected int priority
    • visibility

      protected int visibility
    • channelId

      protected String channelId
    • types

  • Constructor Details

    • Config

      public Config(android.content.Context context)
      Create a new instance of the config.
      Parameters:
      context - The application context, used by the notification manager.
  • Method Details

    • setChannelId

      public PlaybackNotification.Config setChannelId(String channelId)
      The id of the notification channel.
      Parameters:
      channelId - The notification channel ID name.
      Returns:
      This instance for the chaining of method calls.
    • setAdapter

      The PlaybackNotification.MediaDescriptionAdapter to be queried for the notification contents.
      Returns:
      This instance for the chaining of method calls.
    • setNotificationListener

      public PlaybackNotification.Config setNotificationListener(BrightcoveNotificationListener notificationListener)
      The BrightcoveNotificationListener to be used.

      The default is null.

      Parameters:
      notificationListener - The callback to be invoked when the on-going notification cancels or is posted.
      Returns:
      This instance for the chaining of method calls.
    • setNotificationId

      public PlaybackNotification.Config setNotificationId(int notificationId)
      The id of the notification to be posted. Must be greater than 0.
      Parameters:
      notificationId - The notification ID
      Returns:
      This instance for the chaining of method calls.
    • setChannelNameResourceId

      public PlaybackNotification.Config setChannelNameResourceId(int channelNameResourceId)
      The name of the channel.
      Returns:
      This instance for the chaining of method calls.
    • setChannelImportance

      public PlaybackNotification.Config setChannelImportance(int channelImportance)
      The importance of the channel.
      Returns:
      This instance for the chaining of method calls.
    • setSmallIcon

      public final PlaybackNotification.Config setSmallIcon(@DrawableRes int smallIconResourceId)
      Sets the small icon of the notification which is also shown in the system status bar.

      See Notification.Builder.setSmallIcon(int).

      Parameters:
      smallIconResourceId - The resource id of the small icon.
    • setUseNextAction

      public final PlaybackNotification.Config setUseNextAction(boolean useNextAction)
      Sets whether the next action should be used.
      Parameters:
      useNextAction - Whether to use the next action.
    • setUsePreviousAction

      public final PlaybackNotification.Config setUsePreviousAction(boolean usePreviousAction)
      Sets whether the previous action should be used.
      Parameters:
      usePreviousAction - Whether to use the previous action.
    • setUseNextActionInCompactView

      public final PlaybackNotification.Config setUseNextActionInCompactView(boolean useNextActionInCompactView)
      If useNextAction is true, sets whether the next action should also be used in compact view. Has no effect if useNextAction is false.

      If set to true, setUseFastForwardActionInCompactView is set to false.

      Parameters:
      useNextActionInCompactView - Whether to use the next action in compact view.
    • setUsePreviousActionInCompactView

      public final PlaybackNotification.Config setUsePreviousActionInCompactView(boolean usePreviousActionInCompactView)
      If usePreviousAction is true, sets whether the previous action should also be used in compact view. Has no effect if usePreviousAction is false.

      If set to true, setUseRewindActionInCompactView is set to false.

      Parameters:
      usePreviousActionInCompactView - Whether to use the previous action in compact view.
    • setUseFastForwardAction

      public final PlaybackNotification.Config setUseFastForwardAction(boolean useFastForwardAction)
      Sets whether the fast forward action should be used.
      Parameters:
      useFastForwardAction - Whether to use the fast forward action.
    • setUseRewindAction

      public final PlaybackNotification.Config setUseRewindAction(boolean useRewindAction)
      Sets whether the rewind action should be used.
      Parameters:
      useRewindAction - Whether to use the rewind action.
    • setUseFastForwardActionInCompactView

      public final PlaybackNotification.Config setUseFastForwardActionInCompactView(boolean useFastForwardActionInCompactView)
      Sets whether the fast forward action should also be used in compact view.
      Parameters:
      useFastForwardActionInCompactView - Whether to use the fast forward action in compact view.
    • setUseRewindActionInCompactView

      public final PlaybackNotification.Config setUseRewindActionInCompactView(boolean useRewindActionInCompactView)
      Sets whether the rewind action should also be used in compact view.
      Parameters:
      useRewindActionInCompactView - Whether to use the rewind action in compact view.
    • setUsePlayPauseActions

      public final PlaybackNotification.Config setUsePlayPauseActions(boolean usePlayPauseActions)
      Sets whether the play and pause actions should be used.
      Parameters:
      usePlayPauseActions - Whether to use play and pause actions.
    • setColorized

      public final PlaybackNotification.Config setColorized(boolean colorized)
      Sets whether the notification should be colorized. When set, the color set with setColor(int) will be used as the background color for the notification.

      See Notification.Builder.setColorized(boolean).

      Parameters:
      colorized - Whether to colorize the notification.
    • setColor

      public final PlaybackNotification.Config setColor(int color)
      Sets the accent color of the notification.

      See Notification.Builder.setColor(int).

      Parameters:
      color - The color, in ARGB integer form.
    • setPriority

      public final PlaybackNotification.Config setPriority(int priority)
      Sets the priority of the notification required for API 25 and lower.

      See Notification.Builder.setPriority(int).

      Parameters:
      priority - The priority which can be one of Notification.PRIORITY_DEFAULT, Notification.PRIORITY_MAX, Notification.PRIORITY_HIGH, Notification.PRIORITY_LOW or Notification.PRIORITY_MIN. If not set Notification.PRIORITY_LOW is used by default.
    • setVisibility

      public final PlaybackNotification.Config setVisibility(int visibility)
      Sets the visibility of the notification which determines whether and how the notification is shown when the device is in lock screen mode.

      See Notification.Builder.setVisibility(int).

      Parameters:
      visibility - The visibility which must be one of Notification.VISIBILITY_PUBLIC, Notification.VISIBILITY_PRIVATE or Notification.VISIBILITY_SECRET.
    • setStreamTypes

      Set the types of media to show the playback notification on.
      Parameters:
      types - The stream types. By default this is PlaybackNotification.StreamType.Audio, PlaybackNotification.StreamType.AudioLive, and PlaybackNotification.StreamType.AudioLiveDvr
      Returns:
      This instance for the chaining of method calls.