aspose file tools*
The moose likes Java Micro Edition and the fly likes Video Streaming Using MMAPI Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Mobile » Java Micro Edition
Bookmark "Video Streaming Using MMAPI" Watch "Video Streaming Using MMAPI" New topic
Author

Video Streaming Using MMAPI

gopal nehra
Greenhorn

Joined: Feb 04, 2004
Posts: 1
Hello
we can run the video file using MMAPI Player class in wireless toolkit.
but that is http so the whole file is downloaded first to the local system and then run from the local system.
does anyone know how can we run the video file using video streaming in J2ME in which video should be streming instead of downloaded to the local system.?
thanks
-gopal
Ould Nadif
Ranch Hand

Joined: Jan 21, 2004
Posts: 184
Hi,
I think with my code can help you.
//API media
import javax.microedition.media.*;
import javax.microedition.media.control.*;
import javax.microedition.media.protocol.*;
Player p;
void playMusicBuffer( in inputStream ){


try {


if(p==null){
p = Manager.createPlayer(in,"audio/mpeg");
p.start();

}else{
p.stop();
p.close();
p = Manager.createPlayer(isb,"audio/mpeg");
p.start();

}

}
catch (IException ie) {
//...
}
catch (Exception ioe) {
//....
}

}

OULD


We are ones that build the world, thus build it well.
Ould Nadif
Ranch Hand

Joined: Jan 21, 2004
Posts: 184
Hi,
Just a error in the stream. Now it's OK.
//API media
import javax.microedition.media.*;
import javax.microedition.media.control.*;
import javax.microedition.media.protocol.*;
Player p;
void playVideo( in inputStream ){

try {

if(p==null){
p = Manager.createPlayer(in,"audio/mpeg");
p.start();
}else{
p.stop();
p.close();
p = Manager.createPlayer(in,"audio/mpeg");
p.start();
}
}
catch (IException ie) {
//...
}
catch (Exception ioe) {
//....
}

}

OULD
rakesh nehra
Greenhorn

Joined: Feb 08, 2004
Posts: 3
Hello
the code u provide is for audio only and not for video streaming right.
and what about inputstream where it comes from/
please clarify this
thanks
rakesh
Ould Nadif
Ranch Hand

Joined: Jan 21, 2004
Posts: 184
Hi,
the code u provide is for audio only and not for video streaming right!
You are right: change only with ,"video/mpeg");
and what about inputstream where it comes from/ ,
HttpConnection conn = ( HttpConnection )Connector.open( YOUR_URL );
InputStream in = conn.openDataInputStream();
please clarify this:
This URL can help you
http://developers.sun.com/techtopics/mobility/midp/articles/mmapioverview/
OULD NADIF
rakesh nehra
Greenhorn

Joined: Feb 08, 2004
Posts: 3
Hello
But here In HttpConnection it downloads entire video file locally on the system.
can u tell me how to do video streaming like how to implement custom datasource for RTP?
so we can write creatPlayer(DataSource ds);
THANKS
-RAKESH
Diana Garc�a
Ranch Hand

Joined: Sep 21, 2003
Posts: 31
Hello
To implement your custom DataSource you just have to develop all its methods. Take a look on the internet, I found many examples. You will need to defin a custom SourceStream too.
newuni voljet
Greenhorn

Joined: Jun 02, 2005
Posts: 1
"Take a look on the internet, I found many examples"

Really?

Can you list them?

Best regards.
Punit Raizada
Ranch Hand

Joined: Mar 20, 2004
Posts: 156
Hi Diana,

I was interested in doin something similar too. Can you please share some of the links on the internet that would provide some info on how to go about doin this.

I apologize but I guess my google skills arent as good these days ...:-)

Regards


SCJP 1.4
Everything that can go wrong will go wrong -Murphy
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Video Streaming Using MMAPI