diff --git a/app/src/main/java/org/oxycblt/auxio/playback/system/MediaSessionComponent.kt b/app/src/main/java/org/oxycblt/auxio/playback/system/MediaSessionComponent.kt index 9a9bb9490..0e95243f8 100644 --- a/app/src/main/java/org/oxycblt/auxio/playback/system/MediaSessionComponent.kt +++ b/app/src/main/java/org/oxycblt/auxio/playback/system/MediaSessionComponent.kt @@ -180,12 +180,14 @@ class MediaSessionComponent( private fun updateQueue(queue: List) { val queueItems = queue.mapIndexed { i, song -> + // Since we usually have to load many songs into the queue, use the Cover URI + // instead of loading a bitmap. val description = MediaDescriptionCompat.Builder() .setMediaId(song.id.toString()) .setTitle(song.resolveName(context)) .setSubtitle(song.resolveIndividualArtistName(context)) - .setIconUri(song.album.coverUri) // Use lower-quality covers for speed + .setIconUri(song.album.coverUri) .setMediaUri(song.uri) .build() @@ -300,6 +302,12 @@ class MediaSessionComponent( settings) } + override fun onSkipToQueueItem(id: Long) { + if (id in playbackManager.queue.indices) { + playbackManager.goto(id.toInt()) + } + } + override fun onStop() { // Get the service to shut down with the ACTION_EXIT intent context.sendBroadcast(Intent(PlaybackService.ACTION_EXIT)) @@ -361,6 +369,7 @@ class MediaSessionComponent( PlaybackStateCompat.ACTION_SET_SHUFFLE_MODE or PlaybackStateCompat.ACTION_SKIP_TO_NEXT or PlaybackStateCompat.ACTION_SKIP_TO_PREVIOUS or + PlaybackStateCompat.ACTION_SKIP_TO_QUEUE_ITEM or PlaybackStateCompat.ACTION_SEEK_TO or PlaybackStateCompat.ACTION_STOP } diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 350240898..5492ee937 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -184,7 +184,7 @@ Save playback state Save the current playback state now Clear playback state - Wipe the previously saved playback state (if any) + Clear the previously saved playback state (if any) Restore playback state Restore the previously saved playback state (if any) Reload music