[BUG]: PlatformException(Audio Player, startPlayer failure, null, null)
See original GitHub issueFlutter Sound Version :
FULL
- Important: Result of the command :
flutter pub deps | grep flutter_sound
|-- flutter_sound 8.1.9
| |-- flutter_sound_platform_interface 8.1.9
| |-- flutter_sound_web 8.1.9
| | |-- flutter_sound_platform_interface...
Severity
-
Crash ?
-
Result is not what expected ? Play the recording from files
-
Cannot build my App ?
-
Minor issue ?
-
Major Issue
Platforms you faced the error
I’ve only tried it on iOS Real device
Describe the bug A clear and concise description of what the bug is.
I use a file picker to pick the file from my phone. The test recording I am using is found in my phones downloads
I then run something along these lines
await audioPlayer.openAudioSession(
focus: AudioFocus.requestFocusAndDuckOthers,
);
audioPlayer.startPlayer(
fromURI: audioUrl,
)
And it shows the platform exception
I use this package to pick the file
file_picker: ^3.0.3
The path to the file I am play is this
private/var/mobile/Containers/Data/Application/SOME-RANDOM-CODE/tmp/com.my.app-Inbox/my - recording.mp3
I also check that the file exists before playing it, it exists
Logs!!!
(This is very important. Most of the time we cannot do anything if we do not have information on your bug)
[VERBOSE-2:ui_dart_state.cc(186)] Unhandled Exception: PlatformException(Audio Player, startPlayer failure, null, null)
#0 StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:581:7)
#1 MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:158:18)
<asynchronous suspension>
#2 MethodChannelFlutterSoundPlayer.invokeMethod (package:flutter_sound_platform_interface/method_channel_flutter_sound_player.dart:184:12)
<asynchronous suspension>
#3 FlutterSoundPlayer._startPlayer (package:flutter_sound/public/flutter_sound_player.dart:1118:19)
<asynchronous suspension>
#4 FlutterSoundPlayer.startPlayer.<anonymous closure> (package:flutter_sound/public/flutter_sound_player.dart:1048:11)
Issue Analytics
- State:
- Created 2 years ago
- Comments:6
Top GitHub Comments
Ok I just got it to work, no worries it isn’t a problem with Flutter sound
I fixed it by using fromDataBuffer instead of fromURI