audio_waveforms
audio_waveforms copied to clipboard
Cannot catch error of preparePlayer
Describe the bug
When an error is thrown by controller.preparePlayer, it cannot be caught. Experiencing this on Android, have not tested on iOS.
For example, when trying to play a file in an invalid format on Android, the console shows the error:
Playback error
com.google.android.exoplayer2.ExoPlaybackException: Source error
However, a try/catch block or catchError does not fire, and the code is blocked without further execution.
To Reproduce Steps to reproduce the behavior:
- Run
controller.preparePlayerusing an invalid file - Try to catch error using
catchErroror try/catch block. - Catch does not work
Expected behavior Catch should catch any player errors and continue code execution.
yes i faced same thing while controller.preparePlayer. PlatformException(AudioWaveforms, Couldn't read into buffer. Error Domain=com.apple.coreaudio.avfaudio Code=-50 "(null)" UserInfo={false condition=buffer.frameCapacity != 0}, null, null)
how can i fix PlatformException (PlatformException(AudioWaveforms, Source error, Unable to load media source., null))...however i save the file with .m4a or .mp3
@toyfind, please raise the new issue with all the mandatory details.
One more thing Please check that your file is not corrupted.