OSX でゲームを開始する前に紹介ビデオを再生したいと考えています。AVPlayer をセットアップしてビデオを再生する最も簡単な方法は何ですか? ゲームが先に進む前に、ビデオを完全に再生したいと思います。
Mac 開発者ライブラリで AVPlayer のドキュメントを確認しましたが、OSX アプリで次の問題が発生しました: AVPlayer でビデオが表示されない
助けてください!
OSX でゲームを開始する前に紹介ビデオを再生したいと考えています。AVPlayer をセットアップしてビデオを再生する最も簡単な方法は何ですか? ゲームが先に進む前に、ビデオを完全に再生したいと思います。
Mac 開発者ライブラリで AVPlayer のドキュメントを確認しましたが、OSX アプリで次の問題が発生しました: AVPlayer でビデオが表示されない
助けてください!
したがって、スプラッシュ スクリーンの後、最初のビュー コントローラーは次のようになります。
-(void) playMovieAtURL: (NSURL*) theURL {
MPMoviePlayerController* theMovie =
[[MPMoviePlayerController alloc] initWithContentURL: theURL];
theMovie.scalingMode = MPMovieScalingModeAspectFill;
theMovie.movieControlMode = MPMovieControlModeHidden;
// Register for the playback finished notification
[[NSNotificationCenter defaultCenter]
addObserver: self
selector: @selector(myMovieFinishedCallback:)
name: MPMoviePlayerPlaybackDidFinishNotification
object: theMovie];
// Movie playback is asynchronous, so this method returns immediately.
[theMovie play];
}
// When the movie is done, release the controller.
-(void) myMovieFinishedCallback: (NSNotification*) aNotification
{
MPMoviePlayerController* theMovie = [aNotification object];
[[NSNotificationCenter defaultCenter]
removeObserver: self
name: MPMoviePlayerPlaybackDidFinishNotification
object: theMovie];
// Release the movie instance created in playMovieAtURL:
[theMovie release];
}
myMovieFinishedCallback で、ゲームのメニューを表示できます。
お役に立てば幸いです:)