Vatsal Shah Vatsal Shah - 1 year ago 177
Android Question

How to run .pls file in android app using mediaplayer?

I have one

file which is online but when I am creating media player in my code, it gives error.

MediaPlayer mp = new MediaPlayer();
mp=MediaPlayer.create(getApplicationContext(),Uri.parse("PLS file link"));

Please help me to run

Answer Source

The Android MediaPlayer class can not process .pls files directly - it can only play individual media files.

If you want to use a .pls file you will need to download it, read the contents in code and pass each of the URLs to the MediaPlayer one at a time.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download