Question

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.

Was it helpful?

Solution

You can use AVQueuePlayer for queuing the videos.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top