Support # and ? in file path on Android.

This commit is contained in:
Ryan Heise 2020-04-21 20:26:53 +10:00
parent 5147a52397
commit ea4be9f9ad
2 changed files with 23 additions and 65 deletions

View file

@ -196,8 +196,8 @@ class AudioPlayer {
/// Loads audio media from a file and completes with the duration of that
/// audio, or null if this call was interrupted by another call so [setUrl],
/// [setFilePath] or [setAsset].
Future<Duration> setFilePath(final String filePath) =>
setUrl('file://$filePath');
Future<Duration> setFilePath(final String filePath) => setUrl(
Platform.isAndroid ? File(filePath).uri.toString() : 'file://$filePath');
/// Loads audio media from an asset and completes with the duration of that
/// audio, or null if this call was interrupted by another call so [setUrl],