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.ObjectThe config used to create the on-going notification and update the notification content.
-
-
Field Summary
Fields Modifier and Type Field Description protected PlaybackNotification.MediaDescriptionAdapteradapterprotected java.lang.StringchannelIdprotected intchannelImportanceprotected intchannelNameResourceIdprotected intcolorprotected booleancolorizedprotected android.content.Contextcontextprotected intnotificationIdprotected BrightcoveNotificationListenernotificationListenerprotected intpriorityprotected intsmallIconResourceIdprotected PlaybackNotification.StreamType[]typesprotected booleanuseFastForwardActionprotected booleanuseFastForwardActionInCompactViewprotected booleanuseNextActionprotected booleanuseNextActionInCompactViewprotected booleanusePlayPauseActionsprotected booleanusePreviousActionprotected booleanusePreviousActionInCompactViewprotected booleanuseRewindActionprotected booleanuseRewindActionInCompactViewprotected intvisibility
-
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.ConfigsetAdapter(PlaybackNotification.MediaDescriptionAdapter adapter)ThePlaybackNotification.MediaDescriptionAdapterto be queried for the notification contents.PlaybackNotification.ConfigsetChannelId(java.lang.String channelId)The id of the notification channel.PlaybackNotification.ConfigsetChannelImportance(int channelImportance)The importance of the channel.PlaybackNotification.ConfigsetChannelNameResourceId(int channelNameResourceId)The name of the channel.PlaybackNotification.ConfigsetColor(int color)Sets the accent color of the notification.PlaybackNotification.ConfigsetColorized(boolean colorized)Sets whether the notification should be colorized.PlaybackNotification.ConfigsetNotificationId(int notificationId)The id of the notification to be posted.PlaybackNotification.ConfigsetNotificationListener(BrightcoveNotificationListener notificationListener)TheBrightcoveNotificationListenerto be used.PlaybackNotification.ConfigsetPriority(int priority)Sets the priority of the notification required for API 25 and lower.PlaybackNotification.ConfigsetSmallIcon(int smallIconResourceId)Sets the small icon of the notification which is also shown in the system status bar.PlaybackNotification.ConfigsetStreamTypes(PlaybackNotification.StreamType... types)Set the types of media to show the playback notification on.PlaybackNotification.ConfigsetUseFastForwardAction(boolean useFastForwardAction)Sets whether the fast forward action should be used.PlaybackNotification.ConfigsetUseFastForwardActionInCompactView(boolean useFastForwardActionInCompactView)Sets whether the fast forward action should also be used in compact view.PlaybackNotification.ConfigsetUseNextAction(boolean useNextAction)Sets whether the next action should be used.PlaybackNotification.ConfigsetUseNextActionInCompactView(boolean useNextActionInCompactView)IfuseNextActionistrue, sets whether the next action should also be used in compact view.PlaybackNotification.ConfigsetUsePlayPauseActions(boolean usePlayPauseActions)Sets whether the play and pause actions should be used.PlaybackNotification.ConfigsetUsePreviousAction(boolean usePreviousAction)Sets whether the previous action should be used.PlaybackNotification.ConfigsetUsePreviousActionInCompactView(boolean usePreviousActionInCompactView)IfusePreviousActionistrue, sets whether the previous action should also be used in compact view.PlaybackNotification.ConfigsetUseRewindAction(boolean useRewindAction)Sets whether the rewind action should be used.PlaybackNotification.ConfigsetUseRewindActionInCompactView(boolean useRewindActionInCompactView)Sets whether the rewind action should also be used in compact view.PlaybackNotification.ConfigsetVisibility(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.MediaDescriptionAdapterto be queried for the notification contents.- Returns:
- This instance for the chaining of method calls.
-
setNotificationListener
public PlaybackNotification.Config setNotificationListener(BrightcoveNotificationListener notificationListener)
TheBrightcoveNotificationListenerto 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)
IfuseNextActionistrue, sets whether the next action should also be used in compact view. Has no effect ifuseNextActionisfalse.If set to
true,setUseFastForwardActionInCompactViewis set to false.- Parameters:
useNextActionInCompactView- Whether to use the next action in compact view.
-
setUsePreviousActionInCompactView
public final PlaybackNotification.Config setUsePreviousActionInCompactView(boolean usePreviousActionInCompactView)
IfusePreviousActionistrue, sets whether the previous action should also be used in compact view. Has no effect ifusePreviousActionisfalse.If set to
true,setUseRewindActionInCompactViewis 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_LOWorNotification.PRIORITY_MIN. If not setNotification.PRIORITY_LOWis 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_PRIVATEorNotification.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.
-
-