java.lang.NullPointerExeption trying playing random video

edited September 2014 in Questions about Code

Hello! I got a trouble with this code, and it's that I can play a random video, but, unfortunatelly, it's only listened the audio and can't see the image of the video

import processing.video.*; 

String[] one = {"sexy.mov", "ciudad.mov", "despertador.mov", "recuerdo.mov"};

Movie MiPeli;  

void setup() 
{
  background(0);
  size(426, 240); 
}

void draw() 
{
 // image(MiPeli, 0, 0);
}

void movieEvent(Movie m) 
{  
  m.read();
}

void mousePressed()
{
  MiPeli = new Movie(this, one[int(random(one.length))]);
  image(MiPeli, 0, 0); 
  MiPeli.noLoop();
  MiPeli.play();
}

void mouseReleased()
{
  MiPeli.stop();
}

Hope your help Thanks ;)

Answers

  • void setup() {
      size(426, 240, JAVA2D);
      background(0);
      mousePressed();
    }
    
  • Ohh! Thank you very much **GoToLoop **, but there's another trouble with the library.

    I'm using Windows 7, Intel, with RADEON graphics and 2.2.1 version of Processing. I got this problem some days ago, and I update the drivers of the graphics card and the last version of java.

    void mousePressed()
    {
      MiPeli = new Movie(this, one[int(random(one.length))]); // ERROR HERE
      image(MiPeli, 0, 0); 
      MiPeli.noLoop();
      MiPeli.play();
    }
    

    Copy-paste the post:

    "A library used by this sketch is not installed properly A library relies on native code that's not available. Or only works properly when the sketch is run as a 64-bit application."

    What I can do? Thanks :P

Sign In or Register to comment.