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

#4304 - Add option to show buffering view when setPlayWhenReady is false #4585

Merged
merged 2 commits into from
Aug 16, 2018

Conversation

szaboa
Copy link
Contributor

@szaboa szaboa commented Jul 26, 2018

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:

  1. SHOW_BUFFERING_NEVER
  2. SHOW_BUFFERING_ALWAYS
  3. 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

@ojw28
Copy link
Contributor

ojw28 commented Jul 27, 2018

Looks good. Posted some minor comments that would be good to address, and then we'll get this merged. Thanks!

@ojw28 ojw28 self-assigned this Jul 27, 2018
@szaboa
Copy link
Contributor Author

szaboa commented Jul 27, 2018

@ojw28


~~~I am not seeing any comments so I am not sure what minor things should I address, or did you posted somewhere internally and my job is done here ? :)~~~

Ok, I am seeing now, not sure why the comments delayed so much. I am going to fix those today.

public void setShowBuffering(boolean showBuffering) {
setShowBuffering(showBuffering ? SHOW_BUFFERING_ALWAYS : SHOW_BUFFERING_NEVER);
Copy link
Contributor

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"/>
Copy link
Contributor

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>
Copy link
Contributor

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)}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use the @deprecated tag

@ojw28
Copy link
Contributor

ojw28 commented Jul 27, 2018

Oops, posted them now. Thanks!

@szaboa
Copy link
Contributor Author

szaboa commented Jul 27, 2018

@ojw28
The adjustments are done based on the comments

@ojw28 ojw28 merged commit 4d931b9 into google:dev-v2 Aug 16, 2018
@google google locked and limited conversation to collaborators Dec 20, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants