open-audiovisual
Search GitHub

oav-p5 reference · Recording

OAVp5.record.last#

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

jsOpenProcessing ↗
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);
}
Press r: two seconds later the last file name appears; press again and it changes.

Related

  • recordingSaved() An event you define: it is called when a recording has been saved and checked, with an info object about the file.
  • OAVp5.record.seconds How 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 to recordingSaved(info) and to the returned promise.

p5/oav-p5.js, line 1916

↑ Back to top · All names