在 iOS 上使用 FB SDK 将视频上传到 Facebook 会消除方向。我该如何修复它?
我可以使用 facebook iOS SDK 上传到 facebook。然而,在应用程序(我们自己的应用程序)中以纵向拍摄的视频最终会在 Facebook 上以横向方式拍摄。
ALAssetRepresentation *rep = [asset defaultRepresentation];
Byte *buffer = (Byte*)malloc(rep.size);
NSUInteger buffered = [rep getBytes:buffer fromOffset:0.0 length:rep.size error:nil];
NSData *data = [NSData dataWithBytesNoCopy:buffer length:buffered freeWhenDone:YES];
以上是将视频文件转换为 NSData 文件的代码,该文件包含在 FB 上传请求中。我想这就是我失去方向的地方,但我找不到解决方案。有什么帮助吗?
谢谢,
克里斯
I can upload to facebook just fine using the facebook iOS SDK. However, a video shot in the app (our own app) in portrait orientation ends up in landscape on facebook.
ALAssetRepresentation *rep = [asset defaultRepresentation];
Byte *buffer = (Byte*)malloc(rep.size);
NSUInteger buffered = [rep getBytes:buffer fromOffset:0.0 length:rep.size error:nil];
NSData *data = [NSData dataWithBytesNoCopy:buffer length:buffered freeWhenDone:YES];
Above is the code that converts the video file to a NSData file that is included in the FB upload request. I imagine that's where i'm losing the orientation, but i can't find a solution. Any help out there?
Thanks,
Chris
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
请参阅以下网址
iphone ShareKit 与 Facebook 视频上传?
Refer the following Url
iphone ShareKit with Video upload for facebook?