AudioPlayerBuilder
A builder for creating Player instances configured for audio playback.
This builder extends MediaPlaylistPlayerBuilder and is specialized for creating players that handle audio-only content, including support for background playback and integration with Android Auto head units. It allows for the configuration of player properties such as notifications and specific flags for automotive use cases.
Example usage:
val audioPlayer = AudioPlayerBuilder()
.addMedia(mediaPlaylistItem)
.isPlayerForHeadUnit(true)
.playerNotificationProperties(notificationProperties)
.build(applicationContext)Also note that if a specific functionality is required such as starting the playback from a bookmark position you must provide that functionality using com.quickplay.vstb7.player.model.PlaybackProperties at player's build time.
Example:
val mediaPlaylistItem = MediaPlaylistItem.Builder(baseConfiguration).build()
val playbackProperties = PlaybackProperties()
playbackProperties.initialStartTimeMs = 60000L
val audioPlayer = AudioPlayerBuilder()
.mediaPlaylistItem(mediaPlaylistItem)
.playbackProperties(playbackProperties)
.build(applicationContext)Functions
Sets custom headers used by Player's data source when making HTTP requests. By default it is null.
SetsDecoderConfiguration to configure Player's decoder.
Enables SecurityPolicy.SecurityChecks.
Indicates whether the media session should be excluded from creation. By default, QP Player is pre-integrated with MediaSession to ensure compliance with system media controls and voice control features like Google Assistant.
This flag should be set if the auto head unit creates QPPlayer and listen to its event to use the Bookmark, Heartbeat capabilities.
Sets initial MediaPlaylistItem. Additional MediaPlaylistItems can be added using Player's MediaPlaylistControllable API.
Sets collection of MediaPlaylistItems used for sequential playback with optional PlaylistPreloadConfiguration. When the PlaylistPreloadConfiguration.preloadingDurationMs is specified and greater than DEFAULT_LONG_VAL the player tries to preload preloadingDurationMs e.g. five seconds of media for the next item in the playlist. Note that if you decide not to provide the PlaylistPreloadConfiguration instance the playlist media preloading is disabled. For convenience, PlaylistPreloadConfiguration provides default values for the configuration properties.
Configures the NetworkStack to be used for the playback. Default value is NetworkStack.BUILT_IN.
Configures PlaybackProperties to apply for playback customization/optimization.
Sets PlayerNotificationProperties to control how lock screen notifications should look like.
Sets the preferred audio language and associated track properties for the media player.
Sets the preferred language for subtitles.
Sets the surface to render the video into.
Sets the view to render the video into.
Enables/disables repeated playback when stream reaches the end.
Set the seeking behaviour of the player.