diff options
author | montellese <montellese@xbmc.org> | 2012-06-05 01:08:32 +0200 |
---|---|---|
committer | montellese <montellese@xbmc.org> | 2012-06-05 01:08:32 +0200 |
commit | cf5ec59b015e7592075976b7f6a56c1ec90ac5d7 (patch) | |
tree | 567b435466a542a21794a2d2ee15e5ae90c9e26f /addons/webinterface.default | |
parent | 9cc668f69a39ab44083432fa5e12f62d866ca25f (diff) |
webinterface.default: fall back to Player.GetItem if Playlist.GetItems returns an empty list (fixes #13084)
Diffstat (limited to 'addons/webinterface.default')
-rwxr-xr-x | addons/webinterface.default/js/NowPlayingManager.js | 38 |
1 files changed, 35 insertions, 3 deletions
diff --git a/addons/webinterface.default/js/NowPlayingManager.js b/addons/webinterface.default/js/NowPlayingManager.js index 049c5a981b..d251168f76 100755 --- a/addons/webinterface.default/js/NowPlayingManager.js +++ b/addons/webinterface.default/js/NowPlayingManager.js @@ -543,9 +543,41 @@ NowPlayingManager.prototype = { $('#nowPlayingPanel').show(); } } else { - this.activePlaylist = null; - $('#videoDescription').hide(); - $('#nowPlayingPanel').hide(); + jQuery.ajax({ + type: 'POST', + contentType: 'application/json', + url: JSON_RPC + '?updateVideoPlayer', + data: '{"jsonrpc": "2.0", "method": "Player.GetItem", "params": { "playerid": ' + this.playlistid + ', "properties": ["title", "season", "episode", "plot", "runtime", "showtitle","thumbnail"] }, "id": 1}', + success: jQuery.proxy(function(data) { + if (data && data.result && data.result.item) { + this.activePlaylistItem = data.result.item; + if (!this.updateActiveItemDurationRunOnce) { + this.updateActiveItemDurationRunOnce = true; + this.updatePlayer(); + } + + $('#nextText').hide(); + $('#nowPlayingPlaylist').hide(); + $('#nextTrack').hide(); + + $('#videoDescription').show(); + $('#audioDescription').hide(); + $('#nowPlayingPanel').show(); + } + else { + this.activePlaylist = null; + $('#videoDescription').hide(); + $('#nowPlayingPanel').hide(); + } + }, this), + error: jQuery.proxy(function(data) { + displayCommunicationError(); + if (this.autoRefreshVideoPlaylist) { + setTimeout(jQuery.proxy(this.updateVideoPlaylist, this), 2000); /* Slow down request period */ + } + }, this), + dataType: 'json' + }); } if (this.autoRefreshVideoPlaylist) { setTimeout(jQuery.proxy(this.updateVideoPlaylist, this), 1000); |