How to set up media player like WhatsApp voice notes (recyclerview)?

Viewed 1388

What I'm trying to do is something like the image below. voices notes inside a recyclerView using MediaPlayer.

enter image description here

Audio should play when the play button is pressed and when the audio ends set the seek bar to 0 and stop the player.

The application should also avoid playing audio simultaneously if an audio note is playing and the user tries to play a new one.how can I do something like that? should I create a MediaPlayer every time the user clicks on the play button or always use the same player?

0 Answers
Related