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


Fluke Networks Versiv Modular Mainframe AS IS picture

Fluke Networks Versiv Modular Mainframe AS IS

$1500.00



Chroma 6312 DC Electronic Load Mainframe  picture

Chroma 6312 DC Electronic Load Mainframe

$239.96



SHC SYSTEM 6 MAINFRAME + Mixed Modules 6-562,6-201,6-402. picture

SHC SYSTEM 6 MAINFRAME + Mixed Modules 6-562,6-201,6-402.

$99.99



National Instruments NI PXI-1044 Chassis 14-Slot PXI Mainframe 189105E-01 Rev 01 picture

National Instruments NI PXI-1044 Chassis 14-Slot PXI Mainframe 189105E-01 Rev 01

$199.99



ILX Lightwave LDC3908 Laser Diode Controller Mainframe with Key picture

ILX Lightwave LDC3908 Laser Diode Controller Mainframe with Key

$480.00



USED 100%Tested NI PXI-1033 Mainframe Offers pxi 1033  picture

USED 100%Tested NI PXI-1033 Mainframe Offers pxi 1033

$780.90







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