问题描述:

I want to play a video in j2me,The code I am using is

 int index = 0;

LoadVideo(index);

String url = "file:///e:/videos/Abc.3gp";

try{

Player p = Manager.createPlayer(url);

p.realize();

//Get the video controller

VideoControl video = (VideoControl) p.getControl("VideoControl");

//Get a GUI to display the video

Item videoItem = (Item)video.initDisplayMode(VideoControl.USE_GUI_PRIMITIVE, null);

//videoItem.setPreferredSize(100, 200);

//Append the GUI to a form

form.append(videoItem);

display.setCurrent(form);

//Start the video

p.start();

}catch(IOException ioe){ } catch(MediaException me){ }

The problem is video playing in only in small screen mode, How can I make it fit fit to display, Somebody pls help me....

网友答案:

You should use VideoControl

videoControl.setDisplaySize(WIDTH, HEIGHT);

Note: but in some nokia phone 3gp video does not scale.

hope this will help you.

相关阅读:
Top