保持MPMoviePlayerViewController在后台播放 [英] Keep MPMoviePlayerViewController playing when in background

查看:240
本文介绍了保持MPMoviePlayerViewController在后台播放的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用MPMoviePlayerViewController在iPhone4(iOS5.1),新iPad(iOS5.1),iPad(iOS4.2)的iOS应用中播放视频.

I use MPMoviePlayerViewController to playback videos in my iOS app on iPhone4 (iOS5.1), new iPad (iOS5.1), iPad (iOS4.2).

播放视频时,我按了两次主屏幕按钮,显示了多任务底座,播放器暂停了.

I press home button twice when playing a video, the multitask dock shows and player pauses.

我试图在appDelegate applicationWillResignActive中调用播放器的play方法,但是没有用.

I have tried to call player's play method in appDelegate applicationWillResignActive,but it didn't work.

有人知道如何避免玩家停顿吗?

Does anyone know how to do to avoid player pause ?

另一个问题,如何在遥控面板上显示视频的标题? (将多任务扩展坞滑动到最左侧).

Another question, how to show video's title on remote control panel? (swipe multitask dock to leftmost).

谢谢.

推荐答案

我认为您不应该继续播放视频.根据《 Apple App编程指南》,您应该在发生这种情况时暂停应用程序中的视觉活动.我不能100%确定App Store提交的内容是否会接受该行为.

I don't think you shouldn't continue playing the video. According to Apple App Programming Guide, you are supposed to pause visual activity in the application when that happens. I am not 100% sure if the App Store submission will accept that behavior.

您可以通过向MPNowPlayingInfoCenter提供元数据来显示视频标题:

You can show the video title by providing metadata to the MPNowPlayingInfoCenter:

在此处查看

如此处所写:

系统在设备锁定屏幕和多任务UI的多媒体控件中显示正在播放的信息.

The system displays now-playing information on the device lock screen and in the multimedia controls in the multitasking UI.

这篇关于保持MPMoviePlayerViewController在后台播放的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