[Android] TV: Try to open files from unknown types

Geoffrey Métais git at videolan.org
Wed May 24 14:03:30 CEST 2017


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Wed May 24 14:01:47 2017 +0200| [e3641f236d62b87e5846d5ec5d41d801e0908c55] | committer: Geoffrey Métais

TV: Try to open files from unknown types

Close #252

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

 vlc-android/src/org/videolan/vlc/gui/tv/TvUtil.java | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/vlc-android/src/org/videolan/vlc/gui/tv/TvUtil.java b/vlc-android/src/org/videolan/vlc/gui/tv/TvUtil.java
index 48310fd69..d275febdd 100644
--- a/vlc-android/src/org/videolan/vlc/gui/tv/TvUtil.java
+++ b/vlc-android/src/org/videolan/vlc/gui/tv/TvUtil.java
@@ -1,7 +1,7 @@
 /*****************************************************************************
  * TvUtil.java
  *****************************************************************************
- * Copyright © 2014-2015 VLC authors, VideoLAN and VideoLabs
+ * Copyright © 2014-2017 VLC authors, VideoLAN and VideoLabs
  * Author: Geoffrey Métais
  *
  * This program is free software; you can redistribute it and/or modify
@@ -66,15 +66,15 @@ public class TvUtil {
     public static void openMedia(Activity activity, Object item , Row row){
         if (item instanceof MediaWrapper) {
             MediaWrapper mediaWrapper = (MediaWrapper) item;
-            if (mediaWrapper.getType() == MediaWrapper.TYPE_VIDEO) {
-                MediaUtils.openMedia(activity, mediaWrapper);
-            } else if (mediaWrapper.getType() == MediaWrapper.TYPE_AUDIO) {
+            if (mediaWrapper.getType() == MediaWrapper.TYPE_AUDIO) {
                 showMediaDetail(activity, mediaWrapper);
             } else if (mediaWrapper.getType() == MediaWrapper.TYPE_DIR){
                 Intent intent = new Intent(activity, VerticalGridActivity.class);
                 intent.putExtra(MainTvActivity.BROWSER_TYPE, MainTvActivity.HEADER_NETWORK);
                 intent.setData(mediaWrapper.getUri());
                 activity.startActivity(intent);
+            } else {
+                MediaUtils.openMedia(activity, mediaWrapper);
             }
         } else if (item instanceof CardPresenter.SimpleCard){
             if (((CardPresenter.SimpleCard) item).getId() == MainTvActivity.HEADER_STREAM) {



More information about the Android mailing list