无法从Spotify播放曲目

时间:2016-10-21 15:08:29

标签: android spotify

我想将 Spotify 集成到我的应用程序中,但每次启动它时都会出错。我尝试了他们的初学者指南,但同样的问题再次发生。

protected void onActivityResult(int requestCode, int resultCode, Intent intent) {
    super.onActivityResult(requestCode, resultCode, intent);

    // Check if result comes from the correct activity
    if (requestCode == REQUEST_CODE) {
        AuthenticationResponse response = AuthenticationClient.getResponse(resultCode, intent);
        if (response.getType() == AuthenticationResponse.Type.TOKEN) {
            Config playerConfig = new Config(this, response.getAccessToken(), CLIENT_ID);
            Spotify.getPlayer(playerConfig, this, new SpotifyPlayer.InitializationObserver() {
                @Override
                public void onInitialized(SpotifyPlayer spotifyPlayer) {
                    mPlayer = spotifyPlayer;
                    mPlayer.addConnectionStateCallback(MainActivity.this);
                    mPlayer.addNotificationCallback(MainActivity.this);
                }

                @Override
                public void onError(Throwable throwable) {
                    Log.e("MainActivity", "Could not initialize player: " + throwable.getMessage());
                }
            });
        }
    }
}

当我使用断点时,它能够在内部类中停止,但在使用参数9执行onLoginFailed(int i)方法之后,这是什么意思?我需要做些什么来解决这个问题?

1 个答案:

答案 0 :(得分:0)

Spotify目前正受到DDOS攻击。而是DYN承载其DNS /流量的公司。阅读它here。另外,来自公司自己的快速推文here