iphone - i have videos list when i select row video will play on another view how to stop and come back for table view -
if (indexpath.row==0) { nsstring *urlasstring = [[nsbundle mainbundle] pathforresource: [self.array objectatindex:indexpath.row] oftype:@"mov"]; nsurl *url = [nsurl fileurlwithpath:urlasstring]; mpmovieplayercontroller *myplayer = [[mpmovieplayercontroller alloc] init]; myplayer.shouldautoplay = yes; myplayer.repeatmode = mpmovierepeatmodeone; myplayer.fullscreen = yes; myplayer.moviesourcetype = mpmoviesourcetypefile; myplayer.scalingmode = mpmoviescalingmodeaspectfit; myplayer.contenturl =[nsurl fileurlwithpath:urlasstring]; [self.view addsubview:myplayer.view]; [myplayer.view setframe:cgrectmake(0, 0, 320, 400)]; [myplayer setfullscreen:yes animated:yes]; [myplayer play]; }
i have 1 button in mpmovieplayercontroller
called done when click on done button need come tableview
plz me one
mpmovieplayercontroller *myplayer declare global , init . ,
[[nsnotificationcenter defaultcenter] addobserver:self selector:@selector(donebuttonclick:) name:mpmovieplayerwillexitfullscreennotification object:nil];
and selector method:
-(void)donebuttonclick:(nsnotification*)anotification{ [myplayer stop]; }
Comments
Post a Comment