2009-10-26 60 views
0
-(void)initAndPlayMovie:(NSURL *)movieURL 
{ 
    // Initialize a movie player object with the specified URL 
    MPMoviePlayerController *mp = [[MPMoviePlayerController alloc] initWithContentURL:movieURL]; 
    if (mp) 
    { 
     self.moviePlayer = mp; 
     [mp release]; 
     [self.moviePlayer play]; 
    } 
} 

这里,在上面的代码中,我们只能传递一个电影URL。 是不是可以将多个网址传递给它。在iPhone中加载多个电影MPMoviePlayerController

因此,电影播放器​​会在播放第一个网址后加载第二个网址。

可能吗?

我们该怎么做?

现在,当我尝试通过其他网址,完成第一个。

- (void) moviePlayBackDidFinish:(NSNotification*)notification 
{ 
    [self initAndPlayMovie:secondURL]; 
} 

设备首先改变它的方向,同时又加载装置回来风景模式后加载&。

如何解决此问题?

在此先感谢您向我分享您的知识。

萨加尔

+0

现在,您可以在iPhone中一起播放多个电影或视频文件,请查看此链接以获取最佳教程http://cocoabugs.blogspot.com/2010/12/playing-movies-or-videos-in-queue-using.html – 2010-12-16 09:17:56

回答

1

您可能希望通过更改状态栏方向开始播放录像之前改变取向,改回你用全部完成后。

[[UIApplication sharedApplication] setStatusBarOrientation: UIInterfaceOrientationLandscapeRight animated:YES]; 
+0

现在你可以在iPhone中一起播放多个电影或视频文件,请查看此链接以获得很好的教程http://cocoabugs.blogspot.com/2010/12/playing-movies-or-videos-in-queue-using.html – 2010-12-16 09:18:11

1

您应该能够在第一部电影即将关闭以更改为另一部电影时调用setContentURL。检查endPlaybackTime并在影片结束前一秒激活您的方法来调用setContentURL。

相关问题