×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    Oct 2004
    Posts
    29

    Play video downloaded over HTTP on 6680 and N90

    Hello

    I have an application that downloads 3GP video over HTTP and plays it back on a Nokia 3230.
    If I create the player from the URL (i.e. Manager.createPlayer(URL) it throws an exception but works OK when creating it from an InputStream (i.e. Manager.createPlayer(Connector.openInputStream(URL),"video/3gpp"). I don't understand that and am assuming it to be a bug. But OK, I've got that Connector.openInputStream() workaround.

    Now I want to use this app on 6680 and N90 but it will just stall while realizing the Player object, not throwing any exception and not leaving the realize() method.
    Here is the code where my app will stall:

    _Player = Manager.createPlayer( Connector.openInputStream(_MediaURI), "video/3gpp" );
    _Player.realize();
    _Player.prefetch();
    _VideoControl = (VideoControl)_Player.getControl( "VideoControl" );
    deleteAll(); // remove every Item from "this" form
    _VideoItem = (Item)_VideoControl.initDisplayMode( GUIControl.USE_GUI_PRIMITIVE, null );
    _VideoItem.setLayout( Item.LAYOUT_LEFT | Item.LAYOUT_TOP );
    _VideoItemIndex = append( _VideoItem );

    This code is executed in a separate thread but the UI never changes. A look at the HTTP server's access log however shows that the content was properly requested.

    My app also holds a persistent TCP connection to some server. With some SIM cards, it prevented HTTP requests to be made simultaneously but does not seem to be the problem here since I've been able to fetch some other content over HTTP at the time the app stalls and my access log shows the request for the video content.

    Does somebody have any clues ?
    Am I missing something or is this really an issue with S60 2nd Ed FP2 & 3 ?
    Any help will be welcome !
    Last edited by Emmanuel Raulo; 2006-02-06 at 16:16.

  2. #2
    Registered User
    Join Date
    Apr 2004
    Location
    Philippines
    Posts
    31

    Re: Play video downloaded over HTTP on 6680 and N90

    I've done exactly the same as what you did in creating the player[1] and it was working fine on 6680.

    My question is, how can you invoke the default player (the one that is installed on the phone) from a MIDlet application? Is it possible? Because I can't seem to play a 3gp file using my MIDP application but the phone's default player can...

    [1]
    public void open(String url) {
    //try {
    try {
    if ( player == null ) {
    if (true/*url.startsWith("resource:")*/) {
    player = Manager.createPlayer( Connector.openInputStream("http://mobile.anxa.com/dev/test.3gp"), "video/3gpp" );
    }
    else {
    player = Manager.createPlayer(url);
    }
    player.addPlayerListener(this);
    }
    System.out.println("Realizing...");
    player.realize();
    }catch(Exception e) {
    e.printStackTrace();
    System.out.println("Realize error!!!");
    }

    try {
    if ((vidc = (VideoControl) player.getControl("VideoControl")) != null) {
    vidc.initDisplayMode(VideoControl.USE_DIRECT_VIDEO, this);
    //vidc.setDisplayFullScreen(true);
    vidc.setDisplayLocation(8, 8);
    vidc.setDisplaySize(176, 208);
    vidc.setVisible(true);
    }

    Control [] controls = player.getControls();

    for (int i = 0; i < controls.length; i++) {
    if (controls[i] instanceof VolumeControl)
    vc = (VolumeControl) controls[i];
    if (controls[i] instanceof RateControl)
    rc = (RateControl) controls[i];
    if (controls[i] instanceof FramePositioningControl)
    fpc = (FramePositioningControl) controls[i];
    }
    System.out.println("Prefetching...");
    player.prefetch();
    }catch(Exception e) {
    e.printStackTrace();
    System.out.println("Prefetch error!!!");
    }

    if (vidc == null)
    addCommand(pauseCommand);
    /*}catch (Exception me) {
    System.out.println("asdfgh");
    me.printStackTrace();
    player = null;
    }*/
    }

  3. #3
    Registered User
    Join Date
    Oct 2004
    Posts
    29

    Re: Play video downloaded over HTTP on 6680 and N90

    Quote Originally Posted by charisse
    I've done exactly the same as what you did in creating the player[1] and it was working fine on 6680.
    Can you tell me what firmware version it was ?

    My question is, how can you invoke the default player (the one that is installed on the phone) from a MIDlet application?
    There's already a thread for that question. Let's keep the answers there...
    Last edited by Emmanuel Raulo; 2006-02-07 at 08:45.

Posting Permissions

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