[Android] Browser: Open videos directly via VideoPlayerActivity

Thomas Guillem git at videolan.org
Mon May 4 09:30:07 CEST 2015


vlc-ports/android | branch: master | Thomas Guillem <thomas at gllm.fr> | Fri May  1 16:12:55 2015 +0000| [7869073579d1351a4ac908d8a8c7460da558f39b] | committer: Thomas Guillem

Browser: Open videos directly via VideoPlayerActivity

For video, use directly VideoPlayerActivity to avoid to switch from
AudioService.
For audio, open via AudioService with the list of files in the directory.
It's temporary as everything should be opened via a future PlaybackService.

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

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

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 e4d4f0a..ae6dd8d 100644
--- a/vlc-android/src/org/videolan/vlc/gui/browser/BaseBrowserAdapter.java
+++ b/vlc-android/src/org/videolan/vlc/gui/browser/BaseBrowserAdapter.java
@@ -94,7 +94,9 @@ public class BaseBrowserAdapter extends  RecyclerView.Adapter<RecyclerView.ViewH
                     MediaWrapper mw = (MediaWrapper) getItem(holder.getPosition());
                     if (mw.getType() == MediaWrapper.TYPE_DIR)
                         fragment.browse(mw, holder.getPosition());
-                    else {
+                    else if (mw.getType() == MediaWrapper.TYPE_VIDEO) {
+                        Util.openMedia(v.getContext(), mw);
+                    } else {
                         int position = 0;
                         LinkedList<String> mediaLocations = new LinkedList<String>();
                         MediaWrapper mediaItem;



More information about the Android mailing list