Download node_modules/three/src/textures/VideoTexture.js from SimWorld-AI/industrial-harbor-viewer: direct link, hf CLI and curl.
- Browser
- Download file 1.11 kB
-
https://huggingface.co/spaces/SimWorld-AI/industrial-harbor-viewer/resolve/main/node_modules/three/src/textures/VideoTexture.js
- Command line
-
hf download hf://spaces/SimWorld-AI/industrial-harbor-viewer/node_modules/three/src/textures/VideoTexture.js
-
curl -L -o VideoTexture.js https://huggingface.co/spaces/SimWorld-AI/industrial-harbor-viewer/resolve/main/node_modules/three/src/textures/VideoTexture.js
1.11 kB
| import { LinearFilter } from '../constants.js'; | |
| import { Texture } from './Texture.js'; | |
| class VideoTexture extends Texture { | |
| constructor( video, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy ) { | |
| super( video, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy ); | |
| this.isVideoTexture = true; | |
| this.minFilter = minFilter !== undefined ? minFilter : LinearFilter; | |
| this.magFilter = magFilter !== undefined ? magFilter : LinearFilter; | |
| this.generateMipmaps = false; | |
| const scope = this; | |
| function updateVideo() { | |
| scope.needsUpdate = true; | |
| video.requestVideoFrameCallback( updateVideo ); | |
| } | |
| if ( 'requestVideoFrameCallback' in video ) { | |
| video.requestVideoFrameCallback( updateVideo ); | |
| } | |
| } | |
| clone() { | |
| return new this.constructor( this.image ).copy( this ); | |
| } | |
| update() { | |
| const video = this.image; | |
| const hasVideoFrameCallback = 'requestVideoFrameCallback' in video; | |
| if ( hasVideoFrameCallback === false && video.readyState >= video.HAVE_CURRENT_DATA ) { | |
| this.needsUpdate = true; | |
| } | |
| } | |
| } | |
| export { VideoTexture }; | |