Каждый раз загружается одно и то же видео + Библиотека активов

    ImgVidData =[[NSData alloc]init];

    ALAssetRepresentation *representation = alAsset.defaultRepresentation;
    NSURL *movieURL = representation.url;
    NSURL *uploadURL = [NSURL fileURLWithPath:[[NSTemporaryDirectory() stringByAppendingPathComponent:@"test"] stringByAppendingString:@".mov"]];

  //  ImgVidData = [NSData dataWithContentsOfFile: [[NSTemporaryDirectory() stringByAppendingPathComponent:@"test"] stringByAppendingString:@".mp4"]];

    AVAsset *asset      = [AVURLAsset URLAssetWithURL:movieURL options:nil];
    AVAssetExportSession *session =
    [AVAssetExportSession exportSessionWithAsset:asset presetName:AVAssetExportPresetMediumQuality];

    session.outputFileType  = AVFileTypeQuickTimeMovie;
    session.outputURL       = uploadURL;
    videoURL=uploadURL;
          [session exportAsynchronouslyWithCompletionHandler:^{

        if (session.status == AVAssetExportSessionStatusCompleted)
        {
            NSLog(@"output Video URL %@",uploadURL);

        }



    }];
    ImgVidData    = [NSData dataWithContentsOfURL:session.outputURL];

Выше приведен код, который я реализовал в активах didFinishPickingAssets:(NSArray *)

Я снимаю видео и загружаю видео на сервер. Я извлекаю URL загруженного видео, преобразовываю его в NSdata и загружаю на сервер.

Странно: каждый раз, когда я получаю одно и то же видео на сервер, который выбираю впервые. я выбираю разные видео каждый раз, но одни и те же видео получаются. Любая помощь!!

0 ответов

Другие вопросы по тегам