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

PlayerControlView: Continue progress updates when not visible #7333

Open
mariah-smith25 opened this issue May 6, 2020 · 4 comments
Open

Comments

@mariah-smith25
Copy link

[REQUIRED] Searched documentation and issues

I've looked through the source code for PlayerControlView.java. Tried subclassing PlayerControlView to override hide() method and prevent removing the progress callback action but some of the members are private.

[REQUIRED] Question

Is it possible to not tie video progress updates to control view visibility? I have them decoupled in my UI as I need an always visible progress bar, but I am using the show/hide & timeout functionality for pause and play buttons UX. I would have to set up a separate runnable to poll progress and duration from the Player and tie it to playback state as well, which is messy (and is the suggested workaround on stackoverflow).

Thank you!

@marcbaechinger
Copy link
Contributor

marcbaechinger commented May 15, 2020

There is currently no way to do that I'm afraid. I mark this as an enhancement, but I can't say when we have time to look into this and provide a solution. If we find an easy way it's probably soon, but at a first look it seems like it needs some refactoring of the PlayerControlView. Currently when the PlayerControlView is hidden, the update action is stopped as the component assumes the progress bar is part of the component.

@ojw28 ojw28 changed the title A way to not remove progress update action when hiding control view? PlayerControlView: Continue to report progress updates when not visible May 18, 2020
@ojw28 ojw28 changed the title PlayerControlView: Continue to report progress updates when not visible PlayerControlView: Continue progress updates when not visible May 18, 2020
@DarrelAeturnum
Copy link

Hi any alternative ways to do this ?

@marcbaechinger
Copy link
Contributor

I think an alternative would be to create your own update action that you start when Player.EventListener.onIsPlaying reports that the player is playing and stop it when the callback reports that the player is paused. If you feel that having an additional action is redundant and too much, you can combine this with registering a PlayerControlView.VisibilityListener so you only do this when the PlayerControlView.ProgressUpdateListener stops reporting progress updates.

Hope this helps. If this is not sufficient, please give me bit of a more detail of your use case.

@DarrelAeturnum
Copy link

@marcbaechinger Thanks for that ! I found another alternative. I wrapped the PlayerControlView inside a LinearLayout and hide the visibility of the LinearLayout instead of the PlayerControlView .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants