audio_waveforms icon indicating copy to clipboard operation
audio_waveforms copied to clipboard

Cannot catch error of preparePlayer

Open jt274 opened this issue 1 year ago • 1 comments

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:

  1. Run controller.preparePlayer using an invalid file
  2. Try to catch error using catchError or try/catch block.
  3. Catch does not work

Expected behavior Catch should catch any player errors and continue code execution.

jt274 avatar May 24 '24 16:05 jt274

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)

dev3-tech avatar May 29 '24 03:05 dev3-tech

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 avatar Jan 09 '25 07:01 toyfind

@toyfind, please raise the new issue with all the mandatory details.

One more thing Please check that your file is not corrupted.

jay-simformsolutions avatar Jan 10 '25 05:01 jay-simformsolutions