-
Notifications
You must be signed in to change notification settings - Fork 6k
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
#4304 - Add option to show buffering view when setPlayWhenReady is false #4585
#4304 - Add option to show buffering view when setPlayWhenReady is false #4585
Conversation
Looks good. Posted some minor comments that would be good to address, and then we'll get this merged. Thanks! |
|
public void setShowBuffering(boolean showBuffering) { | ||
setShowBuffering(showBuffering ? SHOW_BUFFERING_ALWAYS : SHOW_BUFFERING_NEVER); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should use SHOW_BUFFERING_WHEN_PLAYING rather than SHOW_BUFFERING_ALWAYS, so that the behavior of this method doesn't change.
@@ -51,7 +51,11 @@ | |||
<attr name="hide_on_touch" format="boolean"/> | |||
<attr name="hide_during_ads" format="boolean"/> | |||
<attr name="auto_show" format="boolean"/> | |||
<attr name="show_buffering" format="boolean"/> | |||
<attr name="show_buffering" format="enum"> | |||
<enum name="show_buffering_never" value="0"/> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given how these are used, I think the names can probably be shortened to just "never" "always" and "when_playing".
* <li>{@link #SHOW_BUFFERING_ALWAYS} displayed always when buffering | ||
* <li>{@link #SHOW_BUFFERING_NEVER} not displayed at all | ||
* <li>{@link #SHOW_BUFFERING_WHEN_PLAYING} displayed only when playing and buffering | ||
* </p></ul> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are </p>
and </ul>
the wrong way round (not sure :)).
@@ -655,9 +666,28 @@ public void setKeepContentOnPlayerReset(boolean keepContentOnPlayerReset) { | |||
* Sets whether a buffering spinner is displayed when the player is in the buffering state. The | |||
* buffering spinner is not displayed by default. | |||
* | |||
* Deprecated, use {@link #setShowBuffering(int)} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use the @deprecated
tag
Oops, posted them now. Thanks! |
@ojw28 |
Added an option to show buffering view when
playWhenReady
is set to false. So from now the visibility state can be defined with the following options:SHOW_BUFFERING_NEVER
SHOW_BUFFERING_ALWAYS
SHOW_BUFFERING_WHEN_PLAYING
Checked on emulator where I tweaked the network type / signal strength to be able to test it and it seemed OK to me in every case.
Link to the original issue: #4304