2011-07-03 4 views
0

私は私のiOSアプリケーションでHTTP VideoStreamingを実装しようとしています。私は自分のアプリケーションで2つのビューを持っています。最初はメインビューです。そのビューにはボタンがあり、ユーザーがそのボタンをクリックすると、VideoPlayerViewはサーバーからビデオをロードして再生します。ビデオはアプリケーション内で再生されています。ここで私はMPMoviePlayerの通知機能を宣言しなければなりません。助けてください

私のアプリケーションでは、私は2つのビューとAppDelegateを持っています。

AppDelegate 
MainViewController 
VideoPlayerView 

私は自分のVideoPlayerViewクラスで自分のMPMoviePlayerプレーヤーを作成しています。私は通知機能を実装したい

// 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]; 

私はAppDelegateまたはVideoPlayerViewでこの関数を宣言する必要があります。

と私は、この関数を呼び出す必要があります場合は、どのクラスに

// 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

関連する問題