BlackBerry Forums Support Community
              

Closed Thread
 
Thread Tools
Old 02-13-2008, 05:00 AM   #1
pravin
Knows Where the Search Button Is
 
pravin's Avatar
 
Join Date: Feb 2008
Model: 8130
PIN: N/A
Carrier: Sprint
Posts: 37
Default How can I play media file using BlackBerryAPI

Please Login to Remove!

Hi All,

I want to play media file using BlackBerry API's, I used following code for play but getting an Exception "java.lang.IllegalArgumentException: no ':' in URL" pls help me to find out where i m worg..



private MediaPlayer player = new MediaPlayer();
private MediaManager manager = new MediaManager();

player .setMedia(manager.createMedia("/0.mid"));

player .start();



Thanks
Pravin
Offline  
Old 02-13-2008, 10:23 AM   #2
rab1
Knows Where the Search Button Is
 
Join Date: Jul 2007
Model: 8300
PIN: N/A
Carrier: AT&T
Posts: 25
Default

The problem is in the URL. It needs to be a full path to the media file. Try to use something like the following:

_player = Manager.createPlayer("file:///" + fileName);


rab
Offline  
Old 02-14-2008, 01:21 AM   #3
pravin
Knows Where the Search Button Is
 
pravin's Avatar
 
Join Date: Feb 2008
Model: 8130
PIN: N/A
Carrier: Sprint
Posts: 37
Default

Thanks rab,

I am also thinking it is a URL problem but what will be URL for method manager.createMedia(url); if I m using a midi file in the application.

For example if in J2ME if I will use player = Manager.createPlayer("0.mid","audio/midi"); it will work but wht will be for blackberry methods???
Offline  
Old 02-14-2008, 04:49 AM   #4
pravin
Knows Where the Search Button Is
 
pravin's Avatar
 
Join Date: Feb 2008
Model: 8130
PIN: N/A
Carrier: Sprint
Posts: 37
Default

Hi,

I think Manager.createMedia(url) only support pme file type, for other file like midi,wav,mp3 etc.. we have to use javax.microedition.media.Manager.createPlayer();

please correct me if I m wrong.

Thanks
Offline  
Old 10-22-2008, 06:41 AM   #5
dolan
New Member
 
Join Date: Sep 2008
Model: 9000
PIN: N/A
Carrier: dhfkdhf
Posts: 12
Default Problem with voice-recording

Hi,

I used this method what did you say.
p = Manager.createPlayer("capture://audio?encoding=amr");

p.realize();
but its not working.

Please give me suggestions what i am making mistake. Its urgent.
Thanks a lot...
Offline  
Old 10-24-2008, 03:09 AM   #6
dolan
New Member
 
Join Date: Sep 2008
Model: 9000
PIN: N/A
Carrier: dhfkdhf
Posts: 12
Default

Hi pravin ,

Did you solve your problem? If yes, please tell me how did you solve?
Please.

Thanks........
Offline  
Old 02-07-2009, 05:31 PM   #7
kenjkelly
Knows Where the Search Button Is
 
Join Date: Jan 2009
Model: 9300
PIN: N/A
Carrier: Simulator
Posts: 19
Default

I tried to answer but this forum won't let me have a link in the answer, which is what the uri is.
Offline  
Closed Thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


Vintage Printer Switch box Commodore 64/Sanyo Mountable Computer PC picture

Vintage Printer Switch box Commodore 64/Sanyo Mountable Computer PC

$49.00



Jelenko Commodore LS VPF with Pump  picture

Jelenko Commodore LS VPF with Pump

$875.00



Lot of 2 NXP N82S100N IC DIP Semiconductor for Commodore C64 (28 Pin) picture

Lot of 2 NXP N82S100N IC DIP Semiconductor for Commodore C64 (28 Pin)

$20.00



Vintage MOS 8502 8502R0 Commodore C64 very rare good condition x 1pc picture

Vintage MOS 8502 8502R0 Commodore C64 very rare good condition x 1pc

$22.00



MCR 6003L Commodore PVC/Non-Woven Poly/Nylon RAIN Suit 3 PC YELLOW  SIZE LARGE picture

MCR 6003L Commodore PVC/Non-Woven Poly/Nylon RAIN Suit 3 PC YELLOW SIZE LARGE

$13.99



To Suit Holden Commodore 3 Button Car Remote Case/Shell Uncut Key VS VX VY VZ WH picture

To Suit Holden Commodore 3 Button Car Remote Case/Shell Uncut Key VS VX VY VZ WH

$11.99







Copyright © 2004-2016 BlackBerryForums.com.
The names RIM © and BlackBerry © are registered Trademarks of BlackBerry Inc.