-
- All Implemented Interfaces:
-
com.brightcove.player.playback.PlaybackNotification
public final class BackgroundPlaybackNotification extends PlaybackNotificationImpl
Manages the notification displayed with a MediaPlayback.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public class
BackgroundPlaybackNotification.Companion
-
Field Summary
Fields Modifier and Type Field Description private final PlaybackNotification.StreamType
currentlyPlayingStreamType
-
Method Summary
Modifier and Type Method Description final PlaybackNotification.StreamType
getCurrentlyPlayingStreamType()
Unit
setPlayback(MediaPlayback<?> playback)
Set a MediaPlayback to associate the notification MediaPlayback<ExoPlayer>
getPlayback()
Get the MediaPlayback associated with the notification Unit
setConfig(PlaybackNotificationConfig config)
Configure and customize the notification shown for playback. Boolean
show()
Starts a notification immediately unless the player is in an idle state, in which case the notification is started as soon as the player transitions away from being idle. Unit
cancel()
Cancels the notification by setting the player to null
.Boolean
isVisible()
Check is the notification is showing. Unit
setMediaSessionToken(MediaSessionCompat.Token token)
Sets the MediaSessionCompat.Token. -
-
Method Detail
-
getCurrentlyPlayingStreamType
final PlaybackNotification.StreamType getCurrentlyPlayingStreamType()
-
setPlayback
Unit setPlayback(MediaPlayback<?> playback)
Set a MediaPlayback to associate the notification
-
getPlayback
MediaPlayback<ExoPlayer> getPlayback()
Get the MediaPlayback associated with the notification
-
setConfig
Unit setConfig(PlaybackNotificationConfig config)
Configure and customize the notification shown for playback.
- Parameters:
config
- The configuration to build the notification.
-
show
Boolean show()
Starts a notification immediately unless the player is in an idle state, in which case the notification is started as soon as the player transitions away from being idle.
<p> The notification shows if the currently playing {@link StreamType} is one of {@link this#getStreamTypes()}
-
cancel
Unit cancel()
Cancels the notification by setting the player to
null
.This should be called when the player is released.
-
setMediaSessionToken
Unit setMediaSessionToken(MediaSessionCompat.Token token)
Sets the MediaSessionCompat.Token.
- Parameters:
token
- The MediaSessionCompat.Token.
-
-
-
-