Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iphone sdk: how to end movie on tap of the screen?

I have MPMoviePlayerController, with which I play a movie. I have my movieControlMode MPMovieControlModeHidden. I want this behaviour: while the movie plays, if tap on the screen is received, stop it, release the movie player. How can this be done?

mMoviePlayer = [[MPMoviePlayerController alloc] initWithContentURL:mMovieURL];
[mMoviePlayer setOrientation:UIDeviceOrientationPortrait animated:NO];
mMoviePlayer.movieControlMode = MPMovieControlModeHidden;
[mMoviePlayer play];

How can I add target/event handler?

like image 842
Danail Avatar asked Feb 03 '26 14:02

Danail


1 Answers

One solution could be to place an invisible UIButton, covering the entire screen, which, on touchUpInside, calls a function to stop, release and remove the moviePlayer.

like image 67
Gubb Avatar answered Feb 05 '26 04:02

Gubb



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!