diff --git a/src/components/remotecontrol/remotecontrol.js b/src/components/remotecontrol/remotecontrol.js
index 7b620d536a..1149440264 100644
--- a/src/components/remotecontrol/remotecontrol.js
+++ b/src/components/remotecontrol/remotecontrol.js
@@ -110,31 +110,54 @@ define(["browser", "datetime", "backdrop", "libraryBrowser", "listView", "imageL
return null;
}
- function updateNowPlayingInfo(context, state) {
+ function updateNowPlayingInfo(context, state, serverId) {
var item = state.NowPlayingItem;
var displayName = item ? getNowPlayingNameHtml(item).replace("
", " - ") : "";
- context.querySelector(".nowPlayingPageTitle").innerHTML = displayName;
+ console.debug(JSON.stringify(item, null, 4));
+ //alert(item.Artists);
+ if(item.Type == "Audio" || item.MediaStreams[0].Type == "Audio"){
+ var songName = item.Name;
+ if(item.Album != null && (item.Artists != null)) {
+ var albumName = item.Album;
+ if(item.ArtistItems != null) {
+ var artistName = item.ArtistItems[0].Name;
+ context.querySelector(".nowPlayingAlbum").innerHTML = '' + albumName + '';
+ context.querySelector(".nowPlayingArtist").innerHTML = '' + artistName + '';
+ context.querySelector(".contextMenuAlbum").innerHTML = 'album View album';
+ context.querySelector(".contextMenuArtist").innerHTML = 'person View artist';
+ } else {
+ context.querySelector(".nowPlayingAlbum").innerHTML = albumName;
+ var artistName = item.Artists;
+ context.querySelector(".nowPlayingArtist").innerHTML = artistName;
+ }
+
+ }
+ context.querySelector(".nowPlayingSongName").innerHTML = songName;
+ } else {
+ context.querySelector(".nowPlayingPageTitle").innerHTML = displayName;
+ }
- if (displayName.length > 0) {
+ if (displayName.length > 0 && item.Type != "Audio") {
context.querySelector(".nowPlayingPageTitle").classList.remove("hide");
} else {
context.querySelector(".nowPlayingPageTitle").classList.add("hide");
}
var url = item ? seriesImageUrl(item, {
- maxHeight: 300 * 2
+ maxHeight: 300
}) || imageUrl(item, {
- maxHeight: 300 * 2
+ maxHeight: 300
}) : null;
console.debug("updateNowPlayingInfo");
- setImageUrl(context, url);
+ setImageUrl(context, state, url);
if (item) {
backdrop.setBackdrops([item]);
var apiClient = connectionManager.getApiClient(item.ServerId);
apiClient.getItem(apiClient.getCurrentUserId(), item.Id).then(function (fullItem) {
var userData = fullItem.UserData || {};
var likes = null == userData.Likes ? "" : userData.Likes;
+ context.querySelector(".nowPlayingPageUserDataButtonsTitle").innerHTML = '';
context.querySelector(".nowPlayingPageUserDataButtons").innerHTML = '';
});
} else {
@@ -143,17 +166,24 @@ define(["browser", "datetime", "backdrop", "libraryBrowser", "listView", "imageL
}
}
- function setImageUrl(context, url) {
+ function setImageUrl(context, state, url) {
currentImgUrl = url;
+ var item = state.NowPlayingItem;
var imgContainer = context.querySelector(".nowPlayingPageImageContainer");
if (url) {
imgContainer.innerHTML = '';
- imgContainer.classList.remove("hide");
+ if(item.Type == "Audio"){
+ context.querySelector(".nowPlayingPageImage").classList.add("nowPlayingPageImageAudio");
+ context.querySelector(".nowPlayingPageImageContainer").classList.remove("nowPlayingPageImageAudio");
+ } else {
+ context.querySelector(".nowPlayingPageImageContainer").classList.add("nowPlayingPageImagePoster");
+ context.querySelector(".nowPlayingPageImage").classList.remove("nowPlayingPageImageAudio");
+ }
} else {
- imgContainer.classList.add("hide");
- imgContainer.innerHTML = "";
+ imgContainer.innerHTML = '