2009-10-26 1 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 만 전달할 수 있습니다. 여러 개의 URL을 전달할 수 있습니까?iPhone에 다중 동영상로드 MPMoviePlayerController

그래서 Movie Player는 첫 번째 재생 후 두 번째 URL을로드합니다.

가능합니까?

어떻게 할 수 있습니까?

바로 지금, 다른 URL을 전달하려고하면 첫 번째 URL을 완료 한 후입니다.

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

장치가 먼저 가로 모드로 돌아와 다시 장치를로드 한 후 &를로드하는 동안이 방향으로의 변경합니다.

이 문제를 해결하는 방법?

미리 지식을 공유해 주셔서 감사합니다.

사가르

+0

이제 iPhone에서 여러 영화 또는 비디오 파일을 재생할 수 있습니다.이 튜토리얼을 보려면 http://cocoabugs.blogspot.com/2010/12/playing-movies-or-videos-in-queue-using.html을 방문하십시오. –

답변

1

당신은 비디오 재생을 시작하기 전에 상태 표시 방향을 변경하여 방향을 변경하고 모두와 함께 완료 후 다시 변경할 수 있습니다.

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

이제 iPhone에서 여러 영화 또는 비디오 파일을 재생할 수 있습니다.이 자습서는 http://cocoabugs.blogspot.com/2010/12/playing-movies-or-videos-in-queue-using.html에 있습니다. –

1

첫 번째 영화가 다른 영화로 변경하려고 할 때와 마찬가지로 setContentURL을 호출 할 수 있어야합니다. endPlaybackTime을 확인하고 메소드를 종료하여 동영상이 끝나기 1 초 전에 setContentURL을 호출하십시오.