我对你们所有人都有一个奇怪的问题。声音只能通过使用MPMoviePlayerController的某些设备上的耳机播放
MPMoviePlayerController正在播放视频,音频只能通过耳机播放。
真正的阻力是,这只是发生在一些 iPad和iPhone,甚至是完全相同的模型 运行完全相同的系统!
我创建了一个简单的例子失败这里:
http://www.porcaro.org/MPMoviePlayerController/TestMovie.zip
我见过它运行正常,并不能在iPhone 4S,iPhone 4和iPad 2
这里最相关的代码。感谢您的任何见解,我将提交错误,以苹果,以及:
(void)viewDidAppear:(BOOL)animated
{
[super viewDidAppear:animated];
moviePath = [NSString stringWithFormat:@"%@/intro.m4v", [[NSBundle mainBundle] bundlePath]];
NSURL *movieURL = [NSURL fileURLWithPath:moviePath];
theMoviePlayer = [[MPMoviePlayerController alloc] initWithContentURL:movieURL];
controlStyle = MPMovieControlStyleEmbedded;
movieView = [self view];
movieRect = [[self view] frame];
controlStyle = MPMovieControlStyleFullscreen;
theMoviePlayer.controlStyle = controlStyle;
theMoviePlayer.view.userInteractionEnabled = YES;
if (1) {
NSLog(@"Created theMoviePlayer: %@. Playing: %@", theMoviePlayer, moviePath);
}
[[NSNotificationCenter defaultCenter] removeObserver:self name:MPMoviePlayerPlaybackStateDidChangeNotification object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(checkForEndOfMovie:)
name:MPMoviePlayerPlaybackStateDidChangeNotification
object:theMoviePlayer];
// this line doesn't fix the problem
//[theMoviePlayer prepareToPlay];
[[theMoviePlayer view] setFrame:movieRect];
[movieView addSubview: [theMoviePlayer view]];
[theMoviePlayer play];
}