I am streaming an mp3 file and my file size is up to 100 to 500mb which take so long to buffer and i want to play a sound while the MediaPlayer is preparing is there anyway i could do this?
Asked
Active
Viewed 83 times
0
-
Have you looked at the examples give here? http://stackoverflow.com/questions/1965784/streaming-audio-from-a-url-in-android-using-mediaplayer – ChinLoong Jun 26 '16 at 12:24
-
My app is fine at streaming. However it looks so laggy when i clicked another button to stream again, that's why i want to play a small mp3 file while the MediaPlayer is preparing. – Heyo Jun 26 '16 at 12:28
-
Can you post your code as well? Did you use MediaPlayer's prepareAsync https://developer.android.com/reference/android/media/MediaPlayer.html#prepareAsync() which would allow the prepare to happen asynchronously. While that is happening you could use another mediaplayer to play a small file. – ChinLoong Jun 26 '16 at 12:53
-
Yes i used prepareAsync but how can i use another mediaplayer just to play a small file – Heyo Jun 30 '16 at 12:25
-
You may refer this http://stackoverflow.com/questions/3289038/play-audio-file-from-the-assets-directory – ChinLoong Jun 30 '16 at 15:22