[Android] Player options: Check playback is not stopped

Geoffrey Métais git at videolan.org
Mon Feb 18 18:15:46 CET 2019


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Mon Feb 18 18:06:12 2019 +0100| [ced2c2831ba9d34a3c32983a518b0242e77c1bca] | committer: Geoffrey Métais

Player options: Check playback is not stopped

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

 vlc-android/src/org/videolan/vlc/gui/helpers/PlayerOptionsDelegate.kt | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/vlc-android/src/org/videolan/vlc/gui/helpers/PlayerOptionsDelegate.kt b/vlc-android/src/org/videolan/vlc/gui/helpers/PlayerOptionsDelegate.kt
index 39c63219e..6dfe568a0 100644
--- a/vlc-android/src/org/videolan/vlc/gui/helpers/PlayerOptionsDelegate.kt
+++ b/vlc-android/src/org/videolan/vlc/gui/helpers/PlayerOptionsDelegate.kt
@@ -5,6 +5,7 @@ import android.app.AlarmManager
 import android.app.PendingIntent
 import android.content.Context
 import android.content.Intent
+import android.support.v4.media.session.PlaybackStateCompat
 import android.text.format.DateFormat
 import android.view.LayoutInflater
 import android.view.View
@@ -93,7 +94,7 @@ class PlayerOptionsDelegate(val activity: AppCompatActivity, val service: Playba
     }
 
     fun setup() {
-        if (!this::recyclerview.isInitialized) return
+        if (!this::recyclerview.isInitialized || service.playlistManager.player.playbackState == PlaybackStateCompat.STATE_STOPPED) return
         val options = mutableListOf<PlayerOption>()
         when (playerOptionType) {
             PlayerOptionType.ADVANCED -> {



More information about the Android mailing list