2011-07-03 2 views
0

내 iOS 응용 프로그램에서 HTTP VideoStreaming을 구현하려고합니다. 내 신청서에는 두 가지 견해가 있습니다. 첫 번째는 기본보기입니다. 그보기에는 버튼이 있습니다. 사용자가 버튼을 클릭하면 VideoPlayerView가 서버에서 비디오를로드하고 재생합니다. 비디오가 내 응용 프로그램에서 재생되고 있습니다. 모든 것이 완벽하게 작동합니다.어디서 MPMoviePlayer의 알림 기능을 선언해야합니다. 제발 도와주세요

내 응용 프로그램에는 두 개의 뷰와 AppDelegate가 있습니다.

AppDelegate 
MainViewController 
VideoPlayerView 

내 VideoPlayerView 클래스에서 내 MPMoviePlayer 플레이어를 만들고 있습니다. 나는 알림 기능 내가 AppDelegate에 또는 VideoPlayerView에서이 함수를 선언해야

// Register to receive a notification that the movie is now in memory and ready to play 

[[NSNotificationCenter defaultCenter] addObserver:self 

        selector:@selector(moviePreloadDidFinish:) 

        name:MPMoviePlayerContentPreloadDidFinishNotification 

        object:nil]; 

을 구현하고자합니다.

그리고 난이 함수를 호출 할 경우,

// Notification called when the movie finished preloading. 

- (void) moviePreloadDidFinish:(NSNotification*)notification 

{ 



} 

이 제발 도와주세요 어떤 클래스의 의미 .....................

답변

0

알림 레지스터 기능은 MPMoviePlayer가 할당 된 (아마도 VideoPlayerView에서) 초기화되고 초기화 된 상태 여야합니다. Apple의 설명서에 MPMoviePlayer가 할당되기 전에 알림 기능이 있습니다.

moviePreloadDidFinish 및 다른 이벤트 핸들러도 VideoPlayerView 컨트롤러에 있어야합니다.

이것은 도움이 될 수 있지만 조금 오래된 것일 수 있습니다. http://developer.apple.com/library/ios/#samplecode/MoviePlayer_iPhone/Listings/Classes_MyViewController_m.html#//apple_ref/doc/uid/DTS40007798-Classes_MyViewController_m-DontLinkElementID_14

관련 문제