[Android] Disable the playback speed advanced option on renderers as it's not supported

Nicolas Pomepuy git at videolan.org
Thu May 20 08:26:47 UTC 2021


vlc-android | branch: master | Nicolas Pomepuy <nicolas at videolabs.io> | Wed May 19 09:25:55 2021 +0200| [ce05ea6184fd5ab291263d09156d3350cd0842ca] | committer: Nicolas Pomepuy

Disable the playback speed advanced option on renderers as it's not supported

Fixes #2023

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

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

diff --git a/application/vlc-android/src/org/videolan/vlc/gui/helpers/PlayerOptionsDelegate.kt b/application/vlc-android/src/org/videolan/vlc/gui/helpers/PlayerOptionsDelegate.kt
index d1068d5b7..91d693ea2 100644
--- a/application/vlc-android/src/org/videolan/vlc/gui/helpers/PlayerOptionsDelegate.kt
+++ b/application/vlc-android/src/org/videolan/vlc/gui/helpers/PlayerOptionsDelegate.kt
@@ -67,6 +67,7 @@ class PlayerOptionsDelegate(val activity: FragmentActivity, val service: Playbac
     private val toast by lazy(LazyThreadSafetyMode.NONE) { Toast.makeText(activity, "", Toast.LENGTH_SHORT) }
 
     private val primary = activity is VideoPlayerActivity && activity.displayManager.isPrimary
+    private val isChromecast = activity is VideoPlayerActivity && activity.displayManager.isOnRenderer
     private val video = activity is VideoPlayerActivity
     private val res = activity.resources
     private val settings = Settings.getInstance(activity)
@@ -94,7 +95,7 @@ class PlayerOptionsDelegate(val activity: FragmentActivity, val service: Playbac
         val options = mutableListOf<PlayerOption>()
         if (video) options.add(PlayerOption(ID_LOCK_PLAYER, R.attr.ic_lock_player, res.getString(R.string.lock)))
         options.add(PlayerOption(ID_SLEEP, R.attr.ic_sleep_normal_style, res.getString(R.string.sleep_title)))
-        options.add(PlayerOption(ID_PLAYBACK_SPEED, R.attr.ic_speed_normal_style, res.getString(R.string.playback_speed)))
+        if (!isChromecast) options.add(PlayerOption(ID_PLAYBACK_SPEED, R.attr.ic_speed_normal_style, res.getString(R.string.playback_speed)))
         options.add(PlayerOption(ID_JUMP_TO, R.attr.ic_jumpto_normal_style, res.getString(R.string.jump_to_time)))
         options.add(PlayerOption(ID_EQUALIZER, R.attr.ic_equalizer_normal_style, res.getString(R.string.equalizer)))
         if (video) {



More information about the Android mailing list