Vatsal Shah Vatsal Shah - 6 months ago 90
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


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.