[英]how can I post large video on facebook sdk in iOS?
I am using facebook sdk for uploading videos, but I am not able to upload more than 60MB video on facebook. 我正在使用facebook sdk上传视频,但在facebook上不能上传60MB以上的视频。 I tried a lot using NSInputStream also for sending data and all :- 我也使用NSInputStream尝试了很多发送数据和所有操作:
NSString *filePath = [[NSBundle mainBundle] pathForResource:@"sample" ofType:@"mov"];
NSData *videoData = [NSData dataWithContentsOfFile:filePath];
NSMutableDictionary *params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
videoData, @"video.mov",
@"video/quicktime", @"contentType",
@"Video Test Title", @"title",
@"Video Test Description", @"description",
nil];
FBRequest *request = [FBRequest requestWithGraphPath:@"me/videos" parameters:params HTTPMethod:@"POST"];
[request startWithCompletionHandler:^(FBRequestConnection *connection, id result, NSError *error) {
NSLog(@"result: %@, error: %@", result, error);
}];
Use dataWithContentsOfFile:options instead. 请改用dataWithContentsOfFile:options。 Doesn't try to load all the data into memory, which may make your app getting closed by iOS: 请勿尝试将所有数据加载到内存中,这可能会使您的应用被iOS关闭:
NSData *videoData = [NSData dataWithContentsOfFile:video.localURL options:NSDataReadingMappedAlways error:&error];
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.