UNPKG

three

Version:

JavaScript 3D library

31 lines (17 loc) 657 B
/** * @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; function update() { requestAnimationFrame( update ); if ( video.readyState >= video.HAVE_CURRENT_DATA ) { scope.needsUpdate = true; } } update(); }; THREE.VideoTexture.prototype = Object.create( THREE.Texture.prototype ); THREE.VideoTexture.prototype.constructor = THREE.VideoTexture;