[Android] Filter media files to play

Geoffrey Métais git at videolan.org
Thu Apr 30 10:35:19 CEST 2015


vlc-ports/android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Thu Apr 30 10:34:33 2015 +0200| [d6b57c2d6b8d01a49c05b0267b32b50302a4155a] | committer: Geoffrey Métais

Filter media files to play

> http://git.videolan.org/gitweb.cgi/vlc-ports/android.git/?a=commit;h=d6b57c2d6b8d01a49c05b0267b32b50302a4155a
---

 .../src/org/videolan/vlc/gui/browser/BaseBrowserAdapter.java   |    8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/vlc-android/src/org/videolan/vlc/gui/browser/BaseBrowserAdapter.java b/vlc-android/src/org/videolan/vlc/gui/browser/BaseBrowserAdapter.java
index 431658f..e4d4f0a 100644
--- a/vlc-android/src/org/videolan/vlc/gui/browser/BaseBrowserAdapter.java
+++ b/vlc-android/src/org/videolan/vlc/gui/browser/BaseBrowserAdapter.java
@@ -101,9 +101,11 @@ public class BaseBrowserAdapter extends  RecyclerView.Adapter<RecyclerView.ViewH
                         for (Object item : mMediaList)
                             if (item instanceof MediaWrapper){
                                 mediaItem = (MediaWrapper) item;
-                                mediaLocations.add(mediaItem.getLocation());
-                                if (mediaItem.equals(mw))
-                                    position = mediaLocations.size()-1;
+                                if (mediaItem.getType() == MediaWrapper.TYPE_VIDEO || mediaItem.getType() == MediaWrapper.TYPE_AUDIO) {
+                                    mediaLocations.add(mediaItem.getLocation());
+                                    if (mediaItem.equals(mw))
+                                        position = mediaLocations.size()-1;
+                                }
                             }
                         Util.openList(v.getContext(), mediaLocations, position);
                     }



More information about the Android mailing list