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
Developer
Posts: 272
Registered: ‎05-24-2010
My Device: DEV Alpha C & BB 9720
My Carrier: Idea and Airtel

play the media player palylist in my application

Hi every one..

 

will manager.createPlayer();

accepts the m3u format..

 

 

i want to play the playlist in my  application through Manager.createPlayer().

 

when call player.start() it should start..

 

 

is it poosible  ?

if not suggest me how can i do this..

 

can any one help me regarding this..

 

thanks regards 

yakub pasha

 

 

 

 

 

Developer
Posts: 216
Registered: ‎02-18-2010
My Device: 9350,8520
My Carrier: no

Re: play the media player palylist in my application

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

Re: play the media player palylist in my application

m3u is not a media format, it is a playlist format. open source, too.

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

 

you can parse the information in the file and play the media tracks one by one.

----------------------------------------------------------
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
Developer
Posts: 272
Registered: ‎05-24-2010
My Device: DEV Alpha C & BB 9720
My Carrier: Idea and Airtel

Re: play the media player palylist in my application

thanks for the replay..

 

 

can u tell me how can i parse the .m3u dile so that i can read line li9ne by line and play the song..

 

am using the below code to read the songs line by line but its not working..

 

the input stream am getting is "null"

 

 

String s[]=readm3u("/home/store/music/playlistname.m3u")

String[] readm3u(String path) throws IOException {
		Vector allRecords = new Vector();
		int size;
		InputStream is = getClass().getResourceAsStream(path);
		if(is!=null)
		{
		LineReader reader = new LineReader(is);

		try {
			while (true) {
				byte[] readLine = reader.readLine();
				allRecords.addElement(new String(readLine));
			}
		} catch (Exception e) {

		} finally {
			is.close();

		}

		size = allRecords.size();
		String s[] = new String[size];
		allRecords.copyInto(s);
		return s;

	}
		return null;
	}

 

 

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

Re: play the media player palylist in my application

getResourceAsStream is for resources you added to your project. from your code i guess that you try to read the file from the file system.

check the appropriate samples that ship with the jde/ejde about how to access the file system.

----------------------------------------------------------
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: 272
Registered: ‎05-24-2010
My Device: DEV Alpha C & BB 9720
My Carrier: Idea and Airtel

Re: play the media player palylist in my application

ya i have done using fileconnector...

now i am getting it correctly