Merge pull request #3964 from ByteHamster/buffer-local

Do not show buffering indicator when playing local file
This commit is contained in:
H. Lehmann 2020-03-26 17:24:27 +01:00 committed by GitHub
commit b18d28e554
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 1 deletions

View File

@ -265,7 +265,11 @@ public class AudioPlayerFragment extends Fragment implements
@Override @Override
public void onBufferUpdate(float progress) { public void onBufferUpdate(float progress) {
sbPosition.setSecondaryProgress((int) (progress * sbPosition.getMax())); if (isStreaming()) {
sbPosition.setSecondaryProgress((int) (progress * sbPosition.getMax()));
} else {
sbPosition.setSecondaryProgress(0);
}
} }
@Override @Override

View File

@ -743,6 +743,10 @@ public class PlaybackController {
} }
} }
public boolean isStreaming() {
return playbackService != null && playbackService.isStreaming();
}
private void initServiceNotRunning() { private void initServiceNotRunning() {
if (getPlayButton() == null) { if (getPlayButton() == null) {
return; return;