Search code examples
flutterjust-audio

Loading assets in just_audiio


When trying to load an asset in just_audio with an empty space in asset name I get an error: An error occured Unable to load asset: audio/book/John%20William.mp3, Is white space not allowed in asset names or is this a bug?


Solution

  • It looks like a bug.

    When you click on the button to submit a bug on GitHub, the first question is a qualifying question - if you can answer it, then it qualifies as a bug:

    Which API doesn't behave as documented, and how does it misbehave?

    When filling in your bug report, you can answer this qualifying question as follows:

    This documentation suggests that I can load an asset from any valid asset path, but it gives an error if the asset path contains a space. The documentation does not say say anything about spaces not being allowed. It seems the space is converted to %20 which may be causing the issue.

    This looks like a simple bug, so if you are able to submit a bug report as per the GitHub instructions, it will probably be fixed quickly.

    (Update: The bug was since reported on GitHub and fixed in version 0.6.15)