保持MPMoviePlayerViewController在后台播放

编程入门 行业动态 更新时间:2024-10-23 06:19:42
本文介绍了保持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在后台播放

本文发布于:2023-11-27 03:18:29,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1636348.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:后台   MPMoviePlayerViewController

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!