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

Play twice #5

Open
diegolucasb opened this issue Jan 25, 2017 · 9 comments
Open

Play twice #5

diegolucasb opened this issue Jan 25, 2017 · 9 comments

Comments

@diegolucasb
Copy link

When you click stop while audio is playing, it starts to play again!

@HugoMatilla
Copy link
Owner

Hi Diego,

are you sure you don't click twice on the button?

More info will be appreciated

@diegolucasb
Copy link
Author

Hi Hugo,

Yes, I'm sure! You can check that in your sample app. Click play (any view) and before audio finishes, click again, it should stop and change icon to play. Instead of it, it is playing again.

@HugoMatilla
Copy link
Owner

Looks like it plays again a couple of seconds and then stops.
With short sounds it might play the whole audio twice.
I will give it a check when I have some time.
If you need it to be fixed asap I recommend you to check the code, is just one class.
And if you find the bug feel free to make a pull request.

https://github.com/HugoMatilla/AudioPlayerView/blob/master/audioplayerview/src/main/java/com/hugomatilla/audioplayerview/AudioPlayerView.java

@diegolucasb
Copy link
Author

Sure! I'm checking it and I'm making some improvements (adding a seekbar). As soon as I get it done, I'll let you know! If you think it is ok, I'll make a pull request.
Thanks!

@diegolucasb
Copy link
Author

Hugo,

I have forked your repo and made some changes. Please take a look: https://github.com/diegolucasb/AudioPlayerView

If you find it interesting we can make a pull request!

By the way, the problema I said before (play twice) happened when you call mediaPlayer.seekTo(0) after call mediaPlayer.pause(); If you call pause after seekTo(0) works fine! Have no idea why!!

@HugoMatilla
Copy link
Owner

Awesome work @diegolucasb 🥇

I will try to update the fix for the "play twice" soon.

I checked your fork and there are a couple things that I would suggest.

1.- There is a long time since I don't work with seekbars. It seems good 👍 .

2.- Changing Stop to Pause makes the widget have a different behaviour as I planned. It is suppose to be used with small audios so pausing the audio has no sense. In any case if we want to add this feature it should be parameterised. So the user of the lib could choose of he want to have a pause or a stop.

3.- Why did you change the main icons? :)

@diegolucasb
Copy link
Author

diegolucasb commented Jan 26, 2017

Thanks @HugoMatilla. Glad you like it!

1.- ok

2.- I'm using it with small audios as well, 10 sec average. I think pausing small audios has no sense if you don't have seekbar, loot at WhatsApp audio player, for example. That was my intention when I added a seekbar and changed stop feature to pause. I strongly agree with you though. I has to be parameterized, I gonna add this feature ASAP.

3.- I though them prettier. Sorry! hahah
Well, I can put it back if you think it is important for the lib consistency!

Thanks again!

@HugoMatilla
Copy link
Owner

You are very welcome :)

2.-I think you can just change the stop to pause if there is a seekbar, so not need for an extra paramaeter. If there is a seekbar linked to the AudioPlayerView, the stop function changes to pause function. What do you think?

3.-Yes please. I think the original ones are less styled so they fit better in any UI.

Keep it rolling 👍

@diegolucasb
Copy link
Author

@HugoMatilla

2.- Sounds good! I'm gonna do it

3.- Ok, no problem! Gonna put it back!

Thanks!

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

No branches or pull requests

2 participants