xcode - iPhone SDK: Stopping a Video -


how can stop video once navigate away view , make video play again when original view again?

here code play video in original view:

- (void)viewdidload {     nsbundle *bundle=[nsbundle mainbundle];     nsstring *moviepath = [bundle pathforresource:@"video" oftype:@"mp4"];     nsurl *movieurl=[[nsurl fileurlwithpath:moviepath] retain];     mpmovieplayercontroller *themovie = [[mpmovieplayercontroller alloc] initwithcontenturl:movieurl];     themovie.scalingmode = mpmoviescalingmodeaspectfill;     themovie.view.frame = cgrectmake(104.0, 134.0, 200.0, 250.0);     [self.view addsubview:themovie.view];     [themovie play];      [super viewdidload];     self.view.backgroundcolor = [uicolor viewflipsidebackgroundcolor];       } 

  1. make themovie instance var
  2. stop playing in -(void) viewwilldisappear:(bool)animated

and should start playing when navigate view. or move code -(void) viewdidappear:(bool)animated


Comments

Popular posts from this blog

linux - Mailx and Gmail nss config dir -

c# - Is it possible to remove an existing registration from Autofac container builder? -

php - Mysql PK and FK char(36) vs int(10) -