iOS的 - 在多任务栏更新媒体播放/暂停状态 [英] iOS - updating the media play/pause state in the multitasking bar

查看:284
本文介绍了iOS的 - 在多任务栏更新媒体播放/暂停状态的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有一个使用AU图的工作程序 - CoreAudio的API - 播放音频。该图将一直工作,以及各种素材的播放/暂停状态,在图形渲染回调函数进行管理。
我们成功应对UIEventTypeRemoteControl事件,我们与元数据使用MPNowPlayingInfoCenter当前正在播放的内容成功更新锁屏。

We have a working app that uses an AU graph - CoreAudio API - to play audio. The graph is always running, and the play/pause state of the various source material is managed in the graph rendering callback functions. We successfully respond to UIEventTypeRemoteControl events, and we successfully update the lock-screen with the meta-data for the currently playing content using MPNowPlayingInfoCenter.

在一个遗漏的部分是在多任务的iOS栏更新播放/暂停按钮的状态。它总是在暂停(||)模式,即使应用的音频已经被暂停。它从来没有切换到它的戏(>)的状态。

The one missing piece is to update the state of the play/pause button in the iOS multitasking bar. It is always in the "pause" (||) mode, even when the app audio is already paused. It never switches to its "play" (>) state.

哪些API用于更新播放/暂停按钮的状态?

Which API is used to update the play/pause button state?

推荐答案

我想通了,使用CoreAudio的AU图时,<一个href=\"http://developer.apple.com/library/ios/documentation/AudioToolbox/Reference/AUGraphServicesReference/Reference/reference.html#//apple_ref/doc/uid/TP40007289-CH7-SW36\"相对=nofollow> AUGraphStart()将显示在iOS的状态栏和iOS的多任务栏上的播放指示器,而<一href=\"http://developer.apple.com/library/ios/documentation/AudioToolbox/Reference/AUGraphServicesReference/Reference/reference.html#//apple_ref/doc/uid/TP40007289-CH7-SW37\"相对=nofollow> AUGraphStop()将清除它们。

I figured out that when using a CoreAudio AU graph, AUGraphStart() will display the playback indicator in the iOS status bar and the iOS multitasking bar, and AUGraphStop() will clear them.

这篇关于iOS的 - 在多任务栏更新媒体播放/暂停状态的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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