aboutsummaryrefslogtreecommitdiff
path: root/web
diff options
context:
space:
mode:
authortopfs2 <topfs2@svn>2010-04-06 17:04:59 +0000
committertopfs2 <topfs2@svn>2010-04-06 17:04:59 +0000
commit781cb699822c2953b547bc0a66374f9766f19170 (patch)
tree1684c88c0fc4ce78c8550b5df672f026fe6ee674 /web
parentc400293b0d0f1aff70d8cd2186f9fb303645b111 (diff)
Allow Active playlists jsonrpc call for play specify an item to play, also made the nowplaying.html use it to click on a song to play
git-svn-id: https://xbmc.svn.sourceforge.net/svnroot/xbmc/trunk@29075 568bbfeb-2a22-0410-94d2-cc84cf5bfa90
Diffstat (limited to 'web')
-rw-r--r--web/poc_jsonrpc/nowplaying.html9
1 files changed, 8 insertions, 1 deletions
diff --git a/web/poc_jsonrpc/nowplaying.html b/web/poc_jsonrpc/nowplaying.html
index 6e91f8dea6..22a18935a9 100644
--- a/web/poc_jsonrpc/nowplaying.html
+++ b/web/poc_jsonrpc/nowplaying.html
@@ -12,6 +12,13 @@ function CallMethod(method)
window.location.reload( false );
}
+function CallPlay(player, playlistItem)
+{
+ var http_request = new XMLHttpRequest();
+ http_request.open( "POST", "jsonrpc", false );
+ http_request.send("{\"jsonrpc\": \"2.0\", \"method\": \"" + player + "Playlist.Play\", \"params\": " + playlistItem + ", \"id\": 1}");
+}
+
function refresh()
{
window.location.reload( false );
@@ -69,7 +76,7 @@ if (players.length > 0) {
var item = array[i];
document.write("<tr class=\"" + (i % 2 == 0 ? "even" : "odd") + "\">");
- document.write("<td class=\"label\">" + item["label"] + "</td>");
+ document.write("<td class=\"label\"><a href=\"nowplaying.html\" onclick=CallPlay(\"" + player + "\"," + i + ")>" + item["label"] + "</a></td>");
if (i == activeItem)
document.write("<td class=\"playing\"><img src=\"images/play.png\" height=16></img></td>");
else