This week's book giveaway is in the OCAJP forum.
We're giving away four copies of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) and have Khalid A Mughal & Rolf W Rasmussen on-line!
See this thread for details.
Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Video Streaming Using MMAPI

 
gopal nehra
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 184
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Ould Nadif
Ranch Hand
Posts: 184
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 184
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"Take a look on the internet, I found many examples"

Really?

Can you list them?

Best regards.
 
Punit Raizada
Ranch Hand
Posts: 156
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic