| Reply | « Previous Thread | Next Thread » |
|
I am tryin to create a media player that uses the MMAPI to open up a media file stored on the phone.
i have tried using the MIDP: Mobile Media API develpoers guide with no success. When i load a stream nothing happens Code:
inputStream is = getClass().getResourceAsStream(address);
Player player = Manager.createPlayer(is,"video/3gpp");
player.addPlayerListener(this);
player.realize();
player.prefetch();
VideoControl vc = (VideoControl)player.getControl("VideoControl");
if (videoControl == null) {
midlet.alertError("VideoControl not supported");
} else {
vc.initDisplayMode(VideoControl.USE_DIRECT_VIDEO, this);
videoControl.setVisible(true);
player.start();
}
Code:
try {
//inputStream is = getClass().getResourceAsStream(address);
Player player = Manager.createPlayer(address);
player.addPlayerListener(this);
player.realize();
player.prefetch();
VideoControl vc = (VideoControl)player.getControl("VideoControl");
if (videoControl == null) {
midlet.alertError("VideoControl not supported");
} else {
vc.initDisplayMode(VideoControl.USE_DIRECT_VIDEO, this);
videoControl.setVisible(true);
player.start();
}
Code:
try {
//inputStream is = getClass().getResourceAsStream(address);
Player player = Manager.createPlayer(address);
player.addPlayerListener(this);
player.realize();
player.prefetch();
player.start();
VideoControl vc = (VideoControl)player.getControl("VideoControl");
if (videoControl == null) {
midlet.alertError("VideoControl not supported");
} else {
vc.initDisplayMode(VideoControl.USE_DIRECT_VIDEO, this);
videoControl.setVisible(true);
}
the other two examples just the alertError is created. Any help would be greatly appreciated. The try statements are caught but i just left that part of the code out to save room. Address is an app property that points on an address on the phone in this case file:///C:/Data/Vidoes/t2.3gp i have tried more than one file but none see to work.
Last edited by michaelhann89 : 2007-04-18 at 03:10.
|
| michaelhann89 |
| View Public Profile |
| Find all posts by michaelhann89 |
|
Hi,
You need to use fileconnection: import javax.microedition.io.file.*; FileConnection fc = (FileConnection)Connector.open(filepath); Player player = Manager.createPlayer(fc.openInputStream(),"video/3gpp"); You also need to setup file access permissions. BR, Mik miklabs.com |
|
i tried using the file connection like u said but it still comes up the the error that video control is not supported.i have no idea y. any help would be great.
oh and its a nokia N80 if that helps
Last edited by michaelhann89 : 2007-04-18 at 02:54.
|
| michaelhann89 |
| View Public Profile |
| Find all posts by michaelhann89 |
|
Give a try with MIDP: Mobile Media API Example - Media Sampler
http://www.forum.nokia.com/info/sw.n..._v1_0.zip.html Regards Gopal __________________ MobiQuil.com An initiative by Developers for Developers. http://www.mobiquil.com - Alpha - Launched. |
|
hey balagopalks.
am using that to make this program but for some reason mine wont work. have trid varying it in many ways. just not sure what i am doin wrong |
| michaelhann89 |
| View Public Profile |
| Find all posts by michaelhann89 |
|
i figured out the problem.
it was an error with som eof the naming. thank you all for your help |
| michaelhann89 |
| View Public Profile |
| Find all posts by michaelhann89 |
| Reply | « Previous Thread | Next Thread » |
| Thread Tools | Search this Thread |
|---|---|
| Thread | Thread Starter | Forum | Replies | Last Post |
|---|---|---|---|---|
| Create 3GP player with J2ME for Mobile | dexxa05 | Mobile Java Media (Graphics & Sounds) | 53 | 2008-03-27 20:52 |
| Nokia 3250 Media Player Problems | smash555 | General Discussion | 2 | 2007-02-26 13:03 |
| Nokia E60 - Media player problems... | Guntis | Audio | 0 | 2007-02-06 00:50 |
| SIP content type | hlothman | Symbian Networking & Messaging | 8 | 2006-05-17 10:26 |