我想知道如何在我的spotify-app上添加專輯封面?顯示專輯封面
有了這段代碼,我可以揭示專輯的標題,但我該如何顯示專輯封面!?
function updatePageWithAlbumName() {
var header = document.getElementById("album");
// This will be null if nothing is playing.
var playerTrackInfo = sp.trackPlayer.getNowPlayingTrack();
if (playerTrackInfo == null) {
header.innerText = "Geen album!";
} else {
var track = playerTrackInfo.track;
header.innerText = track.album.name;
}
}
但是我怎樣才能找到封面的URI /如何放置它?我檢查了這個鏈接:http://developer.spotify.com/download/spotify-apps-api/preview/reference/4c26b7e8e0.html 他們在頁面上也有一個例子,但是我怎樣才能看到專輯封面我正在玩的歌? – 0846277 2012-02-28 23:14:48
我需要用什麼來代替'sp'?在開發者鏈接中,他們也使用'sp'。 – 0846277 2012-02-28 23:16:03
他們使用sp.require來獲取模型對象,就是這樣。其他一切應該使用模型和視圖對象。我更新了我的答案。 – iKenndac 2012-02-29 11:53:21