[Android] Open audio from 3rd party without UI

Geoffrey Métais git at videolan.org
Wed Jul 6 11:51:22 CEST 2016


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Wed Jul  6 11:32:55 2016 +0200| [5006b7e448b4f40b3b00d5af68e69daf7cdcc161] | committer: Geoffrey Métais

Open audio from 3rd party without UI

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

 vlc-android/src/org/videolan/vlc/StartActivity.java    | 2 +-
 vlc-android/src/org/videolan/vlc/media/MediaUtils.java | 5 +++++
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/vlc-android/src/org/videolan/vlc/StartActivity.java b/vlc-android/src/org/videolan/vlc/StartActivity.java
index 3d92a9d..241d5c6 100644
--- a/vlc-android/src/org/videolan/vlc/StartActivity.java
+++ b/vlc-android/src/org/videolan/vlc/StartActivity.java
@@ -61,7 +61,7 @@ public class StartActivity extends Activity {
             if (intent.getType() != null && intent.getType().startsWith("video"))
                 startActivity(intent.setClass(this, VideoPlayerActivity.class));
             else
-                MediaUtils.openUri(this, intent.getData());
+                MediaUtils.openMediaNoUi(intent.getData());
         } else if (intent != null && TextUtils.equals(intent.getAction(), AudioPlayerContainerActivity.ACTION_SHOW_PLAYER)) {
             startActivity(new Intent(this, VLCApplication.showTvUi() ? AudioPlayerActivity.class : MainActivity.class));
         } else
diff --git a/vlc-android/src/org/videolan/vlc/media/MediaUtils.java b/vlc-android/src/org/videolan/vlc/media/MediaUtils.java
index 10dfa00..e7f28dd 100644
--- a/vlc-android/src/org/videolan/vlc/media/MediaUtils.java
+++ b/vlc-android/src/org/videolan/vlc/media/MediaUtils.java
@@ -92,6 +92,11 @@ public class MediaUtils {
         });
     }
 
+    public static void openMediaNoUi(Uri uri){
+        final MediaWrapper media = new MediaWrapper(uri);
+        openMediaNoUi(VLCApplication.getAppContext(), media);
+    }
+
     public static void openMediaNoUi(final Context context, final MediaWrapper media){
         if (media == null)
             return;



More information about the Android mailing list