×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    Aug 2007
    Posts
    46

    Playing Two Videos in Same Canvas

    Hi,
    iam developing a video player application in J2ME.
    i am using the canvas to display the contents.
    i want to display two videos in the same canvas half one part and another half another part.
    The thing is,i created whatever the necessary for the player to play a video and made two instances of that player.
    When i am playing that in an N95 mobile, only the sound was coming of the two videos. The actual videos are not displaying.

    Is there any possibility to display two videos in a canvas in J2ME. I tried different ways but the thing is same.
    Please help in this regard.
    Thanks,
    G.S.Rajasekhar

  2. #2
    Registered User
    Join Date
    Nov 2007
    Posts
    4

    Re: Playing Two Videos in Same Canvas

    Hi,

    i am also trying to do the same thing, but not able to get. if anybody can help in this issue please help us. this is my code and using N95.


    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,vp1;
    VideoControl vc,vc1;

    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://10.40.20.80:554/theboss.3gp");
    vp1 = Manager.createPlayer("rtsp://10.40.20.80:554/theboss.3gp");
    System.out.println("after create player");
    vp.addPlayerListener(this);
    vp1.addPlayerListener(this);
    vp.realize();
    vp1.realize();
    vc = (VideoControl)vp.getControl("VideoControl");
    vc1 = (VideoControl)vp1.getControl("VideoControl");
    if (vc != null) {
    f.append((Item)vc.initDisplayMode(VideoControl.USE_GUI_PRIMITIVE, null));
    f.append((Item)vc1.initDisplayMode(VideoControl.USE_GUI_PRIMITIVE, null));
    vc.setDisplayLocation(0,0);
    vc.setDisplaySize(100,100);
    vc1.setDisplayLocation(101,101);
    vc1.setDisplaySize(100,100);
    vc1.setVisible(true);

    }
    vp.start();
    vp1.start();
    }catch(Exception e){
    log("Exception: " + e.toString());
    }
    }
    }

  3. #3
    Registered User
    Join Date
    Aug 2007
    Posts
    46

    Re: Playing Two Videos in Same Canvas

    Hi haritha,
    This site having some information regarding same problem. I think probably this site will help you.

    http://developer.sonyericsson.com/me...ssageID=100029

    Thanks,
    G.S.Rajasekhar
    Last edited by satyarajasekhar; 2007-12-12 at 11:39. Reason: link forgot to add

Similar Threads

  1. Problem in playing multiple videos in the same problem
    By minasamy in forum Mobile Java Media (Graphics & Sounds)
    Replies: 1
    Last Post: 2007-06-22, 11:10
  2. Playing videos using JSR-135
    By oemer71 in forum Mobile Java Media (Graphics & Sounds)
    Replies: 0
    Last Post: 2005-11-17, 12:37
  3. Playing 2 Videos without "waiting time"?
    By dchiaramello in forum Symbian Media (Closed)
    Replies: 1
    Last Post: 2005-10-31, 15:55
  4. Playing back many videos with the MMAPI
    By delpiano in forum Mobile Java Media (Graphics & Sounds)
    Replies: 5
    Last Post: 2005-01-18, 04:15
  5. Major problem with delegation to Canvas
    By bartekn in forum Mobile Java Media (Graphics & Sounds)
    Replies: 8
    Last Post: 2003-10-08, 17:46

Posting Permissions

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