简体   繁体   中英

Uploading video to Facebook using FB SDK on iOS, removes orientation. How do I fix it?

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM