Package com.brightcove.player.playback
Class PlaybackNotification.Config
- java.lang.Object
-
- com.brightcove.player.playback.PlaybackNotification.Config
-
- Enclosing class:
- PlaybackNotification
public static class PlaybackNotification.Config extends java.lang.Object
The config used to create the on-going notification and update the notification content.
-
-
Field Summary
Fields Modifier and Type Field Description protected PlaybackNotification.MediaDescriptionAdapter
adapter
protected java.lang.String
channelId
protected int
channelImportance
protected int
channelNameResourceId
protected int
color
protected boolean
colorized
protected android.content.Context
context
protected int
notificationId
protected BrightcoveNotificationListener
notificationListener
protected int
priority
protected int
smallIconResourceId
protected PlaybackNotification.StreamType[]
types
protected boolean
useFastForwardAction
protected boolean
useFastForwardActionInCompactView
protected boolean
useNextAction
protected boolean
useNextActionInCompactView
protected boolean
usePlayPauseActions
protected boolean
usePreviousAction
protected boolean
usePreviousActionInCompactView
protected boolean
useRewindAction
protected boolean
useRewindActionInCompactView
protected int
visibility
-
Constructor Summary
Constructors Constructor Description Config(android.content.Context context)
Create a new instance of the config.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PlaybackNotification.Config
setAdapter(PlaybackNotification.MediaDescriptionAdapter adapter)
ThePlaybackNotification.MediaDescriptionAdapter
to be queried for the notification contents.PlaybackNotification.Config
setChannelId(java.lang.String channelId)
The id of the notification channel.PlaybackNotification.Config
setChannelImportance(int channelImportance)
The importance of the channel.PlaybackNotification.Config
setChannelNameResourceId(int channelNameResourceId)
The name of the channel.PlaybackNotification.Config
setColor(int color)
Sets the accent color of the notification.PlaybackNotification.Config
setColorized(boolean colorized)
Sets whether the notification should be colorized.PlaybackNotification.Config
setNotificationId(int notificationId)
The id of the notification to be posted.PlaybackNotification.Config
setNotificationListener(BrightcoveNotificationListener notificationListener)
TheBrightcoveNotificationListener
to be used.PlaybackNotification.Config
setPriority(int priority)
Sets the priority of the notification required for API 25 and lower.PlaybackNotification.Config
setSmallIcon(int smallIconResourceId)
Sets the small icon of the notification which is also shown in the system status bar.PlaybackNotification.Config
setStreamTypes(PlaybackNotification.StreamType... types)
Set the types of media to show the playback notification on.PlaybackNotification.Config
setUseFastForwardAction(boolean useFastForwardAction)
Sets whether the fast forward action should be used.PlaybackNotification.Config
setUseFastForwardActionInCompactView(boolean useFastForwardActionInCompactView)
Sets whether the fast forward action should also be used in compact view.PlaybackNotification.Config
setUseNextAction(boolean useNextAction)
Sets whether the next action should be used.PlaybackNotification.Config
setUseNextActionInCompactView(boolean useNextActionInCompactView)
IfuseNextAction
istrue
, sets whether the next action should also be used in compact view.PlaybackNotification.Config
setUsePlayPauseActions(boolean usePlayPauseActions)
Sets whether the play and pause actions should be used.PlaybackNotification.Config
setUsePreviousAction(boolean usePreviousAction)
Sets whether the previous action should be used.PlaybackNotification.Config
setUsePreviousActionInCompactView(boolean usePreviousActionInCompactView)
IfusePreviousAction
istrue
, sets whether the previous action should also be used in compact view.PlaybackNotification.Config
setUseRewindAction(boolean useRewindAction)
Sets whether the rewind action should be used.PlaybackNotification.Config
setUseRewindActionInCompactView(boolean useRewindActionInCompactView)
Sets whether the rewind action should also be used in compact view.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.
-
-
-
Field Detail
-
context
protected final android.content.Context context
-
adapter
protected PlaybackNotification.MediaDescriptionAdapter 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 java.lang.String channelId
-
types
protected PlaybackNotification.StreamType[] types
-
-
Method Detail
-
setChannelId
public PlaybackNotification.Config setChannelId(java.lang.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
public PlaybackNotification.Config setAdapter(PlaybackNotification.MediaDescriptionAdapter adapter)
ThePlaybackNotification.MediaDescriptionAdapter
to be queried for the notification contents.- Returns:
- This instance for the chaining of method calls.
-
setNotificationListener
public PlaybackNotification.Config setNotificationListener(BrightcoveNotificationListener notificationListener)
TheBrightcoveNotificationListener
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)
IfuseNextAction
istrue
, sets whether the next action should also be used in compact view. Has no effect ifuseNextAction
isfalse
.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)
IfusePreviousAction
istrue
, sets whether the previous action should also be used in compact view. Has no effect ifusePreviousAction
isfalse
.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 withsetColor(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 ofNotification.PRIORITY_DEFAULT
,Notification.PRIORITY_MAX
,Notification.PRIORITY_HIGH
,Notification.PRIORITY_LOW
orNotification.PRIORITY_MIN
. If not setNotification.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 ofNotification.VISIBILITY_PUBLIC
,Notification.VISIBILITY_PRIVATE
orNotification.VISIBILITY_SECRET
.
-
setStreamTypes
public PlaybackNotification.Config setStreamTypes(PlaybackNotification.StreamType... types)
Set the types of media to show the playback notification on.- Parameters:
types
- The stream types. By default this isPlaybackNotification.StreamType.Audio
,PlaybackNotification.StreamType.AudioLive
, andPlaybackNotification.StreamType.AudioLiveDvr
- Returns:
- This instance for the chaining of method calls.
-
-