1
votes

So how do you play a video straight after one video finishes playing on iphone. I put this

NSString *filepath = [[NSBundle mainBundle] pathForResource:@"movie" ofType:@"m4v"]; NSURL *fileURL = [NSURL fileURLWithPath:filepath]; MPMoviePlayerController *moviePlayerController = [[MPMoviePlayerController alloc] initWithContentURL:fileURL];

but dunno what else to put after that to play another video.

1

1 Answers

2
votes

if you are running local video i.e from your app then you probably will knowing the name of them. save all the video name in an array.

create a function that will be doing all your movie playing stuff and accepta a filepath/url or the name of your video file.

you can use MPMoviePlayerPlaybackDidFinishNotification to know whether the video finished playing.

once you know that call the same function that plays the video again and pass the filepath/name to it. It will again start playing your next video.

Hope that help