2013-01-23 37 views

回答

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]; 
} 
+0

什麼是PSRootViewController? – ani

+0

和什麼是電影播放器​​? – ani

+0

謝謝你......它工作正常 – ani

相關問題