Type Method

defaultDeviceWithMediaType:

Returns the default device used to capture data of a given media type.

Declaration

+ (AVCaptureDevice *)defaultDeviceWithMediaType:(AVMediaType)mediaType;

Parameters

mediaType

A media type identifier.

For possible values, see AVFoundation Constants.

Return Value

The default device used to capture data of the type indicated by mediaType.

Discussion

When you use this method to request a camera (using the AVMediaTypeVideo media type), the returned device is always of the AVCaptureDeviceTypeBuiltInWideAngleCamera device type. To request other device types, use the defaultDeviceWithDeviceType:mediaType:position: method instead.

See Also

Discovering Devices

+ deviceWithUniqueID:

Returns the device with a given ID.

+ defaultDeviceWithDeviceType:mediaType:position:

Returns the default device for the specified device type, media type, and position.

AVCaptureDevicePosition

Constants to specify the position of a capture device.

AVCaptureDeviceType

Values identifying the capture device’s type.

AVCaptureDeviceDiscoverySession

A query for finding and monitoring available capture devices.

AVCaptureDeviceWasConnectedNotification

Posted when a new device becomes available.

AVCaptureDeviceWasDisconnectedNotification

Posted when an existing device becomes unavailable.

+ devices

Returns an array of the available capture devices on the system.

Deprecated
+ devicesWithMediaType:

Returns an array of the devices able to capture data of a given media type.

Deprecated

Beta Software

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