0

YouTube の再開可能なアップロードを見ていた

進行状況は、ASIHTTPRequest で 0 から 1 にジャンプします。これが私のコードです:

-(void)uploadVideoFile:(NSDictionary *) params
{
    if(_location && _location.length != 0)
    {
        NSURL *url = [NSURL URLWithString:_location];
        ASIFormDataRequest *theRequest = [ASIFormDataRequest requestWithURL:url];
        [theRequest setRequestMethod:@"PUT"];

        NSString *length = [NSString stringWithFormat:@"%lld",[WSKSharerHelper fileSizeWithPath:_filePath]];
        [theRequest addRequestHeader:@"Content-Type"    value:@"video/quicktime"];
        [theRequest addRequestHeader:@"Content-Length"  value:length];

        [theRequest appendPostDataFromFile:_filePath];

        theRequest.delegate = self;
        theRequest.uploadProgressDelegate = self;
        theRequest.timeOutSeconds = 100;
        [[ASIManager manager] addRequest:theRequest];
        [[ASIManager manager] startQueue];
    }
}
4

1 に答える 1

0
theRequest.showAccurateProgress = YES;

これにより、正確な進行状況の追跡がオンになります。場合によってはパフォーマンスに影響することに注意してください。詳細については、ドキュメントを参照してください。

于 2012-12-29T08:23:50.967 に答える