bump media3 version
This commit is contained in:
parent
c6e107fdd0
commit
1b2b40b64a
@ -78,7 +78,7 @@ dependencies {
|
||||
|
||||
implementation "com.squareup.okhttp3:okhttp:4.9.0"
|
||||
|
||||
def media3_version = '1.0.0-alpha02'
|
||||
def media3_version = '1.0.0-alpha03'
|
||||
implementation "androidx.media3:media3-ui:$media3_version"
|
||||
implementation "androidx.media3:media3-exoplayer:$media3_version"
|
||||
implementation "androidx.media3:media3-session:$media3_version"
|
||||
|
@ -59,6 +59,21 @@ class PlaybackService : MediaLibraryService() {
|
||||
}
|
||||
}
|
||||
|
||||
class CustomMediaItemFiller : MediaSession.MediaItemFiller {
|
||||
override fun fillInLocalConfiguration(
|
||||
session: MediaSession,
|
||||
controller: MediaSession.ControllerInfo,
|
||||
mediaItem: MediaItem
|
||||
): MediaItem {
|
||||
// Return the media item that it will be played
|
||||
return MediaItem.Builder()
|
||||
// Use the metadata values to fill our media item
|
||||
.setUri(mediaItem.mediaMetadata.mediaUri)
|
||||
.setMediaMetadata(mediaItem.mediaMetadata)
|
||||
.build()
|
||||
}
|
||||
}
|
||||
|
||||
override fun onGetSession(controllerInfo: MediaSession.ControllerInfo): MediaLibrarySession {
|
||||
return mediaLibrarySession
|
||||
}
|
||||
@ -92,7 +107,7 @@ class PlaybackService : MediaLibraryService() {
|
||||
|
||||
mediaLibrarySession =
|
||||
MediaLibrarySession.Builder(this, player, librarySessionCallback)
|
||||
// .setMediaItemFiller(CustomMediaItemFiller())
|
||||
.setMediaItemFiller(CustomMediaItemFiller())
|
||||
.setSessionActivity(pendingIntent!!)
|
||||
.build()
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user