Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chapter dividers for the progress bar #4915

Merged
merged 9 commits into from
Mar 1, 2021
Prev Previous commit
Next Next commit
Fix NullPointerException
  • Loading branch information
jonasburian committed Feb 4, 2021
commit fbdd50e82fcfd316bb9f0d3f220f5d74d4ed3529
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,11 @@ private void setHasChapters(boolean hasChapters) {
}

private void setChapterDividers(Playable media) {

if (media == null) {
return;
}

float[] dividerPos = null;

if (hasChapters) {
Expand Down Expand Up @@ -409,8 +414,10 @@ private void updateUi(Playable media) {
return;
}

if (media.getChapters() != null) {
if (media != null && media.getChapters() != null) {
setHasChapters(media.getChapters().size() > 0);
} else {
setHasChapters(false);
}
updatePosition(new PlaybackPositionEvent(controller.getPosition(), controller.getDuration()));
updatePlaybackSpeedButton(media);
Expand Down