[Android] Fix video as audio playback resume

Geoffrey Métais git at videolan.org
Fri Dec 27 09:55:37 CET 2019


vlc-android | branch: 3.2.x | Geoffrey Métais <geoffrey at videolan.org> | Wed Dec 11 09:52:29 2019 +0000| [1ee118fa48c1a2e3076970f6f63bdd790972ffad] | committer: Geoffrey Métais

Fix video as audio playback resume

Fix #1086


(cherry picked from commit ce2abf0aa2eac58945922a53c73174e5b1ece7ae)

> https://code.videolan.org/videolan/vlc-android/commit/1ee118fa48c1a2e3076970f6f63bdd790972ffad
---

 vlc-android/src/org/videolan/vlc/media/PlaylistManager.kt | 3 ++-
 1 file changed, 2 insertions(+), 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 7294fe8a2..8f29159ef 100644
--- a/vlc-android/src/org/videolan/vlc/media/PlaylistManager.kt
+++ b/vlc-android/src/org/videolan/vlc/media/PlaylistManager.kt
@@ -167,6 +167,7 @@ class PlaylistManager(val service: PlaybackService) : MediaWrapperList.EventList
             if (!audio && position < playList.size && settings.getBoolean(VIDEO_PAUSED, false)) {
                 playList[position].addFlags(AbstractMediaWrapper.MEDIA_PAUSED)
             }
+            if (audio) playList[position].addFlags(AbstractMediaWrapper.MEDIA_FORCE_AUDIO)
             load(playList, position, true)
             loadingLastPlaylist = false
             if (!audio) {
@@ -810,7 +811,7 @@ class PlaylistManager(val service: PlaybackService) : MediaWrapperList.EventList
         }
     }
 
-    internal fun isAudioList() = !player.canSwitchToVideo() && mediaList.isAudioList
+    internal fun isAudioList() = !player.isVideoPlaying() && mediaList.isAudioList
 }
 
 class ABRepeat(var start: Long = -1L, var stop: Long = -1L)



More information about the Android mailing list