-
public class PlaybackNotificationConfig
-
-
Field Summary
Fields Modifier and Type Field Description public final Context
context
public PlaybackNotification.MediaDescriptionAdapter
adapter
public int
notificationId
public int
channelNameResourceId
public int
smallIconResourceId
public int
channelImportance
public boolean
usePlayPauseActions
public boolean
useNextAction
public boolean
usePreviousAction
public boolean
useNextActionInCompactView
public boolean
usePreviousActionInCompactView
public boolean
useFastForwardAction
public boolean
useFastForwardActionInCompactView
public boolean
useRewindAction
public boolean
useRewindActionInCompactView
public boolean
colorized
public BrightcoveNotificationListener
notificationListener
public int
color
public int
priority
public int
visibility
public String
channelId
public Array<PlaybackNotification.StreamType>
types
-
Constructor Summary
Constructors Constructor Description PlaybackNotificationConfig(Context context)
Create a new instance of the config.
-
Method Summary
Modifier and Type Method Description PlaybackNotificationConfig
setAdapter(PlaybackNotification.MediaDescriptionAdapter adapter)
The PlaybackNotification.MediaDescriptionAdapter to be queried for the notification contents. PlaybackNotificationConfig
setNotificationId(int notificationId)
The id of the notification to be posted. PlaybackNotificationConfig
setChannelNameResourceId(int channelNameResourceId)
The name of the channel. PlaybackNotificationConfig
setChannelImportance(int channelImportance)
The importance of the channel. final PlaybackNotificationConfig
setUsePlayPauseActions(boolean usePlayPauseActions)
Sets whether the play and pause actions should be used. final PlaybackNotificationConfig
setUseNextAction(boolean useNextAction)
Sets whether the next action should be used. final PlaybackNotificationConfig
setUsePreviousAction(boolean usePreviousAction)
Sets whether the previous action should be used. final PlaybackNotificationConfig
setUseNextActionInCompactView(boolean useNextActionInCompactView)
If useNextAction is {@code true}
, sets whether the next action shouldalso be used in compact view.final PlaybackNotificationConfig
setUsePreviousActionInCompactView(boolean usePreviousActionInCompactView)
If usePreviousAction is {@code true}
, sets whether the previousaction should also be used in compact view.final PlaybackNotificationConfig
setUseFastForwardAction(boolean useFastForwardAction)
Sets whether the fast forward action should be used. final PlaybackNotificationConfig
setUseFastForwardActionInCompactView(boolean useFastForwardActionInCompactView)
Sets whether the fast forward action should also be used in compact view. final PlaybackNotificationConfig
setUseRewindAction(boolean useRewindAction)
Sets whether the rewind action should be used. final PlaybackNotificationConfig
setUseRewindActionInCompactView(boolean useRewindActionInCompactView)
Sets whether the rewind action should also be used in compact view. final PlaybackNotificationConfig
setColorized(boolean colorized)
Sets whether the notification should be colorized. PlaybackNotificationConfig
setNotificationListener(BrightcoveNotificationListener notificationListener)
The BrightcoveNotificationListener to be used. final PlaybackNotificationConfig
setColor(int color)
Sets the accent color of the notification. final PlaybackNotificationConfig
setPriority(int priority)
Sets the priority of the notification required for API 25 and lower. final PlaybackNotificationConfig
setVisibility(int visibility)
Sets the visibility of the notification which determines whether and how the notification isshown when the device is in lock screen mode. PlaybackNotificationConfig
setChannelId(String channelId)
The id of the notification channel. final PlaybackNotificationConfig
setSmallIcon(@DrawableRes() int smallIconResourceId)
Sets the small icon of the notification which is also shown in the system status bar. PlaybackNotificationConfig
setStreamTypes(Array<PlaybackNotification.StreamType> types)
Set the types of media to show the playback notification on. -
-
Constructor Detail
-
PlaybackNotificationConfig
PlaybackNotificationConfig(Context context)
Create a new instance of the config.- Parameters:
context
- The application context, used by the notification manager.
-
-
Method Detail
-
setAdapter
PlaybackNotificationConfig setAdapter(PlaybackNotification.MediaDescriptionAdapter adapter)
The PlaybackNotification.MediaDescriptionAdapter to be queried for the notification contents.
-
setNotificationId
PlaybackNotificationConfig setNotificationId(int notificationId)
The id of the notification to be posted. Must be greater than 0.
- Parameters:
notificationId
- The notification ID
-
setChannelNameResourceId
PlaybackNotificationConfig setChannelNameResourceId(int channelNameResourceId)
The name of the channel.
-
setChannelImportance
PlaybackNotificationConfig setChannelImportance(int channelImportance)
The importance of the channel.
-
setUsePlayPauseActions
final PlaybackNotificationConfig setUsePlayPauseActions(boolean usePlayPauseActions)
Sets whether the play and pause actions should be used.
- Parameters:
usePlayPauseActions
- Whether to use play and pause actions.
-
setUseNextAction
final PlaybackNotificationConfig setUseNextAction(boolean useNextAction)
Sets whether the next action should be used.
- Parameters:
useNextAction
- Whether to use the next action.
-
setUsePreviousAction
final PlaybackNotificationConfig setUsePreviousAction(boolean usePreviousAction)
Sets whether the previous action should be used.
- Parameters:
usePreviousAction
- Whether to use the previous action.
-
setUseNextActionInCompactView
final PlaybackNotificationConfig setUseNextActionInCompactView(boolean useNextActionInCompactView)
If useNextAction is
{@code true}
, sets whether the next action shouldalso be used in compact view. Has no effect if useNextAction is{@code false}
.If set to
{@code true}
, setUseFastForwardActionInCompactView is set to false.- Parameters:
useNextActionInCompactView
- Whether to use the next action in compact view.
-
setUsePreviousActionInCompactView
final PlaybackNotificationConfig setUsePreviousActionInCompactView(boolean usePreviousActionInCompactView)
If usePreviousAction is
{@code true}
, sets whether the previousaction should also be used in compact view. Has no effect if usePreviousAction is{@code false}
.If set to
{@code true}
, setUseRewindActionInCompactView is set to false.- Parameters:
usePreviousActionInCompactView
- Whether to use the previous action in compact view.
-
setUseFastForwardAction
final PlaybackNotificationConfig setUseFastForwardAction(boolean useFastForwardAction)
Sets whether the fast forward action should be used.
- Parameters:
useFastForwardAction
- Whether to use the fast forward action.
-
setUseFastForwardActionInCompactView
final PlaybackNotificationConfig 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 compactview.
-
setUseRewindAction
final PlaybackNotificationConfig setUseRewindAction(boolean useRewindAction)
Sets whether the rewind action should be used.
- Parameters:
useRewindAction
- Whether to use the rewind action.
-
setUseRewindActionInCompactView
final PlaybackNotificationConfig 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.
-
setColorized
final PlaybackNotificationConfig setColorized(boolean colorized)
Sets whether the notification should be colorized. When set, the color set with will be used as the background color for the notification.
See setColorized.
- Parameters:
colorized
- Whether to colorize the notification.
-
setNotificationListener
PlaybackNotificationConfig setNotificationListener(BrightcoveNotificationListener notificationListener)
The BrightcoveNotificationListener to be used.
The default is
{@code null}
.- Parameters:
notificationListener
- The callback to be invoked when the on-going notificationcancels or is posted.
-
setColor
final PlaybackNotificationConfig setColor(int color)
Sets the accent color of the notification.
See setColor.
- Parameters:
color
- The color, in ARGB integer form.
-
setPriority
final PlaybackNotificationConfig setPriority(int priority)
Sets the priority of the notification required for API 25 and lower.
See setPriority.
- Parameters:
priority
- The priority which can be one of PRIORITY_DEFAULT,PRIORITY_MAX, PRIORITY_HIGH, or PRIORITY_MIN.
-
setVisibility
final PlaybackNotificationConfig setVisibility(int visibility)
Sets the visibility of the notification which determines whether and how the notification isshown when the device is in lock screen mode.
See setVisibility.
- Parameters:
visibility
- The visibility which must be one of , VISIBILITY_PRIVATE orVISIBILITY_SECRET.
-
setChannelId
PlaybackNotificationConfig setChannelId(String channelId)
The id of the notification channel.
- Parameters:
channelId
- The notification channel ID name.
-
setSmallIcon
final PlaybackNotificationConfig setSmallIcon(@DrawableRes() int smallIconResourceId)
Sets the small icon of the notification which is also shown in the system status bar.
See setSmallIcon.
- Parameters:
smallIconResourceId
- The resource id of the small icon.
-
setStreamTypes
PlaybackNotificationConfig setStreamTypes(Array<PlaybackNotification.StreamType> types)
Set the types of media to show the playback notification on.
- Parameters:
types
- The stream types.
-
-
-
-