×

Discussion Board

Results 1 to 5 of 5

Thread: Streaming video

  1. #1
    Regular Contributor
    Join Date
    Mar 2007
    Posts
    88

    Streaming video

    Hi people,
    I am trying to stream a video on my phones (nokia E66 and nokia N96). this is what I am using:

    InputStream in= getClass().getResourceAsStream("/video.mpg");
    player = Manager.createPlayer(in,"video/mpg");
    player.realize();

    I receive an exception.... is there something wrong?

    thank you in advence..

    antonio

  2. #2
    Super Contributor
    Join Date
    Jun 2003
    Location
    Cheshire, UK
    Posts
    7,395

    Re: Streaming video

    What's the exception?

    Should the mime-type be "video/mpeg"?

  3. #3
    Regular Contributor
    Join Date
    Mar 2007
    Posts
    88

    Re: Streaming video

    Hi grahamhughes,

    thanks for your quickly reply.


    I have used:

    InputStream in= getClass().getResourceAsStream("/video.mpg");
    player = Manager.createPlayer(in,"video/mpeg");
    player.realize();


    I have a try/catch

    catch(Exception e)
    {
    Alert erro = new Alert("Error",e.getMessage(),null,AlertType.ERROR);
    Data.display.setCurrent(erro);
    }

    And I received the error alert saying: "Could not create player"

    Do you know the reason? I may do some mistake....


    thanks
    antonio

  4. #4
    Super Contributor
    Join Date
    Jun 2003
    Location
    Cheshire, UK
    Posts
    7,395

    Re: Streaming video

    You need to know what the exception is.

    e.getClass().getName() might be more helpful.

    You can ask the device for supported content-types with:

    Code:
    String[] types = Manager.getSupportedContentTypes(null);

  5. #5
    Regular Contributor
    Join Date
    Mar 2007
    Posts
    88

    Re: Streaming video

    Hi grahamhughes,
    Using the e.getClass().getName(), i receive the exception: javax.microedition.media.MediaException

    Then, I found out that the mobile phone support the following format: video/3gpp, video/2gpp2, video/mp4, video/mpeg4

    So I tryed with:

    InputStream in= getClass().getResourceAsStream("/video.mpg");
    player = Manager.createPlayer(in,"video/mpeg4");
    player.addPlayerListener(this);
    player.realize();
    control = (VideoControl)player.getControl("VideoControl");
    if (control != null)
    {
    control.initDisplayMode(VideoControl.USE_DIRECT_VIDEO,this);
    control.setDisplaySize(control.getSourceWidth(),control.getSourceHeight());
    }
    player.start(); // here I get the exception


    but I still get the same exception....

    any suggestion?

    thanks a lot for your help,
    antonio
    Last edited by antonio5982; 2009-01-13 at 15:21.

Similar Threads

  1. Replies: 1
    Last Post: 2009-02-19, 13:53
  2. Streaming video playback: audio but no video
    By bpowley in forum Streaming and Video
    Replies: 7
    Last Post: 2009-01-21, 22: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
  •  
×