Package com.brightcove.player.playback
Interface PlaybackNotification.MediaDescriptionAdapter
- Enclosing class:
- PlaybackNotification
public static interface PlaybackNotification.MediaDescriptionAdapter
An adapter to provide content assets of the media currently playing.
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic interface
Callback invoked when the image is loaded and ready to display in the notification. -
Method Summary
Modifier and TypeMethodDescriptiondefault android.app.PendingIntent
createCurrentContentIntent
(MediaPlayback<?> playback) Creates a content intent for the current media item.default CharSequence
getCurrentContentText
(MediaPlayback<?> playback) Gets the content text for the current media item.default CharSequence
getCurrentContentTitle
(MediaPlayback<?> playback) Gets the content title for the current media item.default android.graphics.Bitmap
getCurrentLargeIcon
(MediaPlayback<?> playback, PlaybackNotification.MediaDescriptionAdapter.BitmapCallback callback) Gets the large icon for the current media item.default CharSequence
getCurrentSubText
(MediaPlayback<?> playback) Gets the content sub text for the current media item.
-
Method Details
-
getCurrentContentTitle
Gets the content title for the current media item.See
Notification.Builder.setContentTitle(CharSequence)
.- Parameters:
playback
- The link PlMediaPlayback} for which a notification is being built. - Returns:
- The content title for the current media item.
-
createCurrentContentIntent
Creates a content intent for the current media item.See
Notification.Builder.setContentIntent(PendingIntent)
.- Parameters:
playback
- The link PlMediaPlayback} for which a notification is being built. - Returns:
- The content intent for the current media item, or null if no intent should be fired.
-
getCurrentContentText
Gets the content text for the current media item.See
Notification.Builder.setContentText(CharSequence)
.- Parameters:
playback
- The link PlMediaPlayback} for which a notification is being built. - Returns:
- The content text for the current media item, or null if no context text should be displayed.
-
getCurrentSubText
Gets the content sub text for the current media item.See
Notification.Builder.setSubText(CharSequence)
.- Parameters:
playback
- The link PlMediaPlayback} for which a notification is being built. - Returns:
- The content subtext for the current media item, or null if no subtext should be displayed.
-
getCurrentLargeIcon
@Nullable default android.graphics.Bitmap getCurrentLargeIcon(MediaPlayback<?> playback, PlaybackNotification.MediaDescriptionAdapter.BitmapCallback callback) Gets the large icon for the current media item.When a bitmap needs to be loaded asynchronously, a placeholder bitmap (or null) should be returned. The actual bitmap should be passed to the
PlaybackNotification.MediaDescriptionAdapter.BitmapCallback
once it has been loaded. Because the adapter may be called multiple times for the same media item, bitmaps should be cached by the app and returned synchronously when possible.See
Notification.Builder.setLargeIcon(Bitmap)
.- Parameters:
playback
- TheMediaPlayback
for which a notification is being built.callback
- APlaybackNotification.MediaDescriptionAdapter.BitmapCallback
to provide aBitmap
asynchronously.- Returns:
- The large icon for the current media item, or null if the icon will be returned
through the
PlaybackNotification.MediaDescriptionAdapter.BitmapCallback
or if no icon should be displayed.
-