iOS Developer Library

Developer

AVFoundation Framework Reference AVAssetResourceLoadingContentInformationRequest Class Reference

Options
Deployment Target:

On This Page
Language:

AVAssetResourceLoadingContentInformationRequest

The AVAssetResourceLoadingContentInformationRequest class represents a query for essential information about a resource referenced by an asset resource loading request.

When a resource loading delegate, which must implement the AVAssetResourceLoaderDelegate protocol, receives an instance of AVAssetResourceLoadingRequest when the resourceLoader:shouldWaitForLoadingOfRequestedResource: is invoked and accepts responsibility for loading the resource it must check whether the contentInformationRequest property of the AVAssetResourceLoadingRequest is not nil. Whenever the value is not nil, the request includes a query for the information that AVAssetResourceLoadingContentInformationRequest encapsulates. In response to such queries, the resource loading delegate should set the values of the content information request's properties appropriately before invoking the AVAssetResourceLoadingRequest method finishLoading.

When finishLoading is invoked, the values of the properties of its contentInformationRequest property will, in part, determine how the requested resource is processed. For example, if the requested resource’s URL is the URL of an AVURLAsset and contentType is set by the resource loading delegate to a value that the underlying media system doesn’t recognize as a supported media file type, operations on the AVURLAsset, such as playback, are likely to fail.

Inheritance


  • NSObject
  • AVAssetResourceLoadingContentInformationRequest
  • NSObject
  • AVAssetResourceLoadingContentInformationRequest

Conforms To


Import Statement


Swift

import AVFoundation

Objective-C

@import AVFoundation;

Availability


Available in iOS 7.0 and later.
  • The UTI that specifies the type of data contained by the requested resource.

    Declaration

    Swift

    var contentType: String!

    Objective-C

    @property(nonatomic, copy) NSString *contentType

    Discussion

    Before finishing loading an AVAssetResourceLoadingRequest instance, if its contentInformationRequest property is not nil, set the value of this property to a UTI indicating the type of data contained by the requested resource.

    Import Statement

    Objective-C

    @import AVFoundation;

    Swift

    import AVFoundation

    Availability

    Available in iOS 7.0 and later.

  • The length, in bytes, of the requested resource.

    Declaration

    Swift

    var contentLength: Int64

    Objective-C

    @property(nonatomic) long long contentLength

    Discussion

    Before finishing loading an AVAssetResourceLoadingRequest instance, if its contentInformationRequest property is not nil, set the value of the contentLength property to the number of bytes contained by the requested resource.

    Import Statement

    Objective-C

    @import AVFoundation;

    Swift

    import AVFoundation

    Availability

    Available in iOS 7.0 and later.

  • A Boolean value that indicates whether random access to arbitrary ranges of bytes of the resource is supported.

    Declaration

    Swift

    var byteRangeAccessSupported: Bool

    Objective-C

    @property(nonatomic, getter=isByteRangeAccessSupported) BOOL byteRangeAccessSupported

    Discussion

    Before finishing loading an AVAssetResourceLoadingRequest instance, if its contentInformationRequest property is not nil, set the value of this property to YEStrue if it supports random access to arbitrary ranges of bytes of the resource.

    If this property is not YEStrue for resources that must be loaded incrementally, loading of the resource may fail. Such resources include anything that contains media data.

    If byte range access is supported portions of the resource can be requested more than once.

    Import Statement

    Objective-C

    @import AVFoundation;

    Swift

    import AVFoundation

    Availability

    Available in iOS 7.0 and later.

  • The date at which a new resource loading request will be issued for resources that expire, if the media system still requires it.

    Declaration

    Swift

    @NSCopying var renewalDate: NSDate!

    Objective-C

    @property(nonatomic, copy) NSDate *renewalDate

    Discussion

    If the asset resource is prone to expiry set the value of this property to the date at which a renewal should be triggered. You must do this before you finish loading an AVAssetResourceLoadingRequest object. This value must be set sufficiently early enough to allow an AVAssetResourceRenewalRequest , delivered to the delegate’s resourceLoader:shouldWaitForRenewalOfRequestedResource: method ß to finish before the actual expiry time, otherwise media playback may fail.

    Import Statement

    Objective-C

    @import AVFoundation;

    Swift

    import AVFoundation

    Availability

    Available in iOS 8.0 and later.