iphone sdk:如何在点击屏幕时结束电影?
我有 MPMoviePlayerController,我用它来播放电影。我有我的 movieControlMode MPMovieControlModeHidden。我想要这种行为:当电影播放时,如果收到屏幕上的点击,则停止它,释放电影播放器。这怎么能做到呢?
mMoviePlayer = [[MPMoviePlayerController alloc] initWithContentURL:mMovieURL];
[mMoviePlayer setOrientation:UIDeviceOrientationPortrait animated:NO];
mMoviePlayer.movieControlMode = MPMovieControlModeHidden;
[mMoviePlayer play];
如何添加目标/事件处理程序?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
一种解决方案是放置一个不可见的 UIButton,覆盖整个屏幕,它在 touchUpInside 上调用一个函数来停止、释放和删除 moviePlayer。
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.