VideoTexture.js 640 B

123456789101112131415161718192021222324252627282930313233343536
  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. }
  9. VideoTexture.prototype = Object.assign( Object.create( Texture.prototype ), {
  10. constructor: VideoTexture,
  11. isVideoTexture: true,
  12. update: function () {
  13. var video = this.image;
  14. if ( video.readyState >= video.HAVE_CURRENT_DATA ) {
  15. this.needsUpdate = true;
  16. }
  17. }
  18. } );
  19. export { VideoTexture };
粤ICP备19079148号