ios - How moving on to another ViewController when finished playing video? -
how moving on viewcontroller when finished playing video? '2' '1' (look @ screenshot)
code in viewdidload
(videoviewcontroler
):
nsurl *url = [nsurl urlwithstring:@"_http://scontent-a.cdninstagram.com/hphotos-xfa1/t50.2886-16/10619021_616434485141882_380154097_n.mp4"]; videoplayer = [[mpmovieplayerviewcontroller alloc] initwithcontenturl:url]; [videoplayer.movieplayer preparetoplay]; [videoplayer.movieplayer play]; [self presentmovieplayerviewcontrolleranimated:videoplayer]; nsarray *viewcontrollers = [[self navigationcontroller] viewcontrollers]; [self.navigationcontroller poptoviewcontroller:viewcontrollers[1] animated:no];
you have register did finish notification, example in viewdidload:
// register finished notification [[nsnotificationcenter defaultcenter] addobserver:self selector:@selector(movetoview2:) name:mpmovieplayerplaybackdidfinishnotification object:self.movieplayerviewcontroller.movieplayer];
add notification method , call segue go view:
- (void) movetoview2:(nsnotification *) notification { [self performseguewithidentifier:@"identifier" sender:self]; }
just make sure replace identifier segue identifier between view , b.
Comments
Post a Comment