iphone sdk:如何在点击屏幕时结束电影?

发布于 2024-09-17 01:16:49 字数 415 浏览 2 评论 0原文

我有 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

中性美 2024-09-24 01:16:50

一种解决方案是放置一个不可见的 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文