Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

That's the code(J2me Audio video help required)

 
irfan masood
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That's the code. First i start the tomcat and then run that program but it
is throwing exception at p.realize() that socket is not open something like that.

import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;
import javax.microedition.media.*;
import java.io.*;
import javax.microedition.io.*;

import javax.microedition.media.Manager.*;
import javax.microedition.media.control.*;


public class Movie extends MIDlet implements Runnable{
VolumeControl vc;
Display dis;
Form form;
//Player p;


public Movie(){
dis=Display.getDisplay(this);
form= new Form("Movie");
dis.setCurrent(form);
}
public void startApp(){
Thread t= new Thread(this);
t.start();


}

public void pauseApp(){
}

public void destroyApp(boolean bool){
System.out.print("bye");
}

public void run(){
try {

/*String url = "http://java.sun.com /"+
"products/java-media/mma/media/test-mpeg.mpg";*/
System.out.println("11");


/*Player p = Manager.createPlayer("http://127.0.0.1:8080/qas.mpg");

p.realize();//must do this before getting the control
System.out.println("222");

//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);

//append the GUI to a form
form.append(videoItem);

//start the video
//p.prefetch();
p.start();
dis.setCurrent(form);*/




System.out.println("111");
Player p = Manager.createPlayer("http://localhost:8080/aaa.wav");
p.realize();
System.out.println("111");
VolumeControl vc=(VolumeControl)p.getControl("VolumeControl");
if(vc!=null)
vc.setLevel(100);
p.prefetch();
p.start();
System.out.println("11111");

}
catch(Exception Ioe){
Ioe.printStackTrace();
}


}



}
[ July 05, 2004: Message edited by: irfan masood ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic