We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 78fe510 + e7261a1 commit b8c04ebCopy full SHA for b8c04eb
src/webgl/material.js
@@ -118,7 +118,8 @@ p5.prototype.texture = function(){
118
textureData = args[0].canvas;
119
}
120
//if param is a video
121
- else if (args[0] instanceof p5.MediaElement){
+ else if (typeof p5.MediaElement !== 'undefined' &&
122
+ args[0] instanceof p5.MediaElement){
123
if(!args[0].loadedmetadata) {return;}
124
textureData = args[0].elt;
125
@@ -133,7 +134,8 @@ p5.prototype.texture = function(){
133
134
135
else {
136
if(args[0] instanceof p5.Graphics ||
- args[0] instanceof p5.MediaElement){
137
+ (typeof p5.MediaElement !== 'undefined' &&
138
+ args[0] instanceof p5.MediaElement)){
139
140
141
else if(args[0] instanceof p5.Image){
0 commit comments