Post video using Facebook Graph API [duplicate]

2019-08-24 03:08发布

问题:

Possible Duplicate:
iPhone Facebook Video Upload

I have to capture a video from my iphone and using Facebook Graph API I have to post video on my facebook wall. I know how the things are done with image uploading process. But I am facing problem with video.

Thanks

Tariq

回答1:

It works for me.

Facebook *facebook = ...;       // Facebook object.
NSString *videoFilePath = ...;  // File path to video file.

NSMutableDictionary *params = [NSMutableDictionary dictionaryWithCapacity:3L];

[params setObject:[NSData dataWithContentsOfFile:videoFilePath] forKey:@"video_filename.MOV"];
[params setObject:@"Title for this post." forKey:@"title"];
[params setObject:@"Description for this post." forKey:@"description"];

[facebook requestWithGraphPath:@"me/videos" andParams:params andHttpMethod:@"POST" andDelegate:self];