开发者

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

开发者 https://www.devze.com 2023-01-14 13:20 出处:网络
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 i开

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 i开发者_运维知识库t, 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?


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消