Show "Install plugin" dialog if speed cannot be changed

This commit is contained in:
Martin Fietz 2016-01-16 23:04:45 +01:00
parent 71468395b5
commit 322e445c96
1 changed files with 6 additions and 1 deletions

View File

@ -707,7 +707,10 @@ public abstract class MediaplayerActivity extends AppCompatActivity implements O
if(butPlaybackSpeed != null) {
butPlaybackSpeed.setOnClickListener(v -> {
if (controller != null && controller.canSetPlaybackSpeed()) {
if (controller == null) {
return;
}
if (controller.canSetPlaybackSpeed()) {
String[] availableSpeeds = UserPreferences.getPlaybackSpeedArray();
String currentSpeed = UserPreferences.getPlaybackSpeed();
@ -733,6 +736,8 @@ public abstract class MediaplayerActivity extends AppCompatActivity implements O
}
UserPreferences.setPlaybackSpeed(newSpeed);
controller.setPlaybackSpeed(Float.parseFloat(newSpeed));
} else {
VariableSpeedDialog.showDialog(this);
}
});
butPlaybackSpeed.setOnLongClickListener(v -> {