VideoTexture.js 652 B

1234567891011121314151617181920212223242526272829303132333435
  1. import { Texture } from './Texture';
  2. /**
  3. * @author mrdoob / http://mrdoob.com/
  4. */
  5. function VideoTexture( video, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy ) {
  6. Texture.call( this, video, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy );
  7. this.generateMipmaps = false;
  8. var scope = this;
  9. function update() {
  10. requestAnimationFrame( update );
  11. if ( video.readyState >= video.HAVE_CURRENT_DATA ) {
  12. scope.needsUpdate = true;
  13. }
  14. }
  15. update();
  16. }
  17. VideoTexture.prototype = Object.create( Texture.prototype );
  18. VideoTexture.prototype.constructor = VideoTexture;
  19. export { VideoTexture };