open-audiovisual
Search GitHub

oav-p5 reference · The OAVp5 object (advanced)

OAVp5.check()#

functionoav-p5
OAVp5.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

NameTypeDescription
optsObject{ 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

jsOpenProcessing ↗
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);
}
Prints the check-up text on the canvas: version, browser, microphone, MIDI and the rest, one line each.
jsOpenProcessing ↗
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);
}
Click the canvas: the check-up card opens over the page, with a copy button, ready to screenshot.

Related

  • OAVp5.hints The 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.version The version of oav-p5 that loaded, as text such as '0.8.0'.
  • debug Prints [oav-p5 debug] lines in the console about clicks, the 🎹 button and loading, for finding out why the 🎹 does not respond.
  • OAVp5.mic.state Where the microphone is: 'off', 'asking', 'on', 'denied' or 'unavailable'.
  • OAVp5.hardware Where Web MIDI stands: 'off', 'asking', 'connected', 'waiting', 'denied' or 'unavailable'.

p5/oav-p5.js, line 2847

↑ Back to top · All names