Structure

AVError

The error codes for the AVError domain.

Declaration

struct AVError

Topics

Error Properties

var errorCode: Int

The error code returned.

var errorUserInfo: [String : Any]

The user info associated with the error.

var device: AVCaptureDevice?

The capture device in use.

var fileSize: Int64?

The asset file size.

var fileType: AVFileType?

The asset file type.

var localizedDescription: String

The error's localized description.

var mediaSubtypes: [Int]?

An array of media subtypes.

var mediaType: AVMediaType?

The asset media type.

var persistentTrackID: CMPersistentTrackID?

The persistent track ID, if the track exists.

var presentationTimeStamp: CMTime?

The presentation time stamp.

var processID: Int?

The process ID.

var recordingSuccessfullyFinished: Bool?

A Boolean value indicating whether recording finished successfully.

var time: CMTime?

The time duration of the error.

Error Domain

static var errorDomain: String

The error domain as a string.

let AVFoundationErrorDomain: String

Domain for AVFoundation errors.

User Info Keys

let AVErrorPIDKey: String

The corresponding value is an NSNumber object containing a process ID number.

let AVErrorTimeKey: String

The corresponding value is an NSValue object containing a CMTime.

let AVErrorDeviceKey: String

The corresponding value is an NSString object with the name of the device.

let AVErrorFileSizeKey: String

The corresponding value is an NSNumber object containing the size of the file in bytes.

let AVErrorMediaTypeKey: String

The corresponding value is an NSString object that specifies a media type such as video, audio, or metadata. For a list of possible values, see AVFoundation Constants.

let AVErrorMediaSubTypeKey: String

The corresponding value is an array of NSNumber objects that specify media subtypes. The types are represented by four character codes (4ccs), as defined in CoreAudioTypes.h for audio media and in CMFormatDescription.h for video media.

let AVErrorRecordingSuccessfullyFinishedKey: String

The corresponding value is an NSNumber object with a Boolean value indicating whether recording finished successfully.

Error Constants

static var airPlayControllerRequiresInternet: AVError.Code

The AirPlay controller requires internet to function.

static var airPlayReceiverRequiresInternet: AVError.Code

The AirPlay receiver requires internet to function.

static var applicationIsNotAuthorized: AVError.Code

The application is not authorized to play media.

static var applicationIsNotAuthorizedToUseDevice: AVError.Code

The user has denied this application permission for media capture.

static var compositionTrackSegmentsNotContiguous: AVError.Code

The source media can’t be added because it contains gaps.

static var contentIsNotAuthorized: AVError.Code

The user is not authorized to play the media.

static var contentIsProtected: AVError.Code

The application is not authorized to open the media.

static var contentIsUnavailable: AVError.Code

Captured content is unavailable.

static var contentNotUpdated: AVError.Code

Captured content couldn’t be updated.

static var createContentKeyRequestFailed: AVError.Code

The app couldn't create a content key request.

static var decodeFailed: AVError.Code

The operation could not be completed because some source media could not be decoded.

static var decoderNotFound: AVError.Code

The decoder for the given media was not found.

static var decoderTemporarilyUnavailable: AVError.Code

The appropriate decoder is currently not available.

static var deviceAlreadyUsedByAnotherSession: AVError.Code

Media could not be captured from the device because it is already in use elsewhere in this application.

static var deviceInUseByAnotherApplication: AVError.Code

The device could not be opened because it is in use by another application.

static var deviceIsNotAvailableInBackground: AVError.Code

You attempted to start a capture session in the background, which is not allowed on iOS.

Deprecated
static var deviceLockedForConfigurationByAnotherProcess: AVError.Code

You cannot change the settings for the device because another app process is controlling the device.

static var deviceNotConnected: AVError.Code

The device could not be opened because it is not connected or turned on.

static var deviceWasDisconnected: AVError.Code

Recording stopped because the device was turned off or disconnected.

static var diskFull: AVError.Code

Recording stopped because the disk is getting full.

static var displayWasDisabled: AVError.Code

Screen capture failed because the display was inactive.

static var encoderNotFound: AVError.Code

The requested encoder was not found.

static var encoderTemporarilyUnavailable: AVError.Code

The appropriate encoder is currently not available.

static var exportFailed: AVError.Code

The export could not be completed.

static var externalPlaybackNotSupportedForAsset: AVError.Code

The current asset doesn’t support playback.

