【发布时间】:2017-01-09 06:09:53
【问题描述】:
我有一个使用 android sdk 来自 spotify 的歌曲 uri 的数组列表。但是只有一首歌曲正在播放我想检测一首歌曲何时完成,以便我可以启动另一首歌曲下面是我正在使用的代码。
Config playerConfig = new Config(this,sharedPreferences.getString(KEY,""),CLIENT_ID);
Spotify.getPlayer(playerConfig, this, new SpotifyPlayer.InitializationObserver() {
@Override
public void onInitialized(SpotifyPlayer spotifyPlayer) {
mPlayer = spotifyPlayer;
// Toast.makeText(MainActivity.this,mPlayer.getMetadata().toString(),Toast.LENGTH_LONG).show();
// System.out.println(response.getAccessToken());
mPlayer.addNotificationCallback(PlaySong.this);
mPlayer.play(track.get(curr).getUriFull(), 0, 0);
mPlayer.queue(track.get(1).getUriFull());
// mPlayer.addPlayerNotificationCallback(MainActivity.this);
}
@Override
public void onError(Throwable throwable) {
}
});
任何帮助将不胜感激。
【问题讨论】: