Commit 345f2345 by Googler Committed by christosts

Disables play/pause button when there's nothing to play

PiperOrigin-RevId: 502571320
parent 55aeb76e
......@@ -986,6 +986,9 @@ public class StyledPlayerControlView extends FrameLayout {
((ImageView) playPauseButton)
.setImageDrawable(getDrawable(getContext(), resources, drawableRes));
playPauseButton.setContentDescription(resources.getString(stringRes));
boolean enablePlayPause = shouldEnablePlayPauseButton();
updateButton(enablePlayPause, playPauseButton);
}
}
......@@ -1503,6 +1506,10 @@ public class StyledPlayerControlView extends FrameLayout {
}
}
private boolean shouldEnablePlayPauseButton() {
return player != null && !player.getCurrentTimeline().isEmpty();
}
private boolean shouldShowPauseButton() {
return player != null
&& player.getPlaybackState() != Player.STATE_ENDED
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment