×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    Aug 2003
    Posts
    37

    Exclamation Play video on Canvas with N 6600 doesnt work. Please help!!!

    Hello, I have Nokia 6600 and I am writting midlet, which will just play the the video from local resource. When I am doing in Form and Item it's working well. But when I try to play video in canvas, I cannot see the video, just I can hear the sound of video. Here is my code:

    public class Video extends MIDlet {

    public VideoCanvas videoCanvas = null;

    public Video () {
    }

    public void startApp() {
    mainMenu();
    }

    public void pauseApp() {
    }

    public void destroyApp(boolean unconditional) {
    notifyDestroyed();
    }

    private void mainMenu() {
    try {
    videoCanvas = new VideoCanvas(this);
    Display.getDisplay(this).setCurrent(videoCanvas);
    } catch (Exception e) {
    }
    }
    }

    public class VideoCanvas extends Canvas {

    private Player player = null;
    private Video video = null;

    public VideoCanvas(Video video) {
    super();
    this.video = video;
    try {
    InputStream is = getClass().getResourceAsStream("/video.3gp");
    player = Manager.createPlayer(is, "video/3gpp");
    player.realize();
    player.prefetch();
    VideoControl vc = (VideoControl)player.getControl("VideoControl");
    vc.initDisplayMode(VideoControl.USE_DIRECT_VIDEO, this);
    vc.setDisplayLocation(0,0);
    player.start();
    } catch (Exception e) {
    }
    }

    public void paint(Graphics g) {
    g.setColor(0x000000);
    g.fillRect(0, 0, 176, 208);
    }

    public void keyPressed(int keyCode) {
    video.destroyApp(true);
    }
    }

    Thanks a lot for help!!!!!

  2. #2
    Registered User
    Join Date
    Oct 2004
    Posts
    29
    Hello

    You should try calling setVisible() on your VideoControl object. The video is not visible by default in canvas mode.

    Cheers,

    Emmanuel

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

    Re: Play video on Canvas with N 6600 doesnt work. Please help!!!

    I actually have the same problem. I also have invoked setVisible(true) on my VideoControl object but it did not work. Only the sound is played, the video is not shown.

Posting Permissions

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