iOS Developer Library

Developer

AVFoundation Framework Reference AVAssetResourceLoadingDataRequest Class Reference

Options
Deployment Target:

On This Page
Language:

AVAssetResourceLoadingDataRequest

Use the AVAssetResourceLoadingDataRequest class to request data from a resource referenced by an AVAssetResourceLoadingRequest instance. More...

Inheritance


  • NSObject
  • AVAssetResourceLoadingDataRequest
  • NSObject
  • AVAssetResourceLoadingDataRequest

Conforms To


Import Statement


import AVFoundation @import AVFoundation;

Availability


Available in iOS 7.0 and later.
  • Provides data to the loading request.

    Declaration

    Swift

    func respondWithData(_ data: NSData!)

    Objective-C

    - (void)respondWithData:(NSData *)data

    Parameters

    data

    An instance of NSData containing some or all of the requested bytes.

    Discussion

    This method may be invoked multiple times on the same instance of AVAssetResourceLoadingDataRequest to provide the full range of requested data incrementally. Upon each invocation, the value of the currentOffset property is updated to match the amount of data provided.

    Import Statement

    import AVFoundation

    Availability

    Available in iOS 7.0 and later.

    See Also

    currentOffset

  • The length, in bytes, of the data requested. (read-only)

    Declaration

    Swift

    var requestedLength: Int { get }

    Objective-C

    @property(nonatomic, readonly) NSInteger requestedLength

    Discussion

    If the content length of the resource is unknown, the sum of the requestedLength and requestedOffset properties may be greater than the actual content length. When this situation occurs, an application must attempt to provide as much of the requested data beginning at the requestedOffset property as the resource contains. The application must then invoke either the AVAssetResourceLoadingRequest instance’s finishLoading method upon success, or the finishLoadingWithError: method if an error is encountered during the loading.

    Import Statement

    import AVFoundation

    Availability

    Available in iOS 7.0 and later.

    See Also

    requestedLength

  • The position within the resource of the first byte requested. (read-only)

    Declaration

    Swift

    var requestedOffset: Int64 { get }

    Objective-C

    @property(nonatomic, readonly) long long requestedOffset

    Discussion

    When all of the requested bytes that can be provided have been loaded—including the possible contentInformationRequest data in the AVAssetResourceLoadingRequest instance that contains the receiver—the delegate should respond by invoking finishLoading.

    If the requestedOffset value is beyond the content length of the resource, the AVAssetResourceLoadingRequest instance is sent a finishLoading message without any prior invocations of respondWithData:.

    Import Statement

    import AVFoundation

    Availability

    Available in iOS 7.0 and later.

    See Also

    requestedOffset

  • The position within the resource of the next byte. (read-only)

    Declaration

    Swift

    var currentOffset: Int64 { get }

    Objective-C

    @property(nonatomic, readonly) long long currentOffset

    Discussion

    When incrementally loading data you should begin loading at this offset, returning the data by invoking the respondWithData: method. Bytes previous to this value have already been provided.

    Import Statement

    import AVFoundation

    Availability

    Available in iOS 7.0 and later.