[Android] Close video player if needed

Geoffrey Métais git at videolan.org
Tue Mar 12 11:50:58 CET 2019


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Tue Mar 12 11:31:25 2019 +0100| [6bce363c2a40e9b99f3944190eed1b1dda96a971] | committer: Geoffrey Métais

Close video player if needed

> https://code.videolan.org/videolan/vlc-android/commit/6bce363c2a40e9b99f3944190eed1b1dda96a971
---

 vlc-android/src/org/videolan/vlc/media/PlaylistManager.kt | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/vlc-android/src/org/videolan/vlc/media/PlaylistManager.kt b/vlc-android/src/org/videolan/vlc/media/PlaylistManager.kt
index b408a3b7d..7ceb814fe 100644
--- a/vlc-android/src/org/videolan/vlc/media/PlaylistManager.kt
+++ b/vlc-android/src/org/videolan/vlc/media/PlaylistManager.kt
@@ -195,8 +195,6 @@ class PlaylistManager(val service: PlaybackService) : MediaWrapperList.EventList
         currentIndex = nextIndex
         if (size == 0 || currentIndex < 0 || currentIndex >= size) {
             Log.w(TAG, "Warning: invalid next index, aborted !")
-            //Close video player if started
-            LocalBroadcastManager.getInstance(ctx).sendBroadcast(Intent(EXIT_PLAYER))
             stop()
             return
         }
@@ -223,6 +221,8 @@ class PlaylistManager(val service: PlaybackService) : MediaWrapperList.EventList
         showAudioPlayer.value = false
         service.onPlaybackStopped(systemExit)
         medialibrary.resumeBackgroundOperations()
+        //Close video player if started
+        LocalBroadcastManager.getInstance(ctx).sendBroadcast(Intent(EXIT_PLAYER))
     }
 
     @MainThread



More information about the Android mailing list