jeromexiong / audio_manager

A flutter plugin for music playback, including notification handling.
MIT License
100 stars 53 forks source link

How to cancel Audio Manager loading resource #46

Closed md186 closed 3 years ago

md186 commented 3 years ago

Hello @jeromexiong ,

I have a specific case, but who knows maybe someone else does need this information. In my app I have a carousel and each slide is showing an image and loading a song file. Now I can slide to right and left, but it only lets me slide if the song is initialized. I already tried AudioManager.instance.stop() and AudioManager.instance.playandpause() but it wont stop initializing the song.

I already connected all AudioManager events with providers, but I dont know how to make the loading process cancelling. Do you have any idea?

jeromexiong commented 3 years ago

@md186 you can invoke the stop method to release all resources. if it is not released, please check the demo and debug step by step

md186 commented 3 years ago

@jeromexiong How to do this? Could you provide me code example? I tried AudioManager.instance.stop(); this doesnt work