Class AVCapture Video Preview Layer
A Core Animation layer that displays the video as it’s captured.
iOS 4.0+ macOS 10.7+ Mac Catalyst 13.0+ Beta Declaration @interface AVCaptureVideoPreviewLayer :
is a subclass of
AVCapture Video Preview Layer that you use to display video as it’s captured by an input device. CALayer
You use this preview layer in conjunction with a capture session, as shown in the following code fragment.
// Create a preview layer.
let previewLayer = AVCaptureVideoPreviewLayer()
// Connect the preview layer with the capturing session.
previewLayer.session = captureSession
// Add the preview layer into the view's layer hierarchy.
Topics Layer Configuration video Gravity
Indicates how the layer displays the video content within its bounds.
Indicates whether the layer display supports changing the orientation.
Indicates whether the layer display is mirrored.
A Boolean value that indicates whether the layer is rendering video frames from its source.
Beta Session Configuration session
The previewed capture session.
The capture connection describing the
to which the preview layer is connected.
AVCapture Input Port Converting Between Coordinate Systems
This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.
Learn more about using Apple's beta software