面对记录视频问题并上传到服务器

时间:2015-06-08 06:07:04

标签: ios mpmovieplayercontroller

我正面临一个问题,我能够录制视频并上传服务器问题是,当我在Safari上打开该链接时,它只在Vlc上播放我需要在所有设备类型上播放,当我尝试如果我将静态视频链接显示为完美显示,则在按钮上显示此视频仅显示黑屏。

提前致谢。

- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info
 { 
      self.videoURL = info[UIImagePickerControllerMediaURL];
      NSLog(@"_videoURL :%@ ",_videoURL);
      MPMoviePlayerController *mp = [[MPMoviePlayerController alloc] initWithContentURL:self.videoURL];
      mp.shouldAutoplay = NO;
      mp.initialPlaybackTime = 0.5;
      mp.currentPlaybackTime = 1;
      tempImageForVideo = [mp thumbnailImageAtTime:1
      timeOption:MPMovieTimeOptionNearestKeyFrame];
      [mp stop];
      dataForVedio = UIImageJPEGRepresentation(tempImageForVideo,100);
      NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
      [defaults synchronize];
      imageStringForVideo =  [UIImagePNGRepresentation(tempImageForVideo)base64EncodedStringWithOptions:0];
      [picker dismissViewControllerAnimated:YES completion:NULL];
}

AFHTTPRequestOperationManager *manager = [[AFHTTPRequestOperationManager alloc] init];
imageData = UIImageJPEGRepresentation(tempimage, 0.5);
AFHTTPRequestOperation *op = [manager POST:loginUrl      parameters:dictForUserDetails       constructingBodyWithBlock:^(id<AFMultipartFormData> formData)
 {
      [formData appendPartWithFileData:imageData name:@"numberplate_image"  fileName:savedImagePath mimeType:@"image/jpeg"];
      [formData appendPartWithFileData:dataForVedio name:@"insident_video" fileName:savedVideoPath mimeType:@"video/quicktime"];
  }

0 个答案:

没有答案