M
Me
Hi,
I have a MIDlet which has several classes within it. One displays an
MPEG and the other displays text. Is it possible to launch the second
class from the first?
The one which is displaying the video content works fine over HTTP but I
would like to be able to package the video with the MIDlet but am not
sure how to do this or if it is even possible.
Here's the code I am using at present:
void play(String url) {
try {
VideoControl vc;
defplayer();
// create a player instance
InputStream in = getClass().getResourceAsStream("/test-mpeg.mpg");
player = Manager.createPlayer(in, "video/mpeg");
player.addPlayerListener(this);
// realize the player
player.realize();
vc = (VideoControl)player.getControl(
"VideoControl");
if(vc != null) {
Item video = (Item)vc.initDisplayMode(
vc.USE_GUI_PRIMITIVE, null);
Form v = new Form("Playing Video...");
v.setCommandListener(this);
v.addCommand(exit);
v.append(video);
display.setCurrent(v);
}
player.prefetch();
player.start();
}
catch(Throwable t) {
reset();
}
}
Thanks in advance for any pointers,
Paul
I have a MIDlet which has several classes within it. One displays an
MPEG and the other displays text. Is it possible to launch the second
class from the first?
The one which is displaying the video content works fine over HTTP but I
would like to be able to package the video with the MIDlet but am not
sure how to do this or if it is even possible.
Here's the code I am using at present:
void play(String url) {
try {
VideoControl vc;
defplayer();
// create a player instance
InputStream in = getClass().getResourceAsStream("/test-mpeg.mpg");
player = Manager.createPlayer(in, "video/mpeg");
player.addPlayerListener(this);
// realize the player
player.realize();
vc = (VideoControl)player.getControl(
"VideoControl");
if(vc != null) {
Item video = (Item)vc.initDisplayMode(
vc.USE_GUI_PRIMITIVE, null);
Form v = new Form("Playing Video...");
v.setCommandListener(this);
v.addCommand(exit);
v.append(video);
display.setCurrent(v);
}
player.prefetch();
player.start();
}
catch(Throwable t) {
reset();
}
}
Thanks in advance for any pointers,
Paul