1
我有一个可以工作的电影文件。我在导航控制器内部添加了一个tableview控制器,位于标签视图控制器内部,当用户单击表格视图单元格时,我加载视频视图。它启动电影(并在模拟器中旋转),但视频不播放,控件用于纵向视图。我确实听到了声音,并看到时间在控制中。所以这显然不是风景。iphone 3.1 - MPMediaPlayer显示了肖像,而不是风景,这很奇怪
我尝试了一些技巧setOrientation,但他们有警告,并没有正常工作。
感谢您提供任何帮助。
#import "StreamViewController.h"
@implementation StreamViewController
@synthesize moviePlayer;
@synthesize streamURL;
// Override to allow orientations other than the default portrait orientation.
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
// Return YES for supported orientations
return YES;
}
- (void)viewDidAppear:(BOOL)animated {
NSBundle *bundle = [NSBundle mainBundle];
if (bundle)
{
NSString *moviePath = [bundle pathForResource:@"splash" ofType:@"m4v"];
self.streamURL = [NSURL fileURLWithPath:moviePath];
}
moviePlayer = [[MPMoviePlayerController alloc] initWithContentURL:[self streamURL]];
moviePlayer.scalingMode = MPMovieScalingModeAspectFill;
[moviePlayer play];
[super viewDidAppear:animated];
}
- (void)dealloc {
[super dealloc];
}
@end