• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
I think he's gonna try to grab my monkey. Do we have a monkey outfit for this tiny ad?
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic