blob: f1c0621483af3b91aa868bf6339a294477019e14 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
|
<html>
<head>
<title>XBMC - Movies</title>
<link type="text/css" rel="stylesheet" href="basic.css">
<script type="text/javascript" src="json.js"></script>
<script type="text/javascript">
function CallPlay(movieid) {
var http_request = new XMLHttpRequest();
http_request.open( "POST", "jsonrpc", false );
http_request.send('{ "jsonrpc": "2.0", "method": "XBMC.Play", "params": { "movieid": ' + movieid + ' }, "id": 1 }');
}
</script>
</head>
<body>
<table class="Navigation">
<tr class="primary">
<td class="unselected"><a href="nowplaying.html">Now playing</a></td>
<td class="selected">Videos</td>
<td class="unselected"><a href="artists.html">Music</a></td>
<td class="unselected"><a href="development.html">Development</a></td>
</tr>
<tr>
<td></td><td>
<table>
<tr class="secondary">
<td><a href="videofiles.html">Video files</a></td>
<td>Movies</td>
<td><a href="tvshows.html">TV Shows</a></td>
</tr>
</table></td>
</tr>
</table>
<br>
<script type="text/javascript">
var http_request = new XMLHttpRequest();
http_request.open( "POST", "jsonrpc", false );
http_request.send('{"jsonrpc": "2.0", "method": "VideoLibrary.GetMovies", "params": { "fields": ["title", "plot"] }, "id": 1}');
var the_object = JSON.parse(http_request.responseText);
var result = the_object["result"];
var array = result["movies"];
document.write('<table class="Movies"><thead><tr><th>Thumbnail</th><th>Info</th></tr></thead><tbody>');
for (var property in array) {
var item = array[property];
document.write('<tr class="' + (property % 2 == 0 ? "even" : "odd") + '"><td class="cover">');
document.write('<a href="nowplaying.html" onclick=CallPlay(' + item["movieid"] + ')>');
var imgSrc = item["thumbnail"] ? ('vfs/' + escape(item["thumbnail"])) : "images/DefaultVideo.png";
document.write('<img src="' + imgSrc + '" class="cover"></img>');
document.write('</td><td class="info">');
document.write('</a>');
document.write('<h1>' + item["title"] + '</h1>');
if (item["plot"])
document.write(item["plot"]);
document.write('</td></tr>');
}
document.write('</tbody></table>');
</script>
</body>
</html>
|