Skip to content

Commit 3d31e27

Browse files
committed
Don't render if there's no texture
1 parent d72e86c commit 3d31e27

2 files changed

Lines changed: 8 additions & 2 deletions

File tree

src/gameobjects/video/VideoCanvasRenderer.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,10 @@
2121
*/
2222
var VideoCanvasRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix)
2323
{
24-
renderer.batchSprite(src, src.frame, camera, parentMatrix);
24+
if (src.videoTexture)
25+
{
26+
renderer.batchSprite(src, src.frame, camera, parentMatrix);
27+
}
2528
};
2629

2730
module.exports = VideoCanvasRenderer;

src/gameobjects/video/VideoWebGLRenderer.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,10 @@
2121
*/
2222
var VideoWebGLRenderer = function (renderer, src, interpolationPercentage, camera, parentMatrix)
2323
{
24-
this.pipeline.batchSprite(src, camera, parentMatrix);
24+
if (src.videoTexture)
25+
{
26+
this.pipeline.batchSprite(src, camera, parentMatrix);
27+
}
2528
};
2629

2730
module.exports = VideoWebGLRenderer;

0 commit comments

Comments
 (0)