ios - How moving on to another ViewController when finished playing video? -


how moving on viewcontroller when finished playing video? '2' '1' (look @ screenshot) http://i.stack.imgur.com/fvflh.png

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

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -