[Android] Playback: Preserve 'play as audio' state

Geoffrey Métais git at videolan.org
Fri Dec 6 06:59:03 CET 2019


vlc-android | branch: master | Geoffrey Métais <geoffrey at videolan.org> | Fri Dec  6 06:58:59 2019 +0100| [362d54667966025fd4c575f28664e8fa5a92c006] | committer: Nicolas Pomepuy

Playback: Preserve 'play as audio' state

Fix #1101

> https://code.videolan.org/videolan/vlc-android/commit/362d54667966025fd4c575f28664e8fa5a92c006
---

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

diff --git a/vlc-android/src/org/videolan/vlc/media/PlaylistManager.kt b/vlc-android/src/org/videolan/vlc/media/PlaylistManager.kt
index 3ee5d6762..0a2792ef8 100644
--- a/vlc-android/src/org/videolan/vlc/media/PlaylistManager.kt
+++ b/vlc-android/src/org/videolan/vlc/media/PlaylistManager.kt
@@ -200,7 +200,6 @@ class PlaylistManager(val service: PlaybackService) : MediaWrapperList.EventList
             stop()
             return
         }
-        videoBackground = videoBackground || (!player.isVideoPlaying() && player.canSwitchToVideo())
         launch { playIndex(currentIndex) }
     }
 
@@ -266,6 +265,7 @@ class PlaylistManager(val service: PlaybackService) : MediaWrapperList.EventList
     }
 
     suspend fun playIndex(index: Int, flags: Int = 0) {
+        videoBackground = videoBackground || (!player.isVideoPlaying() && player.canSwitchToVideo())
         if (mediaList.size() == 0) {
             Log.w(TAG, "Warning: empty media list, nothing to play !")
             return



More information about the Android mailing list