[Android] Prevent seek when restoring video playback
Geoffrey Métais
git at videolan.org
Tue Apr 19 17:07:55 CEST 2016
vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Tue Apr 19 17:06:24 2016 +0200| [e72dc1c6ba8ec1a9d3bb944e4d81848b6f3d8ba3] | committer: Geoffrey Métais
Prevent seek when restoring video playback
> https://code.videolan.org/videolan/vlc-android/commit/e72dc1c6ba8ec1a9d3bb944e4d81848b6f3d8ba3
---
.../videolan/vlc/gui/video/VideoPlayerActivity.java | 19 ++++++++++++-------
1 file changed, 12 insertions(+), 7 deletions(-)
diff --git a/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java b/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
index 196a70b..d5965dd 100644
--- a/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
+++ b/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
@@ -2848,20 +2848,25 @@ public class VideoPlayerActivity extends AppCompatActivity implements IVLCVout.C
media.removeFlags(MediaWrapper.MEDIA_FORCE_AUDIO);
media.addFlags(MediaWrapper.MEDIA_VIDEO);
+ boolean seek = true;
// Handle playback
if (!hasMedia)
mService.load(media);
else if (!mService.isPlaying())
mService.playIndex(positionInPlaylist);
- else
+ else {
+ seek = false;
onPlaying();
+ }
- // Set time
- long resumeTime = intentPosition;
- if (intentPosition <= 0 && media != null && media.getTime() > 0l)
- resumeTime = media.getTime();
- if (resumeTime > 0)
- seek(resumeTime);
+ if (seek) {
+ // Set time
+ long resumeTime = intentPosition;
+ if (intentPosition <= 0 && media != null && media.getTime() > 0l)
+ resumeTime = media.getTime();
+ if (resumeTime > 0)
+ seek(resumeTime);
+ }
// Get possible subtitles
getSubtitles();
More information about the Android
mailing list