-
public interface PlaybackNotification
Manages the notification displayed with a MediaPlayback.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public enum
PlaybackNotification.StreamType
Types of media to display an ongoing notification for.
public interface
PlaybackNotification.MediaDescriptionAdapter
An adapter to provide content assets of the media currently playing.
public interface
PlaybackNotification.OnRestorePlaybackHandler
Interface definition used to restore playback when re-creating an activity when the userclicks on the on-going notification.This should be implemented by the Activity. By default, it returns true if thenotification is visible and the activity's intent contains NOTIFICATION.
public class
PlaybackNotification.Extras
Extras set on the PendingIntent in the default implementation of the createCurrentContentIntent.
public class
PlaybackNotification.NotificationImageLoader
public class
PlaybackNotification.NotificationImageTask
-
Method Summary
Modifier and Type Method Description abstract void
setConfig(PlaybackNotificationConfig config)
Configure and customize the notification shown for playback. abstract void
setStreamTypes(Array<PlaybackNotification.StreamType> types)
Set the stream types to show notifications for. abstract Array<PlaybackNotification.StreamType>
getStreamTypes()
Get the supported stream types for showing this notification. abstract boolean
isVisible()
Check is the notification is showing. abstract boolean
show()
Starts a notification immediately unless the player is in an idle state, in whichcase the notification is started as soon as the player transitions away from being idle. abstract void
cancel()
Cancels the notification by setting the player to {@code null}
.abstract void
setPlayback(MediaPlayback<out Object> mediaPlayback)
abstract void
setMediaSessionToken(MediaSessionCompat.Token token)
abstract MediaPlayback<out Object>
getPlayback()
-
-
Method Detail
-
setConfig
abstract void setConfig(PlaybackNotificationConfig config)
Configure and customize the notification shown for playback.
- Parameters:
config
- The configuration to build the notification.
-
setStreamTypes
abstract void setStreamTypes(Array<PlaybackNotification.StreamType> types)
Set the stream types to show notifications for.
- Parameters:
types
- The types of media for notification playback.
-
getStreamTypes
abstract Array<PlaybackNotification.StreamType> getStreamTypes()
Get the supported stream types for showing this notification.
-
isVisible
abstract boolean isVisible()
Check is the notification is showing.
-
show
abstract boolean show()
Starts a notification immediately unless the player is in an idle state, in whichcase the notification is started as soon as the player transitions away from being idle.
The notification shows if the currently playing StreamType is oneof getStreamTypes
-
cancel
abstract void cancel()
Cancels the notification by setting the player to
{@code null}
.This should be called when the player is released.
-
setPlayback
abstract void setPlayback(MediaPlayback<out Object> mediaPlayback)
-
setMediaSessionToken
abstract void setMediaSessionToken(MediaSessionCompat.Token token)
-
getPlayback
abstract MediaPlayback<out Object> getPlayback()
-
-
-
-