【问题标题】:How to show the play icon in the statusbar of my iPhone / iPad如何在我的 iPhone / iPad 的状态栏中显示播放图标
【发布时间】:2011-04-07 08:59:28
【问题描述】:

我制作了一个允许在后台播放音频文件 (http://site/file.mp3) 的应用。
这一切都很好。我只希望播放图标像this statusbar一样可见 请参阅右上角的“播放”图标。

我用谷歌搜索了我的大脑,似乎找不到任何解释如何实现这一点的东西。

有人吗?

【问题讨论】:

    标签: iphone objective-c ipad audio background


    【解决方案1】:

    你的 plist 中可能需要这个:

    <key>UIBackgroundModes</key>
    <array>
        <string>audio</string>
    </array>
    

    除此之外 - 它可能是将您的应用程序链接到 iPod 控件的一部分;在这里回答:iPhone ios4 - Replacing iPod dock icon whilst playing background audio stream

    【讨论】:

    • 我将关键 UIBackgroundModes 添加到我的 plist 中,否则当我关闭应用程序或“关闭”我的 iPad 时,我将无法继续播放音频。我会试试那个链接,谢谢。
    • 像魅力一样工作!追问:如何从这些(rogueamoeba.com/utm/wp-content/uploads/images/20100622tray.png)按钮接收事件?
    • 这是在我发布的链接中完成的 - 使用 remoteControlReceivedWithEvent
    • 啊,我发现了问题,我从 -(void)viewDidLoad 中而不是在 -(void)viewDidAppear:(BOOL)animated 中调用了 beginReceivingRemoteControlEvents 和 becomeFirstResponder 实例方法
    • 向 UIBackgroundModes 添加音频不会使播放图标出现在状态栏中
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-08-25
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多