나는 모두 이상한 문제가 있습니다.MPMoviePlayerController가있는 특정 장치에서 헤드폰을 통해서만 소리가납니다.
MPMoviePlayerController은 비디오를 잘 재생하고 있으며 오디오는 헤드폰을 통해서만 재생됩니다.
진짜 끌림은 일부 iPad와 iPhone에서 발생합니다. 동일한 실제 시스템도 동일한 실제 시스템 !
여기 간단한 실패 예를 만들었습니다 : 나는 아이 패드 다음은 2
을 잘 실행하고 아이폰 4S, 아이폰 4와 실패 본 적이
http://www.porcaro.org/MPMoviePlayerController/TestMovie.zip
가장입니다 관련 코드.
이(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];
}