[Android] Fix play video from start ctx option
Geoffrey Métais
git at videolan.org
Fri Dec 23 11:13:32 CET 2016
vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Wed Dec 21 17:26:44 2016 +0100| [55f53d0b0c306bb0d21631161fe3ff74775355a3] | committer: Geoffrey Métais
Fix play video from start ctx option
> https://code.videolan.org/videolan/vlc-android/commit/55f53d0b0c306bb0d21631161fe3ff74775355a3
---
vlc-android/src/org/videolan/vlc/gui/video/VideoGridFragment.java | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
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 3ddb3a4..ace58d3 100644
--- a/vlc-android/src/org/videolan/vlc/gui/video/VideoGridFragment.java
+++ b/vlc-android/src/org/videolan/vlc/gui/video/VideoGridFragment.java
@@ -233,6 +233,9 @@ public class VideoGridFragment extends MediaBrowserFragment implements MediaUpda
protected void playVideo(MediaWrapper media, boolean fromStart) {
+ Activity activity = getActivity();
+ if (activity instanceof PlaybackService.Callback)
+ mService.removeCallback((PlaybackService.Callback) activity);
media.removeFlags(MediaWrapper.MEDIA_FORCE_AUDIO);
VideoPlayerActivity.start(getActivity(), media.getUri(), fromStart);
}
@@ -604,9 +607,7 @@ public class VideoGridFragment extends MediaBrowserFragment implements MediaUpda
ArrayList<MediaWrapper> playList = new ArrayList<>();
MediaUtils.openList(activity, playList, mVideoAdapter.getListWithPosition(playList, position));
} else {
- if (activity instanceof PlaybackService.Callback)
- mService.removeCallback((PlaybackService.Callback) activity);
- VideoPlayerActivity.start(activity, media.getUri());
+ playVideo(media, false);
}
}
}
More information about the Android
mailing list