diff --git a/src/renderers/common/Textures.js b/src/renderers/common/Textures.js index 36daedc4e915b7..ed37b0cfc543ac 100644 --- a/src/renderers/common/Textures.js +++ b/src/renderers/common/Textures.js @@ -372,6 +372,12 @@ class Textures extends DataMap { target.height = image.videoHeight || 1; target.depth = 1; + } else if ( image instanceof VideoFrame ) { + + target.width = image.displayWidth || 1; + target.height = image.displayHeight || 1; + target.depth = 1; + } else { target.width = image.width || 1; diff --git a/src/textures/Source.js b/src/textures/Source.js index 7d894869f7bedb..2b718a10b03000 100644 --- a/src/textures/Source.js +++ b/src/textures/Source.js @@ -73,13 +73,23 @@ class Source { } + /** + * Returns the dimensions of the source into the given target vector. + * + * @param {(Vector2|Vector3)} target - The target object the result is written into. + * @return {(Vector2|Vector3)} The dimensions of the source. + */ getSize( target ) { const data = this.data; if ( data instanceof HTMLVideoElement ) { - target.set( data.videoWidth, data.videoHeight ); + target.set( data.videoWidth, data.videoHeight, 0 ); + + } else if ( data instanceof VideoFrame ) { + + target.set( data.displayHeight, data.displayWidth, 0 ); } else if ( data !== null ) {