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) {
}
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) {
}