×

Discussion Board

Page 1 of 6 123456 LastLast
Results 1 to 15 of 81

Thread: j2me streaming

  1. #1
    Registered User
    Join Date
    Jan 2006
    Posts
    9

    j2me streaming

    Can anyone please tell me if j2me streaming is possible for Nokia N80. If yes, I will appreciate a brief reply how this is done.

    Thanks
    flo

  2. #2
    Super Contributor
    Join Date
    Apr 2003
    Location
    USA, CA
    Posts
    7,191

    Re: j2me streaming

    N80 is a S60 3rd edition device and that platform supports streaming over RTSP. The streaming connection uses the connection settings from RealPlayer. Otherwise, playing the streaming content is done in pretty much the same way as displaying any other video content.

    Hartti

  3. #3
    Registered User
    Join Date
    Nov 2006
    Posts
    28

    Smile Re: j2me streaming

    >N80 is a S60 3rd edition device and that platform supports streaming over >RTSP. The streaming connection uses the connection settings from RealPlayer. >Otherwise, playing the streaming content is done in pretty much the same way >as displaying any other video content.

    Hi Hartti
    This is useful info for me as I am also wanting to stream video via RTSP on an N80. Something I'm still not sure of though: is the watching of a streaming video done by doing a J2ME platform request (which presumably would then launch realplayer), or is it done via MMAPI, or some other way? I much prefer the MMAPI approach, if possible, since control doesn't then leave the mobile Java app...
    Thanks!

  4. #4
    Super Contributor
    Join Date
    Apr 2003
    Location
    USA, CA
    Posts
    7,191

    Re: j2me streaming

    The video plays in the midlet, so you can create the UI with Canvas for example and place the video on the screen at the position you want. There is no platformRequest-type behavior in here.

    Hartti

  5. #5
    Registered User
    Join Date
    Nov 2006
    Posts
    28

    Smile Re: j2me streaming

    Thanks for your reply!
    So the things you describe is done via MMAPI calls?

    Btw, I've just found this article about writing custom RTSP protocol handlers:
    http://today.java.net/pub/a/today/20...g-java-me.html

    I assume I won't have to get this low level with things?
    thanks!

  6. #6
    Super Contributor
    Join Date
    Apr 2003
    Location
    USA, CA
    Posts
    7,191

    Re: j2me streaming

    Yes, MMAPI calls, like playing a normal video. You just use rtsp in the protocol, like this.

    myPlayer = Manager.createPlayer("rtsp://ra.yle.fi/yle24/video/uusin_mobile.rm");

    Hartti

  7. #7
    Registered User
    Join Date
    Nov 2006
    Posts
    1

    Re: j2me streaming

    Hi Hartti,

    I find that on the N80, I can only stream clips but not live feeds in J2ME. Live feeds are streams without total time as it is continuous. I will just get a short (about 0.5 secs) sound from the stream and then everything breaks. With clips, the streaming works perfectly.

    Is there a way around this?

    Thanks.

    Cheers,
    Jee Meng.

  8. #8
    Super Contributor
    Join Date
    Apr 2003
    Location
    USA, CA
    Posts
    7,191

    Re: j2me streaming

    jeemeng, can you send an url to such a stream so I could test? If you do not want to post it on these boards, just send me a email using through the link on my screenname.

    Hartti

  9. #9
    Registered User
    Join Date
    Nov 2006
    Posts
    3

    Re: j2me streaming

    Can you guys post what you find on the live video streaming feed (not pre-recorded clips)? I'd be interested to know if this is possible using MMAPI.

    Thanks.

  10. #10
    Super Contributor
    Join Date
    Apr 2003
    Location
    USA, CA
    Posts
    7,191

    Re: j2me streaming

    Just completed the tests.
    Streaming live streams works as well. Note, that I am creating another thread for the streaming and I am NOT using yields in the controlling thread. Initially I had yield in there, but that basically killed the stream right when it started streaming.

    Hartti

  11. #11
    Registered User
    Join Date
    Nov 2006
    Posts
    16

    Re: j2me streaming

    I also have trouble trying to scale down the size of the streaming video.
    This is happening on the Nokia N73.

    I tried using the code.
    "videoControl.setDisplaySize(15, 10);"

    It seems to default to a fix size.
    Is there a limit to how small I can scale down the size of the video streaming on the N73 (probably same issue on N80 too)?

    I might be wrong but it seems not to be a problem in the Sony Ericsson K750i.
    A friend of mine can scale down the video on his SE K750i.

    Is there a way to do it on the N73/N80?

    BTW, on the streaming live streams. What do you mean by using yields and creating another thread for the streaming?
    Sorry, as my command on java is not as strong, so I hope you (Hartti) can explain in slightly more detail pertaining to how you solved the Streaming live issue.

    Thanks.

  12. #12
    Super Contributor
    Join Date
    Apr 2003
    Location
    USA, CA
    Posts
    7,191

    Re: j2me streaming

    Simple streaming midlet (I hope I did not make any mistakes, when removing some extra testing stuff from the source).
    This is edited version form one streaming midlet source code I grabbed somewhere, I did not anymore find the original code. [Edit: as pointed in the FN blog by Robert the source for this seems to be here http://developer.sonyericsson.com/si...aming_v800.jsp as the structure and variable names are same, even though there a number of differences in the code, hence I have copied the copyright disclaimer from the original available in the URL above. Thanks Robert! At the same time I apologize that Jöns Weimarck's work has been visible here without proper credit]
    [Edit2: I removed the orginal one and rewrote the code as I felt that was proper thing to do. This current version works like the original one.]

    Note also that the use of alerts here is not optimal. I was originally using alerts for another purpose than logging error information. now the log function looks like an ugly hack

    Hartti

    Code:
    import javax.microedition.media.*;
    import javax.microedition.media.control.VideoControl;
    import javax.microedition.midlet.*;
    import javax.microedition.lcdui.*;
    
    public class StreamVideo extends MIDlet implements Runnable, PlayerListener, CommandListener
    {
    	Display d;
    	Form f;
    	Alert a;
    	Command exit, start;
    	
        Thread streamThread;
    
        Player vp;
        VideoControl vc;
    	
    	public StreamVideo()
    	{
    		d = Display.getDisplay(this);
    		f = new Form("Stream test");
    		exit = new Command("Exit", Command.EXIT, 1);
    		start = new Command("Start streaming", Command.OK, 1);
    		f.addCommand(exit);
    		f.addCommand(start);
    		f.setCommandListener(this);
    	}
    	
    	protected void destroyApp(boolean p1)
    	{
            try {
                vp.stop();
                vp.close();
            }
            catch( Exception e ) {
            	log("Exception: " + e.toString());        
            }
            notifyDestroyed();
    	}
    
    	protected void startApp(  )
    	{
    		d.setCurrent(f);
    		streamThread = new Thread(this);
    	}
    
    	protected void pauseApp()
    	{
    	}
    
    	public void run()
    	{
    		doTheStream();
    	}
    
    	public void playerUpdate(Player p1, String p2, Object p3)
    	{
            log("playerUpdate: " + p2);
    	}
    	
    	public void commandAction(Command c1, Displayable d1)
    	{
    		if (c1 == start) {
    	        streamThread.start();
    		} else {
    			destroyApp(true);
    		}
    	}
    	
        public void log(String msg){
        	a = new Alert("Exception", msg, null, AlertType.CONFIRMATION);
        	d.setCurrent(a, f);
         }
        
        public void doTheStream()
        {
            try{
            	vp = Manager.createPlayer("rtsp://ra.yle.fi/yle24/video/uusin_mobile.rm");
            	vp.addPlayerListener(this);
            	vp.realize();
            	vc = (VideoControl)vp.getControl("VideoControl");
            	if (vc != null) {
            		f.append((Item)vc.initDisplayMode(VideoControl.USE_GUI_PRIMITIVE, null));
            		vc.setDisplaySize(176,144);
            		vc.setDisplayLocation(0,0);
            	}          
            	vp.start(); 
            }catch(Exception e){
            	log("Exception: " + e.toString());
            }    	
        }
    }
    Last edited by hartti; 2007-01-03 at 02:24.

  13. #13
    Registered User
    Join Date
    Nov 2006
    Posts
    16

    Re: j2me streaming

    Hi Haarti.

    I've tried out your code with my live streaming video URL (I believe it is the same one that jeemeng would have passed to you, as we passed it to him).

    Well, it still did not work with your code. Maybe I did something wrong somewhere I don't know but hopefully you can maybe give me the full code.
    I've emailed you the URL anyway.

    I got your code to work with streaming clip videos but not the live videos. (Streaming clips has an ending and total time to the video while live streaming videos do not have an ending or total time to what I am playing).

    I really want to know how you can get it to work.

    Many thanks.

    FYI, on my app, I am using canvas draw to draw the interface of the application and the video.
    My phone is a N73 Nokia, S60 3rd Edition.
    Last edited by danlloke; 2006-11-13 at 05:57.

  14. #14
    Registered User
    Join Date
    Nov 2006
    Posts
    3

    Re: j2me streaming

    I tried your code on an E62 on the Cingular network, and it didn't render the video.

    Do we have to change the data settings to use the a Multimedia connection?

    Is there a special data plan we need from Cingular to stream video?

    Please let me know what could be the problem.

    Thanks.
    MCho

  15. #15
    Super Contributor
    Join Date
    Apr 2003
    Location
    USA, CA
    Posts
    7,191

    Re: j2me streaming

    mcho, make sure you have the default access point specified in the Real Player, that is the APN used for J2ME streaming

    Hartti

Similar Threads

  1. Streaming Server Supported by J2ME
    By telekomahmed in forum Mobile Java General
    Replies: 7
    Last Post: 2011-05-24, 13:48
  2. J2ME Video Streaming
    By bangus in forum Mobile Java Media (Graphics & Sounds)
    Replies: 47
    Last Post: 2010-06-09, 00:10
  3. recording audio and streaming it over a network using j2me
    By babai78 in forum Mobile Java Tools & SDKs
    Replies: 4
    Last Post: 2007-10-17, 08:17
  4. audio streaming using j2me
    By niveas in forum Mobile Java Media (Graphics & Sounds)
    Replies: 2
    Last Post: 2006-03-24, 20:16
  5. RTSP streaming in j2me phones
    By Mr_MacPhisto in forum Streaming and Video
    Replies: 0
    Last Post: 2005-10-18, 11:14

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×