alxrm / audiowave-progressbar

Lightweight audiowave progressbar for Android
MIT License
492 stars 84 forks source link

onProgressChanged #22

Closed parsa10 closed 5 years ago

parsa10 commented 5 years ago

Wow thanks for your quick awesome response <3 And i had 3 questions related to my last issue , it will be great if you would give me some tips :

In the setOnProgress Listener in onProgressChanged , what should i write to change the progress of MediaPlayer ? because the code that i wrote is not working .


What is the best way to implement codes in another thread to prevent screen hanging and possible errors ?


And i'm receiving the Mp3 file from server by an URL , and i have to wait for mediaPlayer to compeletly prepare and download the mp3 and then audiogram will be displayed and it takes time to download the file completely . is there anyway to reduce its time ? Or draw it on Runtime dynamically ? Thank you very very much for your helps <3

alxrm commented 5 years ago

1) You have the progress value from 0 to 100 and you know the duration, so apparently you'd be fine by going with: seekTo(duration * progress / 100F)

2) This question is irrelevant to this library, but I always use ThreadPoolExecutor. If you need more robust and high level solution, you can try RxJava for example

3) My library doesn't support dynamic drawing, unfortunately. You can try ExoPlayer, it might be a better solution for you in terms of usability and performance. And yeah, the wave won't show up until the file's downloaded, sorry 🤷‍♀️

Please stop asking me questions with issues