Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Trusted Contributor
Posts: 177
Registered: ‎03-02-2010
My Device: Not Specified
Accepted Solution

How to parse .m3u ?

[ Edited ]

Hi All,

 

I am getting a m3u file from URL that contain play list. can any one suggest me or give any idea to parse .m3u file and how to get mp3 url from m3u file.

 

Thank You...

Developer
Posts: 16,984
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: How to parse .m3u ?

check

http://en.wikipedia.org/wiki/M3U

http://schworak.com/programming/music/playlist_m3u.asp

----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Trusted Contributor
Posts: 177
Registered: ‎03-02-2010
My Device: Not Specified

Re: How to parse .m3u ?

thank you Simon Hain for reply..

 

  I read link that you post but i am not getting any idea to play m3u file. I also searched on forum and got idea that m3u file just contain links as above link also describe it same.

 

 Now i am trying to play this file with Streaming media - Start to finish but it can not play this file(URL).

 

i am able to play direct mp3 url but when i tried with m3u url it can not play.

 

 

Can you please  help me to parse m3u file and play with above streaming application.

 

 

Thank you.

Developer
Posts: 16,984
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: How to parse .m3u ?

download the m3u file as a string. then extract the mp3 file locations and feed them to the stream app.

----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Trusted Contributor
Posts: 177
Registered: ‎03-02-2010
My Device: Not Specified

Re: How to parse .m3u ?

Thanks simon ,

 

I have downloaded m3u file as string but not getting now how to extract mp3 link from string. Please could you share in some detail how extract the mp3 file locations from this string.

 

Thank You..

Developer
Posts: 16,984
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: How to parse .m3u ?

use a stringtokenizer and collect all strings ending with mp3 would be one of several options.

----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Trusted Contributor
Posts: 177
Registered: ‎03-02-2010
My Device: Not Specified

Re: How to parse .m3u ?

Hi Simon, I am not able to use stringtokenizer class. There is any alternative class for j2me?
Developer
Posts: 16,984
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: How to parse .m3u ?

implement it your self. or use one of the 7 million available implementations.

----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Highlighted
Developer
Posts: 95
Registered: ‎01-25-2010
My Device: 9530

Re: How to parse .m3u ?

[ Edited ]

hi simon i am facing same problem.....

 

I have downloaded custom StringTokenizer class for j2me.String that i have created from m3u  file is look like this..

 

#EXTM3U
#EXTINF:342,My Cool Song One
http://www.yoursite.com/path/to/track1.mp3
#EXTINF:301,Another Track Title
http://www.yoursite.com/path/to/track2.mp3

#EXTINF:342,My Cool Song One
http://www.yoursite.com/path/to/track3.mp3
#EXTINF:301,Another Track Title
http://www.yoursite.com/path/to/track4.mp3

#EXTINF:342,My Cool Song One
http://www.yoursite.com/path/to/track5.mp3

 

now i am tring to get it but not luck with me...Smiley Sad

 

Could please help me to get all above information(time,title and ur) in array or vector..

 

Thank You...