Edit: problem was the pixel density setting set to 3 or something creating a canvas being too large.
I’m creating right now a presentation to be run on iPads and used then in a Salesforce-Veeva system, and I’m using P5.js to draw some things on the canvas. Locally for me it all works fine, but when I run the presentation in the app, P5.js seems to have problems firing up.
Following three warnings and two errors show up when I try to load it:
- [Warning] No device orientation events will be fired, reason: Permission to use the API was not yet requested.
- [Warning] No device motion events will be fired, reason: Permission to use the API was not yet requested
- [Warning] Canvas area exceeds the maximum limit (width * height > 16777216).
- [Error] TypeError: null is not an object (evaluating ‘document.querySelector(‘meta[name=viewport]’).getAttribute’)
- [Error] TypeError: null is not an object (evaluating ‘oldViewport.remove’)
And of course nothing is drawn.
- Motion and device events are not needed, so doesn’t really matter to me.
- The canvas size is 2732 * 2048, so smaller than the mentioned 16777216, so I don’t get why that is showing up, probably because P5.js has problems initializing correctly?
- Not sure why it says it can’t get the meta data. If I run
document.querySelector('meta[name=viewport]').getAttribute('content')in the console in the simulated tablet it works and returns the data correctly.
I’d be very thankful for any help.