How to play .pls file in android - android

Can anyone give me the sample code for parsing and playing .pls file in android?
[playlist]
NumberOfEntries=1
File1=http://stream.radiosai.net:8002/

You need to download the .pls file and read it to find the media file inside since pls is a playlist not a format.

I've been searching for a solution for 2 days about this issue and I've finally found a radio player which you can implement into your code: https://github.com/iammert/RadioPlayerService that plays .pls files from a radio service link (such as: http://stream.radiosai.net:8002/ ).
However, that url on your question should work on the default MediaPlayer but if anyone ever encounters this problem with urls that contain a .pls file, then they should use a radio player that supports the encoding and format.
.

Related

Android MediaPlayer and playing .pls files

I understand that the Android MediaPlayer cannot handle .pls files, but I am trying to create a streaming radio app and the .pls URL is all I have access to. Is there any way to make this work, or am I out of luck?
Just read the .pls files and get all the URLs there. And thats what you have to use since .pls is just a playlist. Once you have all the URLS, you can already use mediaplayer.

How to stream an .pls audio file in android 2.2

I am trying to play an .pls file (available at http://stream.radiosai.net:8002/listen.pls) in android 2.2. But it isn't working. Playing MP3 works fine.
A pls or a playlist file is basically a text file with the path of each track in each entry. Kind of like an .ini file. Take a look at the WP entry.
I don't think the inbuilt MediaPlayer supports these formats, so you'll have to download the file and parse the file and play the actual mp3's one by one.
Android doesn't support the .pls format. Link

Playing .pls file not working in android 2.2 [duplicate]

This question already has answers here:
Closed 11 years ago.
Possible Duplicate:
How to stream an .pls audio file in android 2.2
Can any body tell how to stream and play an .pls audio file using media player in android 2.2...
As far as I know .pls file contain information about songs or live radio stream. For exmaple when you use shoutcast api it returns .pls file which contain information related to list of radio stations like url of live radio stream, station name etc. Try opening it in notepad to see its format and information it contain. You have to parse url of song or station from it.
First of all read the pls specification. You'll see it's quite straightforward. Just parse the pls file and extract the songs that you want to play.

Streaming .m3u file in Android 3.0

I am looking to develop an application where I have to stream .m3u file, this is for ANDROID 3.0 only.
I want to stream this link
dl.dropbox.com/u/2377944/test/abr_test/index.m3u8
it must work in emulator too
I searched a lot, but nothing seems to be working too good.
Please help.
Thanks in advance.
m3u is a play list format, a text file, and not actually audio/video media itself. That means it references media that you would want to stream. The distinction is important.
The contents of the m3u file is important. (Your link is dead, btw.) Show that to use and we can help more. Each of the media files contained in the m3u must be valid and point to media that is compatible with Android.
What makes the media compatable? Check the Android Supported Media Formats page.

Asx stream on Android

I have a requirement of playing a Asx stream through an Android application
I have read the Android documentation, and they don't seem to support Windows Media streams
Is there any workaround possible? Has anyone did that before? If yes, is there some source code available? Or a library that implements this
Thanks
Are you worried about asx file only or any possible outcome after this?
The asx file can be readable as simple string, read the file using byte array and you can get one or many urls that can be
pls file
m3u file
mp3 url
wma url
We don't have to worry about 1,2 and 3. 1 and 2 can have different parsing logics but at the end they will give 3 [mp3 url] and an mp3 url can be easily handled by MediaPlayer api in android . but 4 is also difficult work to be done.

Categories

Resources