将视频上传到Facebook错误:视频上传超时

时间:2016-05-27 21:36:46

标签: ios facebook facebook-graph-api

我尝试使用Graph API将视频上传到Facebook并收到此错误。

code = 390;
error_subcode = 1363030;
error_user_msg = "Your video upload timed out before it could be completed. This is probably because of a slow network connection or because the video you're trying to upload is too large. Please try again.";
 error_user_title = "Video Upload Time Out";
 message = "There was a problem uploading your video file. Please try again.";

以下是我的代码:

NSData *videoData = [NSData dataWithContentsOfFile:videoURL];
NSMutableDictionary *params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
                                videoData, @"video.mp4",
                                @"video/mp4", @"contentType",
                                @"message text", @"title",
                                @"title text", @"description",
                                nil];
[[[FBSDKGraphRequest alloc]
                  initWithGraphPath:@"me/videos"
                  parameters: params
                  HTTPMethod:@"POST"]
                 startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection, id result, NSError *error) {
                     if (!error) {
                         NSLog(@"Post id:%@", result[@"id"]);
                     }
                     else {
                         NSLog(@"video upload error: %@", error.description);
                     }
                 }];

我读了问题和答案,但我找不到正确的解决方案。 我不认为这是网络或视频编解码器问题。 视频文件大小低于1MB,并且在Facebook应用程序中上传时没有任何问题。

问题是什么?请帮帮我。

提前致谢。

0 个答案:

没有答案