Package com.brightcove.player.playback
Class PlaybackNotification.Config
java.lang.Object
com.brightcove.player.playback.PlaybackNotification.Config
- Enclosing class:
- PlaybackNotification
The config used to create the on-going notification and update the notification content.
-
Field Summary
Modifier and TypeFieldDescriptionprotected String
protected int
protected int
protected int
protected boolean
protected final android.content.Context
protected int
protected BrightcoveNotificationListener
protected int
protected int
protected PlaybackNotification.StreamType[]
protected boolean
protected boolean
protected boolean
protected boolean
protected boolean
protected boolean
protected boolean
protected boolean
protected boolean
protected int
-
Constructor Summary
ConstructorDescriptionConfig
(android.content.Context context) Create a new instance of the config. -
Method Summary
Modifier and TypeMethodDescriptionThePlaybackNotification.MediaDescriptionAdapter
to be queried for the notification contents.setChannelId
(String channelId) The id of the notification channel.setChannelImportance
(int channelImportance) The importance of the channel.setChannelNameResourceId
(int channelNameResourceId) The name of the channel.setColor
(int color) Sets the accent color of the notification.setColorized
(boolean colorized) Sets whether the notification should be colorized.setNotificationId
(int notificationId) The id of the notification to be posted.setNotificationListener
(BrightcoveNotificationListener notificationListener) TheBrightcoveNotificationListener
to be used.setPriority
(int priority) Sets the priority of the notification required for API 25 and lower.setSmallIcon
(int smallIconResourceId) Sets the small icon of the notification which is also shown in the system status bar.Set the types of media to show the playback notification on.setUseFastForwardAction
(boolean useFastForwardAction) Sets whether the fast forward action should be used.setUseFastForwardActionInCompactView
(boolean useFastForwardActionInCompactView) Sets whether the fast forward action should also be used in compact view.setUseNextAction
(boolean useNextAction) Sets whether the next action should be used.setUseNextActionInCompactView
(boolean useNextActionInCompactView) IfuseNextAction
istrue
, sets whether the next action should also be used in compact view.setUsePlayPauseActions
(boolean usePlayPauseActions) Sets whether the play and pause actions should be used.setUsePreviousAction
(boolean usePreviousAction) Sets whether the previous action should be used.setUsePreviousActionInCompactView
(boolean usePreviousActionInCompactView) IfusePreviousAction
istrue
, sets whether the previous action should also be used in compact view.setUseRewindAction
(boolean useRewindAction) Sets whether the rewind action should be used.setUseRewindActionInCompactView
(boolean useRewindActionInCompactView) Sets whether the rewind action should also be used in compact view.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 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
-
color
protected int color -
priority
protected int priority -
visibility
protected int visibility -
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
The id of the notification channel.- Parameters:
channelId
- The notification channel ID name.- Returns:
- This instance for the chaining of method calls.
-
setAdapter
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
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
The name of the channel.- Returns:
- This instance for the chaining of method calls.
-
setChannelImportance
The importance of the channel.- Returns:
- This instance for the chaining of method calls.
-
setSmallIcon
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
Sets whether the next action should be used.- Parameters:
useNextAction
- Whether to use the next action.
-
setUsePreviousAction
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
Sets whether the fast forward action should be used.- Parameters:
useFastForwardAction
- Whether to use the fast forward action.
-
setUseRewindAction
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
Sets whether the play and pause actions should be used.- Parameters:
usePlayPauseActions
- Whether to use play and pause actions.
-
setColorized
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
Sets the accent color of the notification.See
Notification.Builder.setColor(int)
.- Parameters:
color
- The color, in ARGB integer form.
-
setPriority
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
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
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.
-