[Android] Properly update playback state on playlist end
Geoffrey Métais
git at videolan.org
Thu Aug 24 12:01:35 CEST 2017
vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Thu Aug 24 12:01:08 2017 +0200| [8dbc0b8c9e58d67edae7402cddeb5289e8826fae] | committer: Geoffrey Métais
Properly update playback state on playlist end
> https://code.videolan.org/videolan/vlc-android/commit/8dbc0b8c9e58d67edae7402cddeb5289e8826fae
---
vlc-android/src/org/videolan/vlc/PlaybackService.java | 15 ++++++++++-----
1 file changed, 10 insertions(+), 5 deletions(-)
diff --git a/vlc-android/src/org/videolan/vlc/PlaybackService.java b/vlc-android/src/org/videolan/vlc/PlaybackService.java
index 7a37e5c20..6599ff970 100644
--- a/vlc-android/src/org/videolan/vlc/PlaybackService.java
+++ b/vlc-android/src/org/videolan/vlc/PlaybackService.java
@@ -581,7 +581,7 @@ public class PlaybackService extends MediaBrowserServiceCompat implements IVLCVo
switch (event.type) {
case MediaPlayer.Event.Playing:
loadMediaMeta();
- if(mSavedTime > 0L)
+ if (mSavedTime > 0L)
seek(mSavedTime);
mSavedTime = 0L;
@@ -628,10 +628,15 @@ public class PlaybackService extends MediaBrowserServiceCompat implements IVLCVo
executeUpdateProgress();
previousMediaStats = mMediaPlayer.getMedia().getStats();
determinePrevAndNextIndices(true);
- next();
- if (mWakeLock.isHeld())
- mWakeLock.release();
- changeAudioFocus(false);
+ if (mNextIndex != -1) {
+ next();
+ } else {
+ if (mWakeLock.isHeld())
+ mWakeLock.release();
+ changeAudioFocus(false);
+ executeUpdate();
+ publishState();
+ }
break;
case MediaPlayer.Event.EncounteredError:
showToast(getString(
More information about the Android
mailing list