package com.haxademic.app.haxmapper.textures;

import processing.video.Movie;

import com.haxademic.core.app.P;
import com.haxademic.core.system.FileUtil;

public class TextureVideoPlayer
extends BaseTexture {

	Movie _movie;

	public TextureVideoPlayer( int width, int height, String videoFile ) {
		super();
		
		_movie = new Movie( P.p, FileUtil.getHaxademicDataPath() + videoFile );
		// _movie.play();
		_movie.loop();
		_movie.volume(0);
		_movie.speed(1f);

		buildGraphics( width, height );
	}
	
	public void setActive( boolean isActive ) {
		super.setActive( isActive );
		if( _active == true ) {
			_movie.play();
		} else {
			_movie.pause();
		}
	}
	
	public void update() {
		super.update();

		_texture.beginDraw();
		_texture.image(_movie, 0, 0);
		_texture.endDraw();
	}
}

@@ -456,9 +456,11 @@
 eed(
-1
+0.5
 f);%0A
@@ -754,16 +754,49 @@
 ie, 0, 0
+, _texture.width, _texture.height
 );%0A%09%09_te

Fix mapped width/height