3

I have to handle HTTP status when error occurred during asset loading:

    [asset loadValuesAsynchronouslyForKeys:requestedKeys completionHandler: ^{
        dispatch_async( dispatch_get_main_queue(), ^{
            for (NSString *thisKey in requestedKeys) {
                NSError *error = nil;
                AVKeyValueStatus keyStatus = [asset statusOfValueForKey:thisKey error:&error];
                if (keyStatus == AVKeyValueStatusFailed) {
                    [self playbackFailedWithError:error];
                    return;
                }
            }
        });
    }];

Video file URL has 410 Gone HTTP Status. In this case retries file from API is needed, but error returns:

Error Domain=AVFoundationErrorDomain Code=AVErrorUnknown

How can I retrieve HTTP code of response or more detailed information about error?

kapo
  • 61
  • 5

0 Answers0