static var failedToLoadMediaData: AVError.Code

The media resource does not contain all of the data required and cannot be loaded.

static var failedToParse: AVError.Code

The media resource couldn’t be parsed and cannot be loaded.

static var fileAlreadyExists: AVError.Code

The file couldn’t be created because a file with the same name already exists in the same location.

static var fileFailedToParse: AVError.Code

The media couldn't be parsed.

static var fileFormatNotRecognized: AVError.Code

The media could not be opened because it is not in a recognized format.

static var fileTypeDoesNotSupportSampleReferences: AVError.Code

The file type doesn’t support sample references.

static var formatUnsupported: AVError.Code

The current asset format isn’t supported.

static var incompatibleAsset: AVError.Code

The media could not be displayed because the iOS device is not capable of playing the content.

static var invalidCompositionTrackSegmentDuration: AVError.Code

The source media can’t be added because its duration in the destination is invalid.

static var invalidCompositionTrackSegmentSourceDuration: AVError.Code

The source media can’t be added because it has no duration.

static var invalidCompositionTrackSegmentSourceStartTime: AVError.Code

The source media can’t be added because its start time in the destination is invalid.

static var invalidOutputURLPathExtension: AVError.Code

The path extension of the URL was invalid.

static var invalidSourceMedia: AVError.Code

The operation could not be completed because some source media could not be read.

static var invalidVideoComposition: AVError.Code

You attempted to perform a video composition operation that is not supported.

static var malformedDepth: AVError.Code

The depth data wasn’t properly structured.

static var maximumDurationReached: AVError.Code

Recording stopped because the maximum duration for the file was reached.

static var maximumFileSizeReached: AVError.Code

Recording stopped because the maximum size for the file was reached.

static var maximumNumberOfSamplesForFileFormatReached: AVError.Code

Recording stopped because the maximum number of samples for the file was reached.

static var maximumStillImageCaptureRequestsExceeded: AVError.Code

The photo could not be taken because there are too many photo requests that haven’t completed yet.

static var mediaChanged: AVError.Code

Recording stopped because the format of the source media changed.

static var mediaDiscontinuity: AVError.Code

Recording stopped because there was an interruption in the input media.

static var mediaServicesWereReset: AVError.Code

The operation could not be completed because media services became unavailable.

static var noDataCaptured: AVError.Code

Recording failed because no data was received.

static var noImageAtTime: AVError.Code

There is no image at that time in the media.

static var noLongerPlayable: AVError.Code

The asset is no longer playable.

static var noSourceTrack: AVError.Code

The asset has no source track.

static var operationNotAllowed: AVError.Code

The user requested an unsupported operation.

static var operationNotSupportedForAsset: AVError.Code

You attempted to perform an operation with the asset that is not supported.

static var operationNotSupportedForPreset: AVError.Code

You attempted to perform an operation that’s not supported for the current preset.

Beta
static var outOfMemory: AVError.Code

The operation could not be completed because there is not enough memory to process all of the media.

static var recordingAlreadyInProgress: AVError.Code

Movie file output on iOS supports only one recording at a time.

static var referenceForbiddenByReferencePolicy: AVError.Code

The asset attempted to follow a reference that was not allowed.

static var screenCaptureFailed: AVError.Code

There was an unexpected problem that prevented screen capture.

static var serverIncorrectlyConfigured: AVError.Code

The HTTP server sending the media resource is not configured as expected.

static var sessionConfigurationChanged: AVError.Code

Recording stopped because the configuration of media sources and destinations changed.

static var sessionHardwareCostOverage: AVError.Code

You requested too many camera hardware resources.

Beta
static var sessionNotRunning: AVError.Code

The recording couldn’t start because the session isn’t running.

static var sessionWasInterrupted: AVError.Code

Recording stopped because it was interrupted.

static var torchLevelUnavailable: AVError.Code

The specified torch level is valid but currently unavailable, possibly due to overheating.

static var undecodableMediaData: AVError.Code

The media data could not be decoded.

static var unknown: AVError.Code

Reason for the error is unknown.

static var unsupportedOutputSettings: AVError.Code

The user requested unsupported output settings.

static var videoCompositorFailed: AVError.Code

The video compositor couldn’t composite frames.

static func != (AVError, AVError) -> Bool

Returns a Boolean value indicating whether two values are not equal.

enum AVError.Code

An enumeration of possible error codes encountered in AVCapture.

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