【问题标题】:Android RemoteController and PandoraAndroid RemoteController 和 Pandora
【发布时间】:2014-07-21 20:20:28
【问题描述】:

我一直在使用 android RemoteController 类,虽然它与 Google Play Music 完美配合,但我在其他播放器(例如 pandora)上遇到了一些问题。

Pandora 目前是我关注的焦点。我已经能够向它发送暂停和跳过命令,但是在我发送暂停命令后,潘多拉将不再响应以下播放命令或跳过歌曲命令。目前我一直在研究 git hub 上的 Dr. Breens 示例。

https://github.com/DrBreen/RemoteControllerExample/blob/master/src/com/woodblockwithoutco/remotecontrollerexample/RemoteControlService.java

所以我想知道是否还有其他方法可以解决这个问题,以便潘多拉重新开始播放,而他的示例中没有涉及到?

【问题讨论】:

    标签: java android audio media pandora


    【解决方案1】:

    我发现在这里做假设是件好事。 Pandora 在暂停后停止发送播放状态更新。我通过改变点击监听器来解决这个问题:

    private OnClickListener mClickListener = new OnClickListener() {
    
        @Override
        public void onClick(View v) {
            switch(v.getId()) {
            case R.id.prev_button:
                if(mBound) {
                    mRCService.sendPreviousKey();
                }
                break;
            case R.id.next_button:
                if(mBound) {
                    mRCService.sendNextKey();
                }
                break;
            case R.id.play_pause_button:
                if(mBound) {
                    if(mIsPlaying) {
                        mRCService.sendPauseKey();
                        mIsPlaying = false;
                    } else {
                        mRCService.sendPlayKey();
                        mIsPlaying = true;
                    }
                }
                break;
            }
        }
    };
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2012-05-06
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多