[Android] Start vieoplayer directly in videos

Geoffrey Métais git at videolan.org
Tue Dec 20 16:03:56 CET 2016


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Tue Dec 20 14:52:22 2016 +0100| [f79d4cb878dd9f731fa08e87183fbcbc5fb7af08] | committer: Geoffrey Métais

Start vieoplayer directly in videos

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

 vlc-android/src/org/videolan/vlc/gui/video/VideoGridFragment.java | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/vlc-android/src/org/videolan/vlc/gui/video/VideoGridFragment.java b/vlc-android/src/org/videolan/vlc/gui/video/VideoGridFragment.java
index 0534984..a919abc 100644
--- a/vlc-android/src/org/videolan/vlc/gui/video/VideoGridFragment.java
+++ b/vlc-android/src/org/videolan/vlc/gui/video/VideoGridFragment.java
@@ -60,8 +60,10 @@ import org.videolan.medialibrary.interfaces.MediaAddedCb;
 import org.videolan.medialibrary.interfaces.MediaUpdatedCb;
 import org.videolan.medialibrary.media.MediaLibraryItem;
 import org.videolan.medialibrary.media.MediaWrapper;
+import org.videolan.vlc.PlaybackService;
 import org.videolan.vlc.R;
 import org.videolan.vlc.VLCApplication;
+import org.videolan.vlc.gui.AudioPlayerContainerActivity;
 import org.videolan.vlc.gui.MainActivity;
 import org.videolan.vlc.gui.SecondaryActivity;
 import org.videolan.vlc.gui.browser.MediaBrowserFragment;
@@ -603,7 +605,9 @@ public class VideoGridFragment extends MediaBrowserFragment implements MediaUpda
                     ArrayList<MediaWrapper> playList = new ArrayList<>();
                     MediaUtils.openList(activity, playList, mVideoAdapter.getListWithPosition(playList, position));
                 } else {
-                    MediaUtils.openMedia(activity, media);
+                    if (activity instanceof PlaybackService.Callback)
+                        mService.removeCallback((PlaybackService.Callback) activity);
+                    VideoPlayerActivity.start(activity, media.getUri());
                 }
             }
     }



More information about the Android mailing list