rxlabz / audioplayer

A flutter plugin to play audio files iOS / Android / MacOS / Web ( Swift/Java )

Home Page:https://pub.dartlang.org/packages/audioplayer

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

AudioPlayer blocks UI on Andorid

ralph-bergmann opened this issue · comments

The call to prepare() can take a long time to execute, because it might involve fetching and decoding media data. So, as is the case with any method that may take long to execute, you should never call it from your application's UI thread.

https://developer.android.com/guide/topics/media/mediaplayer.html#preparingasync

From my observations, it could block UI more than a second specially in case of poor network. I may send a pull request if I had time to fix it.

Hi, sorry for the delay, and thanks for the suggestion, thanks to @mindon #18, it's updated !