2013-03-27 10 views
0

내가 웹에서 동영상 재생 앱이아이폰 OS MPMoviePlayer (응용 프로그램은 활성화 후 재생을 다시 시작합니다)

모든 것이 잘 작동

하지만 사용자는 이메일 또는 아무것도

를 읽는 응용 프로그램을 떠날 때 다시 와서 선수는 없어졌다 !! 그래서 큰 문제

, 나는 사용자 이력서 후보고 여기

응용 프로그램

에 돌아와 싶어은

[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(didEnterBackground) name:UIApplicationDidEnterBackgroundNotification object:nil]; 
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(didEnterforground) name:UIApplicationWillEnterForegroundNotification object:nil]; 

이 방법은 알고 있습니다

- (void) didEnterBackground 
{ 
[theMovie.moviePlayer pause]; 
NSLog(@"Playing pause"); 
} 

- (void) didEnterforground 
{ 
[theMovie.moviePlayer play]; 
NSLog(@"Playing resume"); 
} 

내가 [자기를 사용하여 지금까지 내 코드입니다 presentMoviePlayerViewControllerAnimated : theMovie]; 보기에서 재생하지

해야하는 코드의 기본 원리지만, 아무것도

미리

답변

0

대답은 매우 간단합니다에

감사합니다 제발 도와주세요 작동하지 않습니다, 편집의 Info.plist.
배경 권한, 필요한 배경 모드 추가, 범주 설정 앱 재생 오디오

사용해보기!