[Android] Resume: load any playlist type when background playback is enabled

Duncan McNamara git at videolan.org
Tue Feb 20 08:23:25 UTC 2024


vlc-android | branch: master | Duncan McNamara <dcn.mcnamara at gmail.com> | Mon Jan 29 16:57:51 2024 +0100| [836e6d6c0c3b3e358bec546c7ecc9f8cdbf07650] | committer: Nicolas Pomepuy

Resume: load any playlist type when background playback is enabled

> https://code.videolan.org/videolan/vlc-android/commit/836e6d6c0c3b3e358bec546c7ecc9f8cdbf07650
---

 application/vlc-android/src/org/videolan/vlc/PlaybackService.kt | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/application/vlc-android/src/org/videolan/vlc/PlaybackService.kt b/application/vlc-android/src/org/videolan/vlc/PlaybackService.kt
index 4fc1338e1e..c0ead335ab 100644
--- a/application/vlc-android/src/org/videolan/vlc/PlaybackService.kt
+++ b/application/vlc-android/src/org/videolan/vlc/PlaybackService.kt
@@ -1249,7 +1249,12 @@ class PlaybackService : MediaBrowserServiceCompat(), LifecycleOwner, CoroutineSc
     }
 
     private fun loadLastAudioPlaylist() {
-        if (!AndroidDevices.isAndroidTv) loadLastPlaylist(PLAYLIST_TYPE_AUDIO)
+        if (!AndroidDevices.isAndroidTv) {
+            // If playback in background is enabled it should load the last media of any type
+            // not only audio
+            val playlistType = if (settings.getString(KEY_VIDEO_APP_SWITCH, "0") == "1") PLAYLIST_TYPE_ALL else PLAYLIST_TYPE_AUDIO
+            loadLastPlaylist(playlistType)
+        }
     }
 
     fun loadLastPlaylist(type: Int) {



More information about the Android mailing list