MPMovieControl 播放时 NSTimer 不起作用
在我的 iPhone 应用程序中。我需要每 5 分钟检查一次是否有多会话条目。 它在应用程序期间工作得很好,除非用户开始播放视频/直播流。
视频是预付费内容,因此它是应用程序最重要的控制,但计时器在该过程中不起作用。
我认为这是因为视频在不同的进程上运行,但我找不到解决方案。
请帮忙...
谢谢
In my iphone app. i need to check if there is a multisession entry, in every 5 min.
It works great during application except when user starts to play the video/live stream.
Video is pre-payed content so it's the most important control of the application but timer doesnt work on that process.
I think that's because of video is running on a different process but i couldnt find the solution.
help please...
thx
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
目前尚不清楚“多会话条目”的含义。
您使用的是
MPMoviePlayerController
吗?计时器通常应在该控制器运行时触发。如果您进入后台,那么您的代码通常不会运行。有很多方法可以解决这个问题。首先阅读在后台执行代码。您可能想要一个“长时间运行的后台任务”。这只能持续大约 10 分钟,但这可能就足够了,具体取决于您的视频长度。
但首先要确保您使用的是
MPMoviePlayerController
。It's not clear what "multisession entry" means.
Are you using
MPMoviePlayerController
? Timers should generally fire while this controller is running.If you go into the background, then your code generally won't run. There are many ways to address this. Start by reading Executing Code in the Background. You probably want a "long-running background task." That's only good for about 10 minutes, but that may be sufficient depending on how long your videos are.
But start by making sure you're using
MPMoviePlayerController
.