OAVp5.check()#
functionoav-p5OAVp5.check([opts])
Runs the 🩺 check-up: the version, page, browser, microphone, MIDI, sound, drums, recording, wiring and hints, as a card to screenshot and as an object.
The same thing the 🩺 button in the panel does. When something does not work for a student, OAVp5.check() in the console (or 🩺) gives a card that says what this browser did: whether the page is in an iframe, whether the microphone is on or blocked, whether Web MIDI exists and which devices it found, the last message, the sound and drum state, whether MP4 recording works, what the controller is wired to, which of the sketch's own names stepped in the way, and which cards have appeared. It has a copy button and a link to the site's full device check.
Parameters
| Name | Type | Description |
|---|---|---|
opts | Object | { show: false } skips the card on the page and only returns the report (the text still goes to the console). Left out, the card is shown. optional |
Returns
Object The report: { version, time, page, browser, microphone, midi, sound, drums, wiring, own, hints, external, recording, text }. text is the whole card as plain lines, the other fields are the same facts as data (microphone.state, midi.hardware, midi.devices …).
Notes
- It is a snapshot taken when you call it, not a live view. Calling it again replaces the card.
Examples
let report;
function setup() {
createCanvas(400, 300);
report = OAVp5.check({ show: false }); // the report, without the card on the page
}
function draw() {
background(20);
fill(255);
textSize(10);
text(report.text, 10, 10, width - 20, height - 20);
}function setup() {
createCanvas(400, 300);
}
function mousePressed() {
OAVp5.check(); // the card appears over the page
}
function draw() {
background(20);
fill(255);
text('click the canvas for the check-up card', 20, 30);
}Related
OAVp5.hintsThe list of cards oav-p5 has shown or would have shown so far (a blocked microphone, no Web MIDI, an error in your callback), each with what, why and what to press.OAVp5.versionThe version of oav-p5 that loaded, as text such as'0.8.0'.debugPrints[oav-p5 debug]lines in the console about clicks, the 🎹 button and loading, for finding out why the 🎹 does not respond.OAVp5.mic.stateWhere the microphone is:'off','asking','on','denied'or'unavailable'.OAVp5.hardwareWhere Web MIDI stands:'off','asking','connected','waiting','denied'or'unavailable'.