<bdo id='vprXd'></bdo><ul id='vprXd'></ul>

      <tfoot id='vprXd'></tfoot>

      <small id='vprXd'></small><noframes id='vprXd'>

      <i id='vprXd'><tr id='vprXd'><dt id='vprXd'><q id='vprXd'><span id='vprXd'><b id='vprXd'><form id='vprXd'><ins id='vprXd'></ins><ul id='vprXd'></ul><sub id='vprXd'></sub></form><legend id='vprXd'></legend><bdo id='vprXd'><pre id='vprXd'><center id='vprXd'></center></pre></bdo></b><th id='vprXd'></th></span></q></dt></tr></i><div id='vprXd'><tfoot id='vprXd'></tfoot><dl id='vprXd'><fieldset id='vprXd'></fieldset></dl></div>
        <legend id='vprXd'><style id='vprXd'><dir id='vprXd'><q id='vprXd'></q></dir></style></legend>
      1. iOS 4 中如何在后台启用 iPod 控件来控制非 iPod 音乐?

        How to enable iPod controls in the background to control non-iPod music in iOS 4?(iOS 4 中如何在后台启用 iPod 控件来控制非 iPod 音乐?)
        <tfoot id='KjTv2'></tfoot><legend id='KjTv2'><style id='KjTv2'><dir id='KjTv2'><q id='KjTv2'></q></dir></style></legend>
        <i id='KjTv2'><tr id='KjTv2'><dt id='KjTv2'><q id='KjTv2'><span id='KjTv2'><b id='KjTv2'><form id='KjTv2'><ins id='KjTv2'></ins><ul id='KjTv2'></ul><sub id='KjTv2'></sub></form><legend id='KjTv2'></legend><bdo id='KjTv2'><pre id='KjTv2'><center id='KjTv2'></center></pre></bdo></b><th id='KjTv2'></th></span></q></dt></tr></i><div id='KjTv2'><tfoot id='KjTv2'></tfoot><dl id='KjTv2'><fieldset id='KjTv2'></fieldset></dl></div>
              <tbody id='KjTv2'></tbody>

                <bdo id='KjTv2'></bdo><ul id='KjTv2'></ul>

                <small id='KjTv2'></small><noframes id='KjTv2'>

                  本文介绍了iOS 4 中如何在后台启用 iPod 控件来控制非 iPod 音乐?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我正在尝试完成的一个很好的例子是在最新版本的 Spotify iPhone 应用程序中实现(Pandora 似乎具有相同的功能).

                  A good example of what I'm trying to accomplish is implemented in the latest version of the Spotify iPhone application for (Pandora seems to have the same feature) .

                  当 Spotify 在后台时,双击打开多任务坞站",其中 ipod 控件(播放/暂停、前进等)允许控制 Spotify 的音乐播放(而不是 ipod 应用程序).此外,当 iphone/ipod touch 锁定时,双击会显示类似的播放控件.

                  When Spotify is in the background, double tapping opens the "multi-task dock", where the ipod controls (play/pause, forward etc) allow to control the music playback of Spotify (not the ipod application). Also, when the iphone/ipod touch is locked, double tapping displays similar playback controls.

                  如果你不明白我的意思,这里有一篇有截图的文章:http://www.wired.com/gadgetlab/2010/07/spotify-updated-for-ios4-ready-to-replace-ipod/

                  If you don't know what I mean, here's an article that has screenshots : http://www.wired.com/gadgetlab/2010/07/spotify-updated-for-ios4-ready-to-replace-ipod/

                  在我当前的应用程序中,音乐从服务器流式传输(使用 Matt Gallagher 的 AudioStreamer).我设法让音乐在后台播放.现在,我想将我的播放链接到多任务停靠"/锁定屏幕.

                  In my current application, music is streamed from a server (using Matt Gallagher's AudioStreamer). I've managed to keep the music playing in the background. Now, I'd like to link my playback to the "multi-task dock"/lock screen.

                  我应该使用 [MPMusicPlayerController iPodMusicPlayer] 吗?我应该怎么做?

                  Should I be using [MPMusicPlayerController iPodMusicPlayer] ? How should I proceed ?

                  额外问题:如果您能告诉我如何将 ipod 图标更改为我在多任务坞站"中的应用程序图标(Spotify 也采用了这个技巧......),那就太棒了.

                  Bonus question : if you can tell me how to change the ipod icon to my application icon in the "multi-task dock" (Spotify pulled that trick as well...), that whould be AWESOME.

                  任何帮助表示赞赏,谢谢.

                  Any help appreciated, thanks.

                  推荐答案

                  问题解决了.

                  简而言之,要启用远程控制事件,1)使用:

                  In short, to enable remote control event, 1) use :

                  - (void)remoteControlReceivedWithEvent:(UIEvent *)theEvent

                  和 2) 把它作为你的视图控制器:

                  and 2) put this is your view controller :

                  - (void)viewDidAppear:(BOOL)animated {
                      [super viewDidAppear:animated];
                      [[UIApplication sharedApplication] beginReceivingRemoteControlEvents];
                      [self becomeFirstResponder];
                  }
                  - (BOOL)canBecomeFirstResponder {
                      return YES;
                  }
                  

                  我必须感谢格兰特.他分叉了 Matt Gallagher 的 AudioStreamer,支持所有 ios4 改进(背景音频和远程控制工作).您可以在 github 上找到他的源代码和工作示例:http://github.com/DigitalDJ/AudioStreamer

                  I have to give credit to Grant. He has forked Matt Gallagher's AudioStreamer enabling all the ios4 improvements (background audio, and remote controls working). You can find his sources along with a working sample on github : http://github.com/DigitalDJ/AudioStreamer

                  关于图标:一旦您使用beginReceivingRemoteControlEvents,图标会自动切换到您的应用程序图标.太棒了!

                  Regarding the icon : once you use beginReceivingRemoteControlEvents, the icon automatically switches to your app icon. Brilliant !

                  这篇关于iOS 4 中如何在后台启用 iPod 控件来控制非 iPod 音乐?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  In Objective-c, safe and good way to compare 2 BOOL values?(在 Objective-c 中,比较 2 个 BOOL 值的安全和好方法?)
                  iOS: Use a boolean in NSUserDefaults(iOS:在 NSUserDefaults 中使用布尔值)
                  Typical UDP latency on iPhone over 3G - are my numbers right?(iPhone 在 3G 上的典型 UDP 延迟 - 我的数字对吗?)
                  Scan networks (SSID#39;s) on iOS 7 by using private API(使用私有 API 在 iOS 7 上扫描网络 (SSID))
                  Determine whether iPhone is really connected to the internet or just behind a restricted hotspot(确定 iPhone 是真正连接到互联网还是仅在受限热点后面)
                  Am I using CNCopyCurrentNetworkInfo correctly?(我正确使用 CNCopyCurrentNetworkInfo 吗?)

                    • <bdo id='YT1Op'></bdo><ul id='YT1Op'></ul>

                        <legend id='YT1Op'><style id='YT1Op'><dir id='YT1Op'><q id='YT1Op'></q></dir></style></legend>
                          <tbody id='YT1Op'></tbody>
                        <tfoot id='YT1Op'></tfoot>
                        <i id='YT1Op'><tr id='YT1Op'><dt id='YT1Op'><q id='YT1Op'><span id='YT1Op'><b id='YT1Op'><form id='YT1Op'><ins id='YT1Op'></ins><ul id='YT1Op'></ul><sub id='YT1Op'></sub></form><legend id='YT1Op'></legend><bdo id='YT1Op'><pre id='YT1Op'><center id='YT1Op'></center></pre></bdo></b><th id='YT1Op'></th></span></q></dt></tr></i><div id='YT1Op'><tfoot id='YT1Op'></tfoot><dl id='YT1Op'><fieldset id='YT1Op'></fieldset></dl></div>

                          <small id='YT1Op'></small><noframes id='YT1Op'>