You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I made sure that the issue I am raising doesn't already exist
Current bug behaviour
Unable to handle exceptions thrown by native code after timeout (30 seconds).
Even native code is throwing this exception
AudioPlayers Exception: AudioPlayerException(
I/flutter (14893): UrlSource(url: https://carestratusdev.blob.core.windows.net/voicemail/2021/08/02/dd8e9379-cee9-4cac-8faa-6b948bcfb477.mp3?sv=2023-11-03&st=2024-05-07T06%3A56%3A50Z&se=2024-05-07T07%3A26%3A50Z&sr=b&sp=r&sig=F6wQwHVDhRaHE9YvWf5Ed6rUZmRTM047GWkZDL%2B1V1c%3D, mimeType: null),
I/flutter (14893): PlatformException(AndroidAudioError, Failed to set source. For troubleshooting, see: https://github.com/bluefireteam/audioplayers/blob/main/troubleshooting.md, MEDIA_ERROR_UNKNOWN {what:1}, MEDIA_ERROR_SYSTEM, null)
Expected behaviour
There should be a way to set Timeout and then handle exceptions in Flutter. If there is an error in play audio (wrong URL), I want to show the error to the user and update the UI accordingly.
Steps to reproduce
Execute flutter run on the code sample
wait for 30 seconds (which is default timeout)
Code sample
Code sample
voidplayAudio() async {
String url ="https://carestratusdev.blob.core.windows.net/voicemail/2021/08/02/dd8e9379-cee9-4cac-8faa-6b948bcfb477.mp3?sv=2023-11-03&st=2024-05-07T06%3A56%3A50Z&se=2024-05-07T07%3A26%3A50Z&sr=b&sp=r&sig=F6wQwHVDhRaHE9YvWf5Ed6rUZmRTM047GWkZDL%2B1V1c%3D";
AudioPlayer audioPlayer =AudioPlayer();
/// reset values on completion
audioPlayer.onPlayerComplete.listen((event) {});
/// Get current value
audioPlayer.onPositionChanged.listen((duration) {});
/// Get total duration
audioPlayer.onDurationChanged.listen((duration) {});
audioPlayer.play(UrlSource(url));
}
Checklist
Current bug behaviour
Unable to handle exceptions thrown by native code after timeout (30 seconds).
Even native code is throwing this exception
Expected behaviour
There should be a way to set Timeout and then handle exceptions in Flutter. If there is an error in play audio (wrong URL), I want to show the error to the user and update the UI accordingly.
Steps to reproduce
flutter run
on the code sampleCode sample
Code sample
Affected platforms
Android, iOS
Platform details
AudioPlayers Version
6.0.0
Build mode
debug, profile, release
Audio Files/URLs/Sources
Url (Error) : https://carestratusdev.blob.core.windows.net/voicemail/2021/08/02/dd8e9379-cee9-4cac-8faa-6b948bcfb477.mp3?sv=2023-11-03&st=2024-05-07T06%3A56%3A50Z&se=2024-05-07T07%3A26%3A50Z&sr=b&sp=r&sig=F6wQwHVDhRaHE9YvWf5Ed6rUZmRTM047GWkZDL%2B1V1c%3D
Url (Working) : https://carestratusdev.blob.core.windows.net/voicemail/2024/01/19/86ac3aee-4e06-4abe-9e06-765d858d3034.mp3?sv=2023-11-03&st=2024-05-07T07%3A42%3A14Z&se=2024-05-07T08%3A12%3A14Z&sr=b&sp=r&sig=vkOpyl%2B4viiIOWD2NV3ViotTUHtOn5qSW%2F%2F6c2RV1jQ%3D
Screenshots
Logs
Code block with 2-3 relevant log lines
Full Logs
Flutter doctor:
Related issues / more information
No response
Working on PR
no way
The text was updated successfully, but these errors were encountered: