The example has a hardcoded audio file URL, and since the backgroundTask callback is in an isolate, I am unable to pass the correct URL to the AudioPlayer.
How can I pass a dynamic file path to the audio player in the BackgroundTask callback?
I was thinking to use isolate ports in the backgroundTask, but not sure if thats the correct way, or if it would even work (im new to flutter/dart)
Thanks.
There is a discussion in #17 which might help you. Let me know if the approaches discussed there do not work.
The example has a hardcoded audio file URL, and since the backgroundTask callback is in an isolate, I am unable to pass the correct URL to the AudioPlayer.
How can I pass a dynamic file path to the audio player in the BackgroundTask callback?
I was thinking to use isolate ports in the backgroundTask, but not sure if thats the correct way, or if it would even work (im new to flutter/dart)
Thanks.
I'm doing exactly this with isolate ports. See #8 .
@ryanheise Thanks for the tip, I ended up using the onCustomAction method successfully.
Once Im done my Android integration, I will be working on the iOS native code for this package.
Thanks!
I will be working on the iOS native code for this package.
Nice
Most helpful comment
@ryanheise Thanks for the tip, I ended up using the onCustomAction method successfully.
Once Im done my Android integration, I will be working on the iOS native code for this package.
Thanks!