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
Can't cancel or skip AudioManager.instance functions or remove background activity #50
Comments
If you want to play the whole app, using |
Im using your plugin in the whole app, I just minifed code here so its not too complicated. The main problem still is that if Im using any of the functions inside Pageview or Iconbutton, it gets stuck and Pageview doesnt work smooth. It seems like the functions are "more important" than the Pageview because it blocks the sliding. It has something to do with the functions, I tried different music plugins from pubdev for example audioplayers plugin to have a reference. This works fine. If I just slide threw Pageview or stop and close the screen, functions do what expected and they dont block the Pageview. |
|
Oh alright, you got my demo, could you show me a fix where it will be called only once? |
Add a timer to execute the last method
then invoke that
|
Hey @jeromexiong great that you took a look to my code. It seems like this is fixed now, still need to test some cases but it works smoother now. THANK YOU FOR THIS! EDIT:: |
you can debug code step by step |
I managed to get a version where setState and the function is only called once, so we also don't need the timer anymore. But we still have the same problem with AudioManager.instance.next() and AudioManager.instance.stop. Its getting stuck and/or blocking the PageView sliding in the given direction. Even with one setState(). If remove the AudioManager.instance.next() or stop function, everything works smooth. Please check my updated code:
|
Oh I got something for you. It has to do with the audio. My audio provided in the code example is from my firebase project. if we change the audio to this (audio files from internet with.mp3 ending):
it works perfectly fine and we are able to swipe and stop the music without any blocking. I hope this helps you fixing the issue. |
yeah,the network in each region is different, users can replace it with their own URL as needed |
@jeromexiong what did you mean with users can replace it with their own url? The files without mp3 ending are from my firebase project, this is handled in a different way in your Plugin. It’s not able to execute any AudioManager function in a correct way with this url type as you can see in the Demo. But in my case music gets uploaded and you can play it from the url. This is a case which many people do have in their projects. That’s why we should fix that in your plugin making it working the same good way as with the mp3 files |
Hey Jerome,
Im facing an issue for both android and ios where Im not able to move to the next item in my pageview as long as the AudioManager.instance.next function is part of the function tree. None of the AudioManager functions are skipable. They basically block the Pageview controlls.
As you will see in my demo, if I slide to the next element, its getting stuck completely, it doesnt let me override the previous action. Also If I press the close button with AudioManager.instance.stop function. It will either get stuck or it wont stop and song will be played on different screen.
This is another or combining issue. If you call the AudioManager.instance.stop(); function and move to a different screen, the song doesnt stop, it continues playing on a different screen. On iOS you can clearly see that this behaviour happens if you slide threw the items and close the screen. It doesnt get recognized anymore. If I put a print in a dispose tree, it will get printed but it doesnt dispose the Audio if you move to a different screen.
In the following im providing you a fully working demo with audio sources from my firebase project. You can test and reproduce the error there. Im also providing 2 videos, one with android from stackoverflow user, where it just looks fine and one from me with iOS, where you can clearly see that it starts playing audio even if we call AudioManager.instance.stop();
Videos:
Android: https://streamable.com/sepgb1
iOS: https://streamable.com/e/ycxwob
The text was updated successfully, but these errors were encountered: