本文介绍了如何使用iphone sdk 4.0在Facebook上上传视频?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在Facebook上上传视频。但是我的代码不工作: FBRequest * m_UploadRequest = [[FBRequest requestWithSession:_session delegate:self] retain];
NSURL * videoUrl = [NSURL URLWithString:@http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4];
NSData * VideoFileData = [NSData dataWithContentsOfURL:videoUrl];
NSMutableDictionary * Parameters = [NSMutableDictionary dictionaryWithObjectsAndKeys:@video.upload,@method,@Video Title,@title,nil];
[m_UploadRequest call:@facebook.video.uploadparams:参数dataParam:VideoFileData];
解决方案
您可以使用Facebook iOS SDK,并应使用Graph API上传视频:
NSURL * videoUrl = [NSURL URLWithString:@http://clips.vorwaerts-gmbh由Matchi.com提供回到/ big_buck_bunny.mp4\" ];
NSData * VideoFileData = [NSData dataWithContentsOfURL:videoUrl];
NSMutableDictionary * params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
VideoFileData,@video.mov,
@video / mp4,@contentType,
@Video Title ,@title,
nil];
[Facebook requestWithGraphPath:@me / videos
andParams:params
andHttpMethod:@POST
andDelegate:self];
您可能需要等待视频上传到您的个人资料,但您应该看到最终看到它在那里。
I am trying to upload video on Facebook. But my code is not working:
FBRequest *m_UploadRequest = [[FBRequest requestWithSession: _session delegate: self] retain];
NSURL *videoUrl=[NSURL URLWithString:@"http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4"];
NSData* VideoFileData = [NSData dataWithContentsOfURL:videoUrl];
NSMutableDictionary* Parameters = [NSMutableDictionary dictionaryWithObjectsAndKeys: @"video.upload", @"method", @"Video Title", @"title", nil];
[m_UploadRequest call: @"facebook.video.upload" params:Parameters dataParam: VideoFileData];
解决方案
You can use the Facebook iOS SDK and should use the Graph API to upload a video:
NSURL *videoUrl=[NSURL URLWithString:@"http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4"];
NSData* VideoFileData = [NSData dataWithContentsOfURL:videoUrl];
NSMutableDictionary *params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
VideoFileData, @"video.mov",
@"video/mp4", @"contentType",
@"Video Title", @"title",
nil];
[facebook requestWithGraphPath:@"me/videos"
andParams:params
andHttpMethod:@"POST"
andDelegate:self];
You may have to wait little bit for the video to upload to your profile but you should see eventually see it there.
这篇关于如何使用iphone sdk 4.0在Facebook上上传视频?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!