[Android] Video: consume fromStart option after the video starts

Alexandre Perraud git at videolan.org
Mon Jul 28 15:58:37 CEST 2014


vlc-ports/android | branch: master | Alexandre Perraud <4leyx4ndre at gmail.com> | Mon Jul 28 15:28:32 2014 +0200| [23e6b704ab68afd8f2b4aae4f67d615a2d8127e1] | committer: Edward Wang

Video: consume fromStart option after the video starts

Fix "the restart from the start again" bug when the screen goes off

Signed-off-by: Edward Wang <edward.c.wang at compdigitec.com>

> http://git.videolan.org/gitweb.cgi/vlc-ports/android.git/?a=commit;h=23e6b704ab68afd8f2b4aae4f67d615a2d8127e1
---

 vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java |    3 +++
 1 file changed, 3 insertions(+)

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 67e551a..86cf5de 100644
--- a/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
+++ b/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
@@ -1956,6 +1956,9 @@ public class VideoPlayerActivity extends Activity implements IVideoPlayer {
                 // in media library
                 if(media.getTime() > 0 && !fromStart)
                     mLibVLC.setTime(media.getTime());
+                // Consume fromStart option after first use to prevent
+                // restarting again when playback is paused.
+                getIntent().putExtra("fromStart", false);
 
                 mLastAudioTrack = media.getAudioTrack();
                 mLastSpuTrack = media.getSpuTrack();



More information about the Android mailing list