Skip to content

AVCaptureSession: outputs property ​

The outputs property is all of the session's current outputs.

Value ​

An array of AVCaptureOutput. The elements are in practice AVCaptureMetadataOutput.

  • Read-only. Assigning to it throws TypeError.
  • An empty array for a new session.
  • Outputs added with addOutput() read back as the same objects (verified by testing).
  • Each read gives a new array. Changing the array doesn't affect the session; add and remove outputs with addOutput() and removeOutput().
  • It changes only when the app itself adds or removes outputs, so there is no change event.

Examples ​

js
const session = new AVCaptureSession();
const output = new AVCaptureMetadataOutput();
session.addOutput(output);
console.log(session.outputs.length, session.outputs[0] === output);

Result: prints 1 true.

Corresponding iOS API ​

AVCaptureSession.outputs.

See also ​