gpt4 book ai didi

iPhone SDK : how to end movie on tap of the screen?

转载 作者:行者123 更新时间:2023-12-03 20:00:48 25 4
gpt4 key购买 nike

我有 MPMoviePlayerController,我用它来播放电影。我有我的 movieControlMode MPMovieControlModeHidden。我想要这种行为:当电影播放时,如果收到屏幕上的点击,则停止它,释放电影播放器​​。如何做到这一点?

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

如何添加目标/事件处理程序?

最佳答案

一种解决方案是放置一个不可见的 UIButton,覆盖整个屏幕,它在 touchUpInside 上调用一个函数来停止、释放和删除 moviePlayer。

关于iPhone SDK : how to end movie on tap of the screen?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3634039/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com