[Android] TV: Launch audio player when first media is audio
Geoffrey Métais
git at videolan.org
Tue Jun 14 11:01:30 CEST 2016
vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Tue Jun 14 09:46:22 2016 +0200| [3eddcaf1850150efcd496efe7cbe091507508463] | committer: Geoffrey Métais
TV: Launch audio player when first media is audio
> https://code.videolan.org/videolan/vlc-android/commit/3eddcaf1850150efcd496efe7cbe091507508463
---
.../src/org/videolan/vlc/gui/tv/MediaItemDetailsFragment.java | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/vlc-android/src/org/videolan/vlc/gui/tv/MediaItemDetailsFragment.java b/vlc-android/src/org/videolan/vlc/gui/tv/MediaItemDetailsFragment.java
index 6abfc2e..6330752 100644
--- a/vlc-android/src/org/videolan/vlc/gui/tv/MediaItemDetailsFragment.java
+++ b/vlc-android/src/org/videolan/vlc/gui/tv/MediaItemDetailsFragment.java
@@ -21,6 +21,8 @@
package org.videolan.vlc.gui.tv;
import android.annotation.TargetApi;
+import android.app.Activity;
+import android.content.Intent;
import android.content.res.Resources;
import android.graphics.Bitmap;
import android.net.Uri;
@@ -45,6 +47,7 @@ import org.videolan.vlc.VLCApplication;
import org.videolan.vlc.gui.PlaybackServiceFragment;
import org.videolan.vlc.gui.helpers.AudioUtil;
import org.videolan.vlc.gui.helpers.BitmapUtil;
+import org.videolan.vlc.gui.tv.audioplayer.AudioPlayerActivity;
import org.videolan.vlc.gui.tv.browser.SortedBrowserFragment;
import org.videolan.vlc.media.MediaDatabase;
import org.videolan.vlc.media.MediaLibrary;
@@ -147,7 +150,10 @@ public class MediaItemDetailsFragment extends DetailsFragment implements Playbac
for (int i= 0; i < mediaList.size(); ++i)
if (media.equals(mediaList.get(i)))
position = i;
- MediaUtils.openList(getActivity(), mediaList, position);
+ Activity activity = getActivity();
+ MediaUtils.openList(activity, mediaList, position);
+ if (media.getType() == MediaWrapper.TYPE_AUDIO)
+ getActivity().startActivity(new Intent(activity, AudioPlayerActivity.class));
break;
}
}
More information about the Android
mailing list