VideoTexture.js 678 B

1234567891011121314151617181920212223242526272829303132333435
  1. /**
  2. * @author mrdoob / http://mrdoob.com/
  3. */
  4. import { Texture } from './Texture.js';
  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. if ( video.readyState >= video.HAVE_CURRENT_DATA ) {
  11. scope.needsUpdate = true;
  12. }
  13. requestAnimationFrame( update );
  14. }
  15. requestAnimationFrame( update );
  16. }
  17. VideoTexture.prototype = Object.create( Texture.prototype );
  18. VideoTexture.prototype.constructor = VideoTexture;
  19. export { VideoTexture };
粤ICP备19079148号