OAVp5.record.formats()#
functionoav-p5OAVp5.record.formats()
Says what this browser can record: { recorder, mp4, webm, mime }.
Use it before you offer a recording button, or to tell the person which file they will get: MP4 goes to Instagram and every editor, WebM does not. It asks the browser each time you call it.
Returns
Object recorder is true when the browser has MediaRecorder at all, mp4 and webm are true when it can write that format, and mime is the MIME type a recording asks for first (MP4 where possible), or '' when none works.
Examples
function setup() {
createCanvas(400, 300);
textSize(14);
}
function draw() {
background(20);
fill(255);
const f = OAVp5.record.formats();
text('recorder: ' + f.recorder, 20, 30);
text('mp4: ' + f.mp4 + ' webm: ' + f.webm, 20, 60);
text('asks for: ' + (f.mime || 'nothing'), 20, 90);
}Related
startRecording()Records the canvas and the sound your sketch makes into one video file, and returns a promise that says whether the recording began.OAVp5.recordThe object behind the recording names: the state, the time, the last file, the formats this browser can write and the screenshot function.