I am developing an Android app in which the user can create a playlists of mp3 files. I am using Mediaplayer
to control the playback of the mp3 files.
Which of the following is best to handle the playlist feature?
Create multiple instances of a
Mediaplayer
, store them in an array and iterate the array and callprepareAsync()
on eachMediaplayer
object. Then iterate the array andstart()
each object and upon completionrelease()
the object.Have one Mediaplayer instance and upon completion of the playback,
reset()
and change thedataSource
of the object.