×

Discussion Board

Results 1 to 2 of 2

Thread: MMAPI Problem

  1. #1
    Registered User
    Join Date
    Jul 2004
    Posts
    1

    MMAPI Problem

    Hi there,

    I've got a frustrating problem and no idea what else to try. I get a 3gp file via httpconnection:

    httpcon = (HttpConnection)Connector.open(url);
    httpcon.setRequestMethod(HttpConnection.GET);
    httpcon.setRequestProperty("User-Agent","Profile/MIDP-1.0 Configuration/CLDC-1.0");
    is = httpcon.openInputStream(); //the InputStream
    streamLength = (int)httpcon.getLength();

    Then i create a Player with the InputStream:

    player = Manager.createPlayer(is, "video/3gpp");

    The player.realize() and player.prefetch() work fine, the file can be viewed. The Problem occurs when i'm trying to save the InputStream to a RecordStore...

    if (streamLength != -1) {
    toStore = new byte[streamLength];
    is.read(toStore);
    rs1.addRecord(toStore,0,toStore.length);//rs1 is the recordstore
    }

    ... and try to open the file:

    gep = Integer.parseInt(videoIdAsString);
    is = new ByteArrayInputStream(rs1.getRecord(gep));

    Now I've got another InputStream - and i read that the player should work with this too. The manager creates the player as planed, but the prefetch() won't work. If I skip the prefetching the player won't play, too ! So I guess that the stream got corrupted, but I don't know where... can anybody please give me a tip ?

    Thanks a lot,
    Christian

  2. #2
    Super Contributor
    Join Date
    Feb 2004
    Location
    Dallas
    Posts
    605
    once u have played the file ... that is the file is in phones buffer , u can try save it ..

    but i tried the same thing directly wiithout playing it .. and there was the same problem...

    because RMS size was a constraint .. i was not able to do it at that point of time...

Posting Permissions

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