[Android] Browser: check playlist mode setting to play media

Duncan McNamara git at videolan.org
Tue Jun 7 07:43:05 UTC 2022


vlc-android | branch: master | Duncan McNamara <dcn.mcnamara at gmail.com> | Fri Jun  3 14:29:44 2022 +0200| [5b04adc3967f0ba79394442cbb1583c6189324e8] | committer: Nicolas Pomepuy

Browser: check playlist mode setting to play media

The browser didn't check the video playlist mode before playing media,
calling MediaUtils.openList every time. This adds a check before playing
media so that they can be played individually if video playlist mode is
disabled.

Fixes #2516

> https://code.videolan.org/videolan/vlc-android/commit/5b04adc3967f0ba79394442cbb1583c6189324e8
---

 .../src/org/videolan/vlc/gui/browser/BaseBrowserFragment.kt  | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/application/vlc-android/src/org/videolan/vlc/gui/browser/BaseBrowserFragment.kt b/application/vlc-android/src/org/videolan/vlc/gui/browser/BaseBrowserFragment.kt
index fad826ff7..4eaf7919a 100644
--- a/application/vlc-android/src/org/videolan/vlc/gui/browser/BaseBrowserFragment.kt
+++ b/application/vlc-android/src/org/videolan/vlc/gui/browser/BaseBrowserFragment.kt
@@ -498,7 +498,17 @@ abstract class BaseBrowserFragment : MediaBrowserFragment<BrowserModel>(), IRefr
         } else {
             mediaWrapper.removeFlags(MediaWrapper.MEDIA_FORCE_AUDIO)
             if (mediaWrapper.type == MediaWrapper.TYPE_DIR) browse(mediaWrapper, true)
-            else MediaUtils.openList(v.context, viewModel.dataset.getList().filter { it.itemType !=  MediaWrapper.TYPE_DIR}.map { it as MediaWrapper }, position)
+            else {
+                if (!Settings.getInstance(requireContext()).getBoolean(FORCE_PLAY_ALL, false)) {
+                    MediaUtils.openMedia(requireContext(), item)
+                } else {
+                    MediaUtils.openList(v.context,
+                        viewModel.dataset.getList().filter { it.itemType != MediaWrapper.TYPE_DIR }
+                            .map { it as MediaWrapper },
+                        position
+                    )
+                }
+            }
         }
     }
 



More information about the Android mailing list