Commit ac70d21c authored by Geoffrey Métais's avatar Geoffrey Métais

Remove playlist actions on 'Stopped' player event

parent 4fd26aa8
......@@ -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;
......
......@@ -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
......
......@@ -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()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment