×

Discussion Board

Results 1 to 2 of 2

Thread: 3650 java video

  1. #1
    Registered User
    Join Date
    Mar 2003
    Posts
    7

    3650 java video

    I am trying to play an mpeg video with series 60 concept emulator but when i run this code:
    try {

    //tipi=Manager.getSupportedContentTypes("http"
    //for(int i=0;i<tipi.length;i++)
    //System.out.println(tipi[i]);

    InputStream is = getClass().getResourceAsStream("/prova.mpeg"

    Player p = Manager.createPlayer(is, "video/mpeg"

    p.start();
    } catch (IOException ioe) {
    System.out.println("ecc 1"

    } catch (MediaException me) {

    System.out.println(me);
    }
    the emulator give me an error message
    Cannot Create a Player for video/mpeg
    After i try with video/3gpp but there are many problems with this format
    Can you help me?

  2. #2
    Nokia Developer Expert
    Join Date
    Mar 2003
    Posts
    382

    RE: 3650 java video

    Hello

    I try to provide some information to about
    audio and video formats supported by nokia 3650 when using Java Mobile Multimedia API 1.0 / JSR-135.

    Basics of MMA
    Manager = Overall controller of the multimedia
    Creates a Player
    Player p = Manager.createPlayer(http://webserver/tune.mid"

    Player = Content handler interface

    Control = Interface to control Player features

    Optional content-specific controls:
    ToneControl, VolumeControl, MIDIControl, etc.

    Based on the spec, in should work like this:
    VolumeControl vc;
    try {
    p = Manager.createPlayer("http://webserver/tone.mid"
    p.realize();

    // Grab volume control for the player.
    // Set Volume to max.
    vc = (VolumeControl)p.getControl("VolumeControl"
    if (vc != null)
    vc.setVolume(100);

    // To guarantee that the player can start with the smallest latency.
    p.prefetch();

    // Non-blocking start
    p.start();
    } catch (IOException e) {
    } catch (MediaException e) {
    }

    Here is the list of MMA Features supported in 3650:

    Camera:snapshots in PNG, JPG, BMP
    Video:Playing a video clip: 3GP, ( NIM ) not recording
    Controls:VIDEO : VideoControl, VolumeControl, StopTimeControl

    Sounds:
    WAV, MIDI, SF-MIDI and SP-MIDI, AMR Creation of Tone Sequence
    Controls:
    Sampled audio : VolumeControl, StopTimeControl
    Tone Sequence : ToneControl, VolumeControl, StopTimeControl
    MIDI : VolumeControl, StopTimeControl

    In future 3GP format will be better that .NIM Video Format

    Mobile media API will be part of MIDP 2.0 or direct subset.

    ***************************************************

    Here is example how to play video in canvas:

    a sample of play methdod:

    private void play()
    {
    String videoFile ="/VideoClip.3gp";

    try
    {
    InputStream is = getClass().getResourceAsStream(videoFile);
    player = Manager.createPlayer(is, "video/3gpp"
    player.addPlayerListener(this);
    player.realize();

    // get the video control and attach it to our canvas
    VideoControl videoControl =
    (VideoControl)(player.getControl("VideoControl&quot);
    if (videoControl == null)
    {
    midlet.alertError("VideoControl not supported"
    }
    else
    {
    videoControl.initDisplayMode(VideoControl.USE_DIRECT_VIDEO,
    this);

    // centre video, letting it be clipped if it's too big
    int canvasWidth = getWidth();
    int canvasHeight = getHeight();
    int displayWidth = videoControl.getDisplayWidth();
    int displayHeight = videoControl.getDisplayHeight();
    int x = (canvasWidth - displayWidth) / 2;
    int y = (canvasHeight - displayHeight) / 2;
    videoControl.setDisplayLocation(x, y);
    videoControl.setVisible(true);

    player.start();
    }
    }
    catch (IOException ioe)
    {
    discardPlayer();
    midlet.alertError("IOException: " + ioe.getMessage());
    }
    catch (MediaException me)
    {
    discardPlayer();
    midlet.alertError("MediaException: " + me.getMessage());
    }
    catch (SecurityException se)
    {
    discardPlayer();
    midlet.alertError("SecurityException: " + se.getMessage());
    }

    }

Posting Permissions

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