我在应用程序文档目录中有一个处于横向模式的视频。我想将其方向永久更改为纵向模式。有谁知道我怎么能用代码做到这一点?有教程或示例吗?经过数小时的谷歌搜索,我找不到有关此主题的任何内容。
注意:我想完全改变方向,而不仅仅是在 MPMoviePlayerController 上改变它。因此,如果用户要在 Facebook、Twitter 等上分享该电影,它将始终以纵向模式显示在那里
-(IBAction)changeMovieToPortrait
{
NSArray* paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask ,YES);
NSString* documentsPath = [paths objectAtIndex:0];
NSString* movieFile1 = [documentsPath stringByAppendingPathComponent:@"movie1.mov"];
NSURL *movURL = [NSURL fileURLWithPath:movieFile1];
NSMutableDictionary* myDict = [NSMutableDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithBool:YES] ,
AVURLAssetPreferPreciseDurationAndTimingKey ,
[NSNumber numberWithInt:0],
AVURLAssetReferenceRestrictionsKey, nil];
AVURLAsset* movie = [[AVURLAsset alloc] initWithURL:movURL options:myDict];
//not sure how to do it here
}