Quantcast
Channel: Library Questions - Processing 2.x and 3.x Forum
Viewing all articles
Browse latest Browse all 2896

class that plays a video

$
0
0

Hi, I am trying to create a simple class that plays a video. When I run the script, only a black background shows up and the video doesn't play. If anyone knows how to fix this that would be awesome! Here's my code so far:

main body:

import processing.video.*;

PApplet app;

// DECLARE
siltScan mysiltScan;




void setup() {

  size(1000, 500);
  app = this;

  // INITIALIZE
  mysiltScan = new siltScan();

}


void draw() {

  background(0);

  // CALL FUNCTIONALITY
  mysiltScan.display();

}

class tab of my code:

class siltScan {

  // GLOBAL VARIABLES
  Movie videoOnly;
  int video_width     = 300;
  int video_height    = 500;
  int video_slice_x   = video_width/2;
  int window_width    = 1000;
  int window_height   = video_height;
  int draw_position_x = 0;
  boolean newFrame  = false;


  // CONSTRUCTOR
  siltScan() {
    videoOnly = new Movie(app, "videoOnly.mov");

  }


  // FUNCTIONS
  void display() {

    videoOnly.play();
    image(videoOnly, 150, 50, 300, 500);
  }
}

Viewing all articles
Browse latest Browse all 2896

Trending Articles