The original bug report is by design.
The complain about missing docs is valid. Rescoping the case to add missing method signatures to API docs.
How to reproduce:
1. Open the attached “WebRequestMultimdediaBugRepoTrue.zip“ project
2. Open the “SampleScene“ Scene
3. Enter Play Mode
Expected result: Audio file plays and “Audio file loaded! You should hear it playing.“ text is visible in the Game view
Actual result: Audio file doesn’t play and “Error: HTTP/1.1 404 Not Found“ text is visible in the Game view
Reproducible with: 2021.3.32f1, 2022.3.14f1, 2023.2.2f1, 2023.3.0a16
Reproducible on: macOS 14.0 Sonoma (Intel)
Not reproducible on: No other environment tested
Notes:
- Also reproducible in Player
- The issue is only reproducible with audio files
- The user noted that File.Exists returns “true”
- The user noted that they use the C# built URI class to build a valid local URI and that this helper escapes special reserved characters (for example, converts “Space” into “%20”), but considers the “+” valid
- The user noted that according to the spec on URL encoding RFC 3986, a generic URI uses a subset of reserved characters where the “” is not considered reserved and that the C# implementation confirms this. The “” is generally only interpreted as a “Space” when crafting an “application/x-www-form-urlencoded” type String
- The user noted that they tried testing if Unity was replacing the “+” with “Space”, but weren’t able to make it work
- The user noted that although Unity provides its own method to escape a URL via UnityWebRequest.EscapeURL, they have not found any way to use this to create a valid URI that is accepted by the multimedia request
- The user noted that using EscapeURL on the path before entering it into the URI helper will cause a UriFormatException
- The user noted that using EscapeURL on the output of Uri.absoluteUri will cause Unity to return an “Unable to connect” error
- The user noted that when using "file:///" + UnityWebRequest.EscapeURL(path), the audio file is found, and this works on Windows, but fails on MacOS
- The user noted if the URI of the failed audio file load is copied and pasted into any browser, it will find and play the file