Facing issue on record Video and upload to server

80 views Asked by At

I am facing an issue where i am able to record video and upload it server the problem is that when i open that link on safari its only playing on Vlc i need to play on all device types and also when i am trying to display this video on button its showing only black screen, if i give the static video link its showing perfectly.

Thanks in advance.

- (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

There are 0 answers