-3

誰でも私に説明してもらえますか....それはiPhoneで可能です。はいの場合、私はiPhone開発に不慣れなので、順を追って説明していただけますか。

4

1 に答える 1

1

最も近いのは、再生したいビデオの最初のフレームを含む png 画像をスプラッシュとして使用し、ビデオをできるだけ早く再生することです。

開始するための基本的なコードは次のようになります。

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
  [[NSNotificationCenter defaultCenter] addObserver:self
                                           selector:@selector(playBackDidFinishNotification:)
                                               name:MPMoviePlayerPlaybackDidFinishNotification
                                             object:nil];

  self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];

  NSURL *URL = [[NSBundle mainBundle] URLForResource:@"clip" withExtension:@"m4v"];
  MPMoviePlayerViewController *viewController = [[MPMoviePlayerViewController alloc] initWithContentURL:URL];

  viewController.moviePlayer.fullscreen = YES;
  viewController.moviePlayer.controlStyle = MPMovieControlStyleNone;
  [viewController.moviePlayer play];

  self.window.rootViewController = viewController;

  [self.window makeKeyAndVisible];
  return YES;
}

- (void)playBackDidFinishNotification:(NSNotification *)notification;
{
  self.window.rootViewController = [[PSRootViewController alloc] init];
}
于 2013-01-23T12:18:38.977 に答える