iphone - ExitFullScreen button causes problems with MPMoviePlayerViewController and presentMoviePlayerViewControllerAnimated -
here situation :
i call local movie url. function in custom viewcontroller
in .h :
mpmovieplayerviewcontroller* modalvideocontroller
in .m
-(void)startvideoad:(nsnotification*)notification { nsurl* url = (nsurl*)[notification object];
// no problem url ... check :)
modalvideocontroller = [[mpmovieplayerviewcontroller alloc] initwithcontenturl:url]; [modalvideocontroller shouldautorotatetointerfaceorientation:yes]; [self presentmovieplayerviewcontrolleranimated:modalvideocontroller]; [modalvideocontroller release]; }
problem : if user hit enter/exit fullscreen button (the double arrow button @ right of fastfoward button in video button panel), modalviewcontroller normaly disappear video still playing , no images sounds.
is there way kill video after button pressed ?
answer:
-(void)viewdidappear:(bool)animated { [super viewdidappear:animated]; // avoid exitfullscreen button problem on fullscreen mode if(modalvideocontroller != nil) { [modalvideocontroller.movieplayer stop]; } }
this way stop correctly movie. last details: modalvideocontroller became global.
Comments
Post a Comment