I’m running an app I just built on safari mobile and I’m getting some strange errors. I’m loading the p5.js & p5.sound libraries but at the moment I’m not using any of p5.sound in my code. That would be added later.
I get this error right as the page loads:
TypeError: undefined is not an object (evaluating ‘t.p5’) p5.sound.js:1:419
The sketch is contained within a Wordpress site another developer created. The index.html adds the following scripts:
My code is doing is a background image and a compass graphic. The background image is 800x600 px and the compass graphic is 200x200 px. The compass graphic points at a specific trigger location that the user has to walk to. I am using the p5.geolocation library to track the users location and setup a geo fence. Here is the code for the graphics displayed in the canvas:
I am having no problem in Chrome in both mobile and desktop, the memory usage is around 10mb. I am also having no problem with Safari before version 12. But in Safari version 12 the memory usage goes up to 500 mb and the site crashes on mobile. Any ideas?
I think it is something to do with the tint() function being very memory intensive.
If possible I would try and avoid using it altogether, perhaps use an image that already is tinted rather than changing it in the program. Or maybe you could tint the image in setup() then save that and use that image in draw(), so you only need to do it once?
Does putting noTint() after image(arrow,0,0); fix the problem?