문제

I have 3 different video: video1,video2,video3

I want when video1 play end then continue play video2 then continue play video3 then finish

Here's my current code:

moviePlayerViewController = [[MPMoviePlayerViewController alloc] init];
moviePlayerViewController.moviePlayer.contentURL = [NSURL URLWithString:video1];
[self.navigationController presentMoviePlayerViewControllerAnimated:moviePlayerViewController];

I think maybe i should use

[[NSNotificationCenter defaultCenter] addObserver:self
                                         selector:@selector(playbackFinishedCallback:)
                                             name:MPMoviePlayerLoadStateDidChangeNotification
                                           object:moviePlayerViewController.moviePlayer];

But when video1 play finish, navigationController dissmiss

How should I fix it, thanks.

도움이 되었습니까?

해결책

You can use AVQueuePlayer for queuing the videos.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top