[Android] Fix video playlist lost on app switch

Geoffrey Métais git at videolan.org
Tue May 23 18:33:46 CEST 2017


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Tue May 23 18:32:54 2017 +0200| [1e0899a744b21a069b7cef78af1b94139ca3a8ea] | committer: Geoffrey Métais

Fix video playlist lost on app switch

Close #276

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

 .../src/org/videolan/vlc/gui/video/VideoPlayerActivity.java      | 9 ++++++---
 1 file changed, 6 insertions(+), 3 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 f6ef78ecd..b6444911f 100644
--- a/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
+++ b/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
@@ -3199,9 +3199,12 @@ public class VideoPlayerActivity extends AppCompatActivity implements IVLCVout.C
                 mService.saveTimeToSeek(savedTime);
 
             // Handle playback
-            if (!hasMedia)
-                mService.load(media);
-            else if (!mService.isPlaying())
+            if (!hasMedia) {
+                if (positionInPlaylist != -1)
+                    mService.loadLastPlaylist(PlaybackService.TYPE_VIDEO);
+                else
+                    mService.load(media);
+            } else if (!mService.isPlaying())
                 mService.playIndex(positionInPlaylist);
             else
                 onPlaying();



More information about the Android mailing list