content/hifi-content/dave/walk-tools/walkTools/libraries/three.js/textures/VideoTexture.js
2022-02-13 22:49:05 +01:00

30 lines
635 B
JavaScript

/**
* @author mrdoob / http://mrdoob.com/
*/
THREE.VideoTexture = function ( video, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy ) {
THREE.Texture.call( this, video, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy );
this.generateMipmaps = false;
var scope = this;
var update = function () {
requestAnimationFrame( update );
if ( video.readyState === video.HAVE_ENOUGH_DATA ) {
scope.needsUpdate = true;
}
};
update();
};
THREE.VideoTexture.prototype = Object.create( THREE.Texture.prototype );
THREE.VideoTexture.prototype.constructor = THREE.VideoTexture;