私はあなたにとって奇妙な問題があります。MPMoviePlayerControllerで特定のデバイスのヘッドフォンでのみ音が鳴る
MPMoviePlayerControllerはビデオをうまく再生しており、音声はヘッドフォンでのみ再生されます。
のiPadsとiPhoneで実際に同じことが起こるのは、同じ正確なモデル 同等のシステムを実行していることです。
私はここに簡単な失敗例を作成しました:ここ
を、私はそれが正常に動作し、iPhone 4Sに失敗見てきました
http://www.porcaro.org/MPMoviePlayerController/TestMovie.zip
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];
}