Skip to main content

Playing video on Andriod

Please note these java.net forums are being decommissioned and use the new and improved forums at https://community.oracle.com/community/java.
2 replies [Last post]
mohaemdsaleh
Offline
Joined: 2009-02-18
Points: 0

Hi

I am having a problem in playing video in Andriod using thorsten_s porting,

What is happing to me , that the video starts and I can hear the sound but the only first frame appears and others frames don't come.

I am using latest source of the porting from the SVN with LWUIT 1.5

Any help in this?

Here you are my code:

public class VideoFrom extends Form{

private Command startCommand= new Command("Start");

private Command backCommand = new Command("Back");

private VideoComponent vc=null;boolean isStart=false;

public VideoForm() {

setBackCommand(backCommand);

Button b= new Button(startCommand);

addComponent(b);

}

private void createVideo(){

try{

vc =VideoComponent.createVideoPeer("/sdcard/TestVidoe.3gp");
vc.setPreferredSize(new Dimension(100,100));
addComponent(vc);
}

catch(Exception ioe){

Label l = new Label(ioe.getMessage());

addComponent(l);

}

}

protected void actionCommand(Command cmd) {

if(cmd==startCommand){

createVideo();
}

else if(cmd==backCommand){

new MainForm().show();

}

}

}

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
mohaemdsaleh
Offline
Joined: 2009-02-18
Points: 0

Hi All

I have just tried it on the real device and it worked but the problem now still exists on the emualtor.

vprise
Offline
Joined: 2003-11-07
Points: 0

The Android emulator has a few limitations that don't recure on a real device.