[Android] Remove playlist actions on 'Stopped' player event
Geoffrey Métais
git at videolan.org
Fri Feb 2 11:46:48 CET 2018
vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Fri Feb 2 11:24:05 2018 +0100| [ac70d21c6f3e8fb59fa6f40d218b7c73d4abb1c3] | committer: Geoffrey Métais
Remove playlist actions on 'Stopped' player event
> https://code.videolan.org/videolan/vlc-android/commit/ac70d21c6f3e8fb59fa6f40d218b7c73d4abb1c3
---
vlc-android/src/org/videolan/vlc/PlaybackService.java | 4 ----
vlc-android/src/org/videolan/vlc/media/PlayerController.kt | 3 ++-
vlc-android/src/org/videolan/vlc/media/PlaylistManager.kt | 5 -----
3 files changed, 2 insertions(+), 10 deletions(-)
diff --git a/vlc-android/src/org/videolan/vlc/PlaybackService.java b/vlc-android/src/org/videolan/vlc/PlaybackService.java
index 1a0d3efad..11c375123 100644
--- a/vlc-android/src/org/videolan/vlc/PlaybackService.java
+++ b/vlc-android/src/org/videolan/vlc/PlaybackService.java
@@ -515,10 +515,6 @@ public class PlaybackService extends MediaBrowserServiceCompat{
mHandler.removeMessages(SHOW_PROGRESS);
if (mWakeLock.isHeld()) mWakeLock.release();
break;
- case MediaPlayer.Event.Stopped:
- if (BuildConfig.DEBUG) Log.i(TAG, "MediaPlayer.Event.Stopped");
- onPlaybackStopped();
- break;
case MediaPlayer.Event.EndReached:
executeUpdateProgress();
break;
diff --git a/vlc-android/src/org/videolan/vlc/media/PlayerController.kt b/vlc-android/src/org/videolan/vlc/media/PlayerController.kt
index 44fe9a24a..8185de7fd 100644
--- a/vlc-android/src/org/videolan/vlc/media/PlayerController.kt
+++ b/vlc-android/src/org/videolan/vlc/media/PlayerController.kt
@@ -50,6 +50,7 @@ class PlayerController : IVLCVout.Callback, MediaPlayer.EventListener {
fun stop() {
if (mediaplayer.hasMedia()) mediaplayer.stop()
+ playbackState = PlaybackStateCompat.STATE_STOPPED
}
fun releaseMedia() = mediaplayer.media?.let {
@@ -249,7 +250,7 @@ class PlayerController : IVLCVout.Callback, MediaPlayer.EventListener {
when(event.type) {
MediaPlayer.Event.Playing -> playbackState = PlaybackStateCompat.STATE_PLAYING
MediaPlayer.Event.Paused -> playbackState = PlaybackStateCompat.STATE_PAUSED
- MediaPlayer.Event.Stopped,
+ MediaPlayer.Event.Stopped -> return
MediaPlayer.Event.EncounteredError,
MediaPlayer.Event.EndReached -> playbackState = PlaybackStateCompat.STATE_STOPPED
MediaPlayer.Event.PausableChanged -> pausable = event.pausable
diff --git a/vlc-android/src/org/videolan/vlc/media/PlaylistManager.kt b/vlc-android/src/org/videolan/vlc/media/PlaylistManager.kt
index 4bf78b06f..8467aed9e 100644
--- a/vlc-android/src/org/videolan/vlc/media/PlaylistManager.kt
+++ b/vlc-android/src/org/videolan/vlc/media/PlaylistManager.kt
@@ -652,11 +652,6 @@ class PlaylistManager(val service: PlaybackService) : MediaWrapperList.EventList
}
}
MediaPlayer.Event.Paused -> medialibrary.resumeBackgroundOperations()
- MediaPlayer.Event.Stopped -> {
- medialibrary.resumeBackgroundOperations()
- currentIndex = -1
- mediaList.clear()
- }
MediaPlayer.Event.EndReached -> {
saveMediaMeta()
if (isBenchmark) player.setPreviousStats()
More information about the Android
mailing list