diff options
author | topfs2 <topfs2@svn> | 2010-03-07 08:20:21 +0000 |
---|---|---|
committer | topfs2 <topfs2@svn> | 2010-03-07 08:20:21 +0000 |
commit | 942eae150b99a0a9c337136ba9df38524d9ab36d (patch) | |
tree | 008c19a5953931642a5d25b2dee325df4f5a0cc8 /web | |
parent | 1227a6129562fad5eef083da9b1d886c0d1b5d03 (diff) |
Added a nowplaying to the POC webinterface
git-svn-id: https://xbmc.svn.sourceforge.net/svnroot/xbmc/trunk@28439 568bbfeb-2a22-0410-94d2-cc84cf5bfa90
Diffstat (limited to 'web')
-rw-r--r-- | web/poc_jsonrpc/albums.html | 2 | ||||
-rw-r--r-- | web/poc_jsonrpc/basic.css | 18 | ||||
-rw-r--r-- | web/poc_jsonrpc/images/OSDNextTrackFO.png | bin | 0 -> 5094 bytes | |||
-rw-r--r-- | web/poc_jsonrpc/images/OSDPlayFO.png | bin | 0 -> 4924 bytes | |||
-rw-r--r-- | web/poc_jsonrpc/images/OSDPrevTrackFO.png | bin | 0 -> 5148 bytes | |||
-rw-r--r-- | web/poc_jsonrpc/images/OSDStopFO.png | bin | 0 -> 4773 bytes | |||
-rw-r--r-- | web/poc_jsonrpc/index.html | 1 | ||||
-rw-r--r-- | web/poc_jsonrpc/movies.html | 2 | ||||
-rw-r--r-- | web/poc_jsonrpc/nowplaying.html | 78 | ||||
-rw-r--r-- | web/poc_jsonrpc/tvshows.html | 2 |
10 files changed, 100 insertions, 3 deletions
diff --git a/web/poc_jsonrpc/albums.html b/web/poc_jsonrpc/albums.html index 18807995b8..f215cd11c9 100644 --- a/web/poc_jsonrpc/albums.html +++ b/web/poc_jsonrpc/albums.html @@ -6,7 +6,7 @@ </script> </head> <body> -<h1><a href="movies.html">Movies</a> <a href="tvshows.html">TV Shows</a> Albums</h1> +<h1><a href="nowplaying.html">Now playing</a> <a href="movies.html">Movies</a> <a href="tvshows.html">TV Shows</a> Albums</h1> <script type="text/javascript"> var http_request = new XMLHttpRequest(); diff --git a/web/poc_jsonrpc/basic.css b/web/poc_jsonrpc/basic.css index 7f70ff166b..b67249af13 100644 --- a/web/poc_jsonrpc/basic.css +++ b/web/poc_jsonrpc/basic.css @@ -43,3 +43,21 @@ table.Info td.Title { text-align:right; color:white; } + +table.Playlist th { + text-align:left; + background-color:rgb(50,50,50); +} + +table.Playlist td.playing { + text-align:center; + background:black; +} + +table.Playlist tr.Odd { + background:rgb(0,0,0); +} + +table.Playlist tr.Even { + background:rgb(30,30,30); +} diff --git a/web/poc_jsonrpc/images/OSDNextTrackFO.png b/web/poc_jsonrpc/images/OSDNextTrackFO.png Binary files differnew file mode 100644 index 0000000000..6632183a56 --- /dev/null +++ b/web/poc_jsonrpc/images/OSDNextTrackFO.png diff --git a/web/poc_jsonrpc/images/OSDPlayFO.png b/web/poc_jsonrpc/images/OSDPlayFO.png Binary files differnew file mode 100644 index 0000000000..2709f6a52c --- /dev/null +++ b/web/poc_jsonrpc/images/OSDPlayFO.png diff --git a/web/poc_jsonrpc/images/OSDPrevTrackFO.png b/web/poc_jsonrpc/images/OSDPrevTrackFO.png Binary files differnew file mode 100644 index 0000000000..58765c20ca --- /dev/null +++ b/web/poc_jsonrpc/images/OSDPrevTrackFO.png diff --git a/web/poc_jsonrpc/images/OSDStopFO.png b/web/poc_jsonrpc/images/OSDStopFO.png Binary files differnew file mode 100644 index 0000000000..aacfa6b74f --- /dev/null +++ b/web/poc_jsonrpc/images/OSDStopFO.png diff --git a/web/poc_jsonrpc/index.html b/web/poc_jsonrpc/index.html index 02438bef22..ef27ab8a58 100644 --- a/web/poc_jsonrpc/index.html +++ b/web/poc_jsonrpc/index.html @@ -5,6 +5,7 @@ </head> <body> <h1>XBMC Webinterface</h1> +<a href="nowplaying.html"><h2>Now playing</h2></a> <a href="movies.html"><h2>Movies</h2></a> <a href="tvshows.html"><h2>TVShows</h2></a> <a href="albums.html"><h2>Albums</h2></a> diff --git a/web/poc_jsonrpc/movies.html b/web/poc_jsonrpc/movies.html index 1fb29fc196..f9b5a11483 100644 --- a/web/poc_jsonrpc/movies.html +++ b/web/poc_jsonrpc/movies.html @@ -12,7 +12,7 @@ function PlayMovie(movieid) </script> </head> <body> -<h1>Movies <a href="tvshows.html">TV Shows</a> <a href="albums.html">Albums</a></h1> +<h1><a href="nowplaying.html">Now playing</a> Movies <a href="tvshows.html">TV Shows</a> <a href="albums.html">Albums</a></h1> <script type="text/javascript"> var http_request = new XMLHttpRequest(); diff --git a/web/poc_jsonrpc/nowplaying.html b/web/poc_jsonrpc/nowplaying.html new file mode 100644 index 0000000000..bb1722ae8d --- /dev/null +++ b/web/poc_jsonrpc/nowplaying.html @@ -0,0 +1,78 @@ +<html> +<head> +<title>XBMC - Now playing</title> +<link type="text/css" rel="stylesheet" href="basic.css"> +<script type="text/javascript" src="json.js"> // FOR browsers which doesn't have it included +</script> +<script type="text/javascript"> +function CallMethod(method) +{ + var http_request = new XMLHttpRequest(); + http_request.open( "POST", "jsonrpc", false ); + http_request.send("{\"jsonrpc\": \"2.0\", \"method\": \"" + method + "\", \"params\": { \"fields\": [\"title\", \"plot\"] }, \"id\": 1}"); + window.location.reload( false ); +} + +function refresh() +{ + window.location.reload( false ); +} +</script> + +</head> +<body> +<h1>Now playing <a href="movies.html">Movies</a> <a href="tvshows.html">TV Shows</a> <a href="albums.html">Albums</a></h1> + +<script type="text/javascript"> +setTimeout( "refresh()", 5*1000 ); +var http_request = new XMLHttpRequest(); +http_request.open( "POST", "jsonrpc", false ); +http_request.send("{\"jsonrpc\": \"2.0\", \"method\": \"Playlist.GetItems\", \"params\": { \"fields\": [\"title\", \"plot\"] }, \"id\": 1}"); + +var the_object = JSON.parse(http_request.responseText); +var result = the_object["result"]; +var activeItem = result["current"]; +var array = result["items"]; + +if (activeItem >= 0) { + if (array[activeItem]["thumbnail"]) + document.write("<img src=\"thumb/" + array[activeItem]["thumbnail"] + ".jpg\"></img>"); + else + document.write("<img src=\"images/DefaultAlbumCover.png\"></img>"); + + document.write("<br></br>"); + + document.write("<img src=\"images/OSDPrevTrackFO.png\" onclick=CallMethod(\"Player.SkipPrevious\")></img>"); + document.write("<img src=\"images/OSDStopFO.png\" onclick=CallMethod(\"Player.Stop\")></img>"); + document.write("<img src=\"images/OSDPlayFO.png\" onclick=CallMethod(\"Player.PlayPause\")></img>"); + document.write("<img src=\"images/OSDNextTrackFO.png\" onclick=CallMethod(\"Player.SkipNext\")></img>"); + + document.write("<br></br>"); + + document.write("<table class=\"Playlist\"><tbody>"); + var odd = false; + var i = 0; + for (var property in array) { + var item = array[property]; + var row = "even"; + if (odd) + row = "odd"; + + document.write("<tr class=\"" + row + "\">"); + document.write("<td class=\"label\">" + item["label"] + "</td>"); + if (i == activeItem) + document.write("<td class=\"playing\"><img src=\"images/play.png\" height=16></img></td>"); + else + document.write("<td class=\"playing\"></td>"); + document.write("</tr>"); + + odd = !odd; + i++; + } + document.write("</tbody></table>"); +} else { + document.write("Nothings playing"); +} +</script> +</body> +</html> diff --git a/web/poc_jsonrpc/tvshows.html b/web/poc_jsonrpc/tvshows.html index 9d6a4a1150..2ddf2e507e 100644 --- a/web/poc_jsonrpc/tvshows.html +++ b/web/poc_jsonrpc/tvshows.html @@ -28,7 +28,7 @@ function PrintSeasons(tvshowid) } function PrintTVShows() { - document.write("<html><head><title>XBMC - TV Shows</title><link type=\"text/css\" rel=\"stylesheet\" href=\"basic.css\"></head><body><h1><a href=\"movies.html\">Movies</a> TV Shows <a href=\"albums.html\">Albums</a></h1>"); + document.write("<html><head><title>XBMC - TV Shows</title><link type=\"text/css\" rel=\"stylesheet\" href=\"basic.css\"></head><body><h1><a href=\"nowplaying.html\">Now playing</a> <a href=\"movies.html\">Movies</a> TV Shows <a href=\"albums.html\">Albums</a></h1>"); var http_request = new XMLHttpRequest(); http_request.open( "POST", "jsonrpc", false ); |