OAVp5.record.last#
variableoav-p5OAVp5.record.last
The info of the last recording that was saved (the same object recordingSaved got), or null before the first one.
Handy when you did not keep info in recordingSaved(): show the last file name, or put OAVp5.record.last.url in a link. The address stays valid until a minute after the next take is saved.
- Type
Object | null
Replaced each time a take is saved. See recordingSaved() for its fields.
Examples
function setup() {
createCanvas(400, 300);
textSize(14);
}
function keyPressed() {
if (key === 'r') startRecording(2);
}
function draw() {
background(20);
fill(255);
const last = OAVp5.record.last;
text(last ? 'last file: ' + last.name + ' (' + last.seconds + ' s)' : 'nothing recorded yet, press r', 20, 30);
}Related
recordingSaved()An event you define: it is called when a recording has been saved and checked, with aninfoobject about the file.OAVp5.record.secondsHow long the running take has been going, in seconds, and the length of the last take after it.stopRecording()Stops the recording; the video is finished, downloaded, and handed torecordingSaved(info)and to the returned promise.