-
Notifications
You must be signed in to change notification settings - Fork 94
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
prepareAsync() doesn't work #40
Comments
And when I run
|
I also confirm that prepareAsync() not load OnPreparedListener(). It dose only the first time, cold be the .resete()? |
@anonym24 @SluggedGerm2 Hi. Sorry for the late response 😞 I tried to reproduce it today, but it cannot be done yet. Could you provide a sample project which can reproduce the issue?
This seems that you are calling |
Using prepareAsync() the OnPrepared is called the first time but not the following times. For this reason i'm using normal prepare() |
@SluggedGerm2 Thanks, but it cannot be reproduced yet on my setup. Could you try the following repository, it is a simple sample project based on your code. https://github.com/h6ah4i/openslmediaplayer_issue_40 My setup:
|
Your sample works :/ what is the trick? |
@h6ah4i also I'll check my old backuped projects, and compare with the latest one and mb find out something |
@h6ah4i: I have updated my project from 0.7.3 to 0.7.5 and now the prepareAsync() is called some times, but still not always. I can't see anything common for songs that never arrived to OnPreparedListener. |
I guess I quite understood the problem, so mb it really because of calling such methods like |
yes, now I'm sure. If we for example call |
@anonym24 Thanks for this clarification! now I can try to avoid this problem :) |
I solved with a simple boolean that is setted to false when setDataSource is setted (so before prepareAsync) and is setted to true when the Onprepared is called. So I ovveride dangerous methods like getCurrentPosition() to make it only working if the boolean is true |
@SluggedGerm2 yeah I did exactly the same :) |
@anonym24 @h6ah4i @SluggedGerm2 Is there anyone to guide me for the same. fun startSong() {
/* Prepared Listener */
|
Wonderfull. Thanks |
I created a hybrid player in my service.
When I do this:
It just instantly calls
onError
&onCompletion
and tries to play the next song, fails again with the same error and so onThe text was updated successfully, but these errors were encountered: