irfan masood

Greenhorn
+ Follow
since Jul 03, 2004
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by irfan masood

Hello guys
Can anyone tell me the way or code how can i play an audio/video file using
datasource. If i put my file in my projects directory res then how can i access it in the mobile. I am trying to play video file but its not working so can anyone sort my problem out by giving me the code my code has already been uploaded in that code an exception has been thrown at p.realize() method i have to submit my university project so plz as early as possible sort my problem out.
thanks very much
irfan masood
19 years ago
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 ]
19 years ago
Hello
I am trying to play audio and video files but its not working firstly it was
giving exception that player cannot be created and now no exception but still no play. can anyone help me by giving the code . and can we play the file by selecting from our own computer without using tomcat or not in case of using tomcat the same question which has been put above. plz i need it urgently.
thanks
[ July 03, 2004: Message edited by: irfan masood ]
19 years ago