How to play the next video after the first video had finish for IOS5 application/ NOT LOADING WEB VIDEO

StackOverflow https://stackoverflow.com/questions/11573666

Pergunta

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.

Foi útil?

Solução

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

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top