Problem realizing a Player in Java MIDP MMAPI

A

Antti Nummiaho

I am trying to use Java MIDP MMAPI to play a video on J2ME Wireless
Toolkit. The video is a byte array of which I construct a
ByteArrayInputStream and use Manager to create a Player of it.
However, when I try to realize the player, it says "Unable to
realize". Any ideas why?

ByteArrayInputStream bais = new ByteArrayInputStream(videoData);

try {
Player p = Manager.createPlayer(bais, videoType);
p.realize(); // here it says "Unable to realize"
VideoControl vc;
if ((vc = (VideoControl)p.getControl("VideoControl")) != null)
add((Component)vc.initDisplayMode(vc.USE_GUI_PRIMITIVE,
null));
p.start();
} catch (MediaException pe) {
} catch (IOException ioe) {
}
 
A

Antti Nummiaho

I am trying to use Java MIDP MMAPI to play a video on J2ME Wireless
Toolkit.
However, when I try to realize the player, it says "Unable to
realize". Any ideas why?

try {
Player p = Manager.createPlayer(bais, videoType);
p.realize(); // here it says "Unable to realize"

I managed to solve the problem. Apparently the videoType must be
"video/mpeg", not "video/mpg" for mpeg videos.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top