[Android] Avoid showing Playback speed option if video is not seekable

Nicolas Pomepuy git at videolan.org
Thu Jul 11 09:45:52 CEST 2019


vlc-android | branch: master | Nicolas Pomepuy <nicolas.pomepuy at gmail.com> | Thu Jul 11 09:27:40 2019 +0200| [131a30da819239c38b118ec7355c458d288c4496] | committer: Nicolas Pomepuy

Avoid showing Playback speed option if video is not seekable

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

 vlc-android/src/org/videolan/vlc/gui/helpers/PlayerOptionsDelegate.kt | 4 +++-
 1 file changed, 3 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 80127bb6f..43560a104 100644
--- a/vlc-android/src/org/videolan/vlc/gui/helpers/PlayerOptionsDelegate.kt
+++ b/vlc-android/src/org/videolan/vlc/gui/helpers/PlayerOptionsDelegate.kt
@@ -97,7 +97,9 @@ class PlayerOptionsDelegate(val activity: AppCompatActivity, val service: Playba
         when (playerOptionType) {
             PlayerOptionType.ADVANCED -> {
                 options.add(PlayerOption(playerOptionType, ID_SLEEP, R.attr.ic_sleep_normal_style, res.getString(R.string.sleep_title)))
-                options.add(PlayerOption(playerOptionType, ID_PLAYBACK_SPEED, R.attr.ic_speed_normal_style, res.getString(R.string.playback_speed)))
+                if (service.isSeekable) {
+                    options.add(PlayerOption(playerOptionType, ID_PLAYBACK_SPEED, R.attr.ic_speed_normal_style, res.getString(R.string.playback_speed)))
+                }
                 options.add(PlayerOption(playerOptionType, ID_JUMP_TO, R.attr.ic_jumpto_normal_style, res.getString(R.string.jump_to_time)))
                 options.add(PlayerOption(playerOptionType, ID_EQUALIZER, R.attr.ic_equalizer_normal_style, res.getString(R.string.equalizer)))
                 if (video) {



More information about the Android mailing list