×

Discussion Board

Results 1 to 5 of 5
  1. #1
    Registered User
    Join Date
    Jun 2010
    Location
    India
    Posts
    200

    Live video streaming in J2ME

    Hello friends,

    i'm making an application for j2me phone ,.,..........

    in that application i want to do live video streaming ....

    So please help me in this problem ...

    in that application i need to buffer video & play buffered video simultaneously ...

    Please give me the correct solution for this problem ....

    i'm using .3gp format .
    thanks & Regards.
    Nilesh

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

    Re: Live video streaming in J2ME

    Are you displaying video from some external streaming source (possible) or recording streamable video on the device (not possible with Java ME)?
    Hmmm.. reading you question again, I think you are talking about playback only. Good.

    For the first use case, check these resources
    sample code
    http://www.developer.nokia.com/Commu...ing_in_Java_ME
    video playback
    http://library.developer.nokia.com/t...705A6E813.html
    streaming on Symbian
    http://library.developer.nokia.com/t...1AE07991D.html
    streaming on Series 40
    http://library.developer.nokia.com/t...C3FD24533.html

    Hartti

  3. #3
    Registered User
    Join Date
    Jun 2010
    Location
    India
    Posts
    200

    Re: Live video streaming in J2ME

    Thanks for reply ....

    But in your 1st link containing ... Download all video data & then its play ..but i want like youtube videos ... means player get instantly start ... & play buffered video simultaneously buffer remaining video data ....
    ......
    how i can do this ... ?
    thanks & Regards.
    Nilesh

  4. #4
    Registered User
    Join Date
    Feb 2010
    Posts
    18

    Re: Live video streaming in J2ME

    Hi,

    Please test the code below :

    import javax.microedition.lcdui.*;
    import javax.microedition.media.*;
    import javax.microedition.midlet.MIDlet;
    import javax.microedition.midlet.MIDletStateChangeException;

    import javax.microedition.media.control.*;

    public class Test_MMAP1 extends MIDlet implements PlayerListener{

    Display d;
    Player player;

    public Test_MMAP1() {
    d=Display.getDisplay(this);
    // TODO Auto-generated constructor stub
    }

    protected void destroyApp(boolean arg0) throws MIDletStateChangeException {
    // TODO Auto-generated method stub

    }

    protected void pauseApp() {
    // TODO Auto-generated method stub

    }

    protected void startApp() throws MIDletStateChangeException {
    play();

    // TODO Auto-generated method stub

    }

    public void play(){
    try {

    String url = "rtsp://stream.zoovision.com/Movies/vader_sessions.3gp";
    VideoControl vc;
    // defplayer();
    // create a player instance
    player = Manager.createPlayer(url);
    player.addPlayerListener(this);
    // realize the player
    player.realize();
    //Get the video controller
    vc = (VideoControl)player.getControl("VideoControl");
    if(vc != null) {
    //Get a GUI to display the video
    Item video = (Item)vc.initDisplayMode(vc.USE_GUI_PRIMITIVE, null);
    //Item video = (Item)vc.initDisplayMode(vc.USE_DIRECT_VIDEO, null);
    vc.setVisible(true);//Set the video control to be visible.

    System.out.println("Playing");
    Form v = new Form("Playing Video...");
    StringItem si = new StringItem("Status: ","Playing...");
    //f.append(si);
    v.append(video);
    d.setCurrent(v);
    System.out.println("Successs");
    }
    //player.realize();
    player.prefetch();
    player.start();

    }
    catch(Exception noCanDo){
    Form f = new Form("Error");
    f.append("Error: "+noCanDo);
    d.setCurrent(f);
    }
    }

    public void playerUpdate(Player arg0, String arg1, Object arg2) {
    // TODO Auto-generated method stub

    }

    }

    Hope this helps you.

    Best Regards,
    Mayura.

  5. #5
    Registered User
    Join Date
    Jun 2010
    Location
    India
    Posts
    200

    Re: Live video streaming in J2ME

    Thanks for reply ......
    I got the solution for this..........

    Quote Originally Posted by maych View Post
    Hi,

    Please test the code below :

    import javax.microedition.lcdui.*;
    import javax.microedition.media.*;
    import javax.microedition.midlet.MIDlet;
    import javax.microedition.midlet.MIDletStateChangeException;

    import javax.microedition.media.control.*;

    public class Test_MMAP1 extends MIDlet implements PlayerListener{

    Display d;
    Player player;

    public Test_MMAP1() {
    d=Display.getDisplay(this);
    // TODO Auto-generated constructor stub
    }

    protected void destroyApp(boolean arg0) throws MIDletStateChangeException {
    // TODO Auto-generated method stub

    }

    protected void pauseApp() {
    // TODO Auto-generated method stub

    }

    protected void startApp() throws MIDletStateChangeException {
    play();

    // TODO Auto-generated method stub

    }

    public void play(){
    try {

    String url = "rtsp://stream.zoovision.com/Movies/vader_sessions.3gp";
    VideoControl vc;
    // defplayer();
    // create a player instance
    player = Manager.createPlayer(url);
    player.addPlayerListener(this);
    // realize the player
    player.realize();
    //Get the video controller
    vc = (VideoControl)player.getControl("VideoControl");
    if(vc != null) {
    //Get a GUI to display the video
    Item video = (Item)vc.initDisplayMode(vc.USE_GUI_PRIMITIVE, null);
    //Item video = (Item)vc.initDisplayMode(vc.USE_DIRECT_VIDEO, null);
    vc.setVisible(true);//Set the video control to be visible.

    System.out.println("Playing");
    Form v = new Form("Playing Video...");
    StringItem si = new StringItem("Status: ","Playing...");
    //f.append(si);
    v.append(video);
    d.setCurrent(v);
    System.out.println("Successs");
    }
    //player.realize();
    player.prefetch();
    player.start();

    }
    catch(Exception noCanDo){
    Form f = new Form("Error");
    f.append("Error: "+noCanDo);
    d.setCurrent(f);
    }
    }

    public void playerUpdate(Player arg0, String arg1, Object arg2) {
    // TODO Auto-generated method stub

    }

    }

    Hope this helps you.

    Best Regards,
    Mayura.
    thanks & Regards.
    Nilesh

Similar Threads

  1. Live TV(Video) Streaming
    By mahendra_g1 in forum Symbian Networking & Messaging (Closed)
    Replies: 0
    Last Post: 2010-06-21, 15:14
  2. live video streaming
    By sis1987 in forum Symbian
    Replies: 5
    Last Post: 2008-05-29, 05:24
  3. Live Video Streaming???
    By sphinxcs898 in forum Mobile Java Media (Graphics & Sounds)
    Replies: 1
    Last Post: 2008-02-20, 16:36
  4. live video streaming
    By j2me_raj in forum Streaming and Video
    Replies: 3
    Last Post: 2003-09-30, 09:19
  5. live video streaming
    By j2me_raj in forum Mobile Java General
    Replies: 0
    Last Post: 2003-09-26, 12:20

Posting Permissions

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