Iphone sdk: how to end a movie when you tap the screen?

I have an MPMoviePlayerController with which I play a movie. I have a movieControlMode MPMovieControlModeHidden. I need this behavior: while a movie is playing, if a signal appears on the screen, stop it, release the movie player. How can I do that?

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

How to add a goal / event handler?

10 times in advance! Danail

+3
source share
1 answer

One solution might be to host an invisible UIButton that spans the entire screen, which on touchUpInside calls a function to stop, release, and delete moviePlayer.

+2
source

Source: https://habr.com/ru/post/1763036/


All Articles