Backend changes

This commit is contained in:
santic-zombie
2020-04-01 00:41:14 +03:00
parent 2c8ac3901c
commit 129eb040f1
9 changed files with 94 additions and 114 deletions

View File

@@ -11,7 +11,8 @@
integrity="sha256-WpOohJOqMqqyKL9FccASB9O0KwACQJpFTUBLTYOVvVU="
crossorigin="anonymous">
</script>
<script src="js/lastfm.api.md5.js" type="text/javascript"></script>
<script src="js/lastfm.api.js" type="text/javascript"></script>
</head>
<body>
@@ -23,7 +24,7 @@
<div id="myPlay">-</div>
<div id="title">title</div>
<a name="lastFMlink" href="" target="_blank"><div id="title">title</div></a>
<br>
@@ -48,77 +49,11 @@
<span id="duration"></span>
<br>
<br>
<div id="listeners">title</div>
</div>
</div>
<script language="JavaScript">
var audio = new Audio('http://stream.santic-zombie.ru');
var play = document.getElementById('play');
play.addEventListener('click', function() {
$("#myPlay").text("Now playing:");
audio.play();
}, false);
var pause = document.getElementById('pause');
pause.addEventListener('click', function() {
$("#myPlay").text("Paused");
audio.pause();
}, false);
audio.addEventListener("timeupdate", function() {
var duration = document.getElementById('duration');
var s = parseInt(audio.currentTime % 60);
var m = parseInt((audio.currentTime / 60) % 60);
var h = parseInt((audio.currentTime / 3600) % 60);
if (s < 10) s = '0' + s;
if (m < 10) m = '0' + m;
if (h < 10) h = '0' + h;
duration.innerHTML = h + ':' + m + ':' + s;
}, false);
$("#volume").mousemove(function(){
audio.volume = parseFloat(this.value / 10);
});
</script>
<script language="JavaScript">
function show()
{
$.ajax({
url: '/trackname.php',
cache: false,
success: function(html){
$('#title').html(html);
}
});
}
$(document).ready(function(){
show();
setInterval('show()',5000);
});
</script>
<script language="JavaScript">
function show1()
{
$.ajax({
url: '/online.php',
cache: false,
success: function(html){
$('#listeners').html(html);
}
});
}
$(document).ready(function(){
show1();
setInterval('show1()',5000);
});
</script>
<script src="js/audio.js" type="text/javascript"></script>
<script src="js/radio.js" type="text/javascript"></script>
</body>