2010-11-19 22:47:41 -05:00
|
|
|
<html>
|
|
|
|
<head>
|
2010-12-27 13:01:00 -05:00
|
|
|
<script type="text/javascript" src="utils.js"></script>
|
2010-12-27 19:00:27 -05:00
|
|
|
<script type="text/javascript" src="controls.js"></script>
|
2010-11-19 22:47:41 -05:00
|
|
|
<script type="text/javascript">
|
2010-12-27 19:00:27 -05:00
|
|
|
function set_playing()
|
2010-11-19 22:47:41 -05:00
|
|
|
{
|
2010-12-27 22:06:25 -05:00
|
|
|
var button = document.getElementById("button");
|
2011-12-22 14:16:33 -05:00
|
|
|
button.src = "pause.png";
|
2010-12-27 22:06:25 -05:00
|
|
|
button.onclick = pause2;
|
2010-11-19 22:47:41 -05:00
|
|
|
}
|
|
|
|
|
2010-12-27 19:00:27 -05:00
|
|
|
function set_paused()
|
2010-11-19 22:47:41 -05:00
|
|
|
{
|
2010-12-27 22:06:25 -05:00
|
|
|
var button = document.getElementById("button");
|
2011-12-22 14:16:33 -05:00
|
|
|
button.src = "play.png";
|
2010-12-27 22:06:25 -05:00
|
|
|
button.onclick = play2;
|
2010-12-27 19:00:27 -05:00
|
|
|
}
|
2010-11-19 22:47:41 -05:00
|
|
|
|
2010-12-27 19:00:27 -05:00
|
|
|
function set_play_button()
|
2010-11-19 22:47:41 -05:00
|
|
|
{
|
2010-12-27 19:00:27 -05:00
|
|
|
var req = new XMLHttpRequest();
|
|
|
|
req.onreadystatechange = function()
|
|
|
|
{
|
|
|
|
if (req.readyState == 4 && req.status == 200)
|
|
|
|
{
|
|
|
|
if (req.responseText == "True")
|
|
|
|
{
|
|
|
|
set_playing();
|
|
|
|
} else
|
|
|
|
{
|
|
|
|
set_paused();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2011-12-22 14:16:33 -05:00
|
|
|
req.open('GET', "RPC/playing", true);
|
2010-12-27 19:00:27 -05:00
|
|
|
req.send();
|
2010-11-19 22:47:41 -05:00
|
|
|
}
|
|
|
|
|
2010-12-27 19:00:27 -05:00
|
|
|
function set_play_button_repeating()
|
2010-11-19 22:47:41 -05:00
|
|
|
{
|
2010-12-27 19:00:27 -05:00
|
|
|
set_play_button();
|
|
|
|
setTimeout("set_play_button_repeating()", 3000)
|
2010-11-19 22:47:41 -05:00
|
|
|
}
|
|
|
|
|
2010-12-27 19:00:27 -05:00
|
|
|
function play2()
|
2010-11-19 22:47:41 -05:00
|
|
|
{
|
2010-12-27 19:00:27 -05:00
|
|
|
play();
|
|
|
|
set_play_button();
|
2010-11-19 22:47:41 -05:00
|
|
|
}
|
|
|
|
|
2010-12-27 19:00:27 -05:00
|
|
|
function pause2()
|
2010-11-19 22:47:41 -05:00
|
|
|
{
|
2010-12-27 19:00:27 -05:00
|
|
|
pause();
|
|
|
|
set_play_button();
|
2010-11-19 22:47:41 -05:00
|
|
|
}
|
|
|
|
|
2010-12-27 19:00:27 -05:00
|
|
|
function stop2()
|
2010-11-19 22:47:41 -05:00
|
|
|
{
|
2010-12-27 19:00:27 -05:00
|
|
|
stop();
|
|
|
|
set_play_button();
|
2010-11-19 22:47:41 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
</script>
|
|
|
|
</head>
|
|
|
|
|
|
|
|
<body>
|
2010-12-27 22:06:25 -05:00
|
|
|
|
|
|
|
<table>
|
|
|
|
<tr><td id="title"></td></tr>
|
|
|
|
<tr><td id="artist"></td></tr>
|
|
|
|
<tr><td id="album"></td></tr>
|
|
|
|
</table>
|
|
|
|
<table><tr>
|
2011-12-22 14:16:33 -05:00
|
|
|
<td><img id="button" src="play.png" onclick="play2();" /></td>
|
|
|
|
<td><img src="stop.png" onclick="stop();" /></td>
|
|
|
|
<td><img src="next.png" onclick="next();" /></td>
|
2010-12-27 22:07:24 -05:00
|
|
|
</tr><tr>
|
2011-12-22 14:16:33 -05:00
|
|
|
<td><img src="rewind.png" onclick="rewind();" /></td>
|
|
|
|
<td><img src="forward.png" onclick="forward();" /></td>
|
2010-12-27 22:06:25 -05:00
|
|
|
</tr></table>
|
2010-11-19 22:47:41 -05:00
|
|
|
|
|
|
|
</body>
|
|
|
|
|
2010-12-24 12:31:55 -05:00
|
|
|
<script type="text/javascript">
|
2010-12-27 13:01:00 -05:00
|
|
|
set_attr("title", "title");
|
|
|
|
set_attr("artist", "artist");
|
|
|
|
set_attr("album", "album");
|
2010-12-27 19:00:27 -05:00
|
|
|
set_play_button_repeating();
|
2010-12-24 12:31:55 -05:00
|
|
|
</script>
|
|
|
|
|
2010-11-19 22:47:41 -05:00
|
|
|
</html>
|