summaryrefslogtreecommitdiffstats
path: root/radio/radio.php
blob: 4c8bf3f4c781ab221772582f166f6221c6227a3b (plain) (blame)
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
<?php
$sock = stream_socket_client("unix:///tmp/ls", $errno, $errstr);
if (!empty($_REQUEST["s"])) {
	fwrite($sock, "travnik.skip\r\n");
	header("location: ?p=1");
	exit("preusmeritev na ?p=1");
}
fwrite($sock, "uptime\r\n");
usleep(100000);
$uptime = trim(str_replace("END", "", fread($sock, 256)));
fwrite($sock, "travnik.remaining\r\n");
usleep(100000);
$remaining = trim(str_replace("END", "", fread($sock, 256)));
fwrite($sock, "travnik.metadata\r\n");
usleep(100000);
$metadata = str_replace("\r", "", trim(str_replace("END", "", fread($sock, 65536))));
fwrite($sock, "quit\r\n");
?>
radijski pretok neprestano teče že <?= htmlspecialchars($uptime) ?>
<br>
do konca komada je še <?= gmdate("H:i:s", intval($remaining)) ?>.
<br>
<form method=post>
<input type=submit name=s value="preskoči na naslednji komad" />
</form>
<?php
if (!empty($_REQUEST["p"])) {
?>
<b>poročilo: zahteva za preskok komada je bila uspešno poslana. počakaj nekaj sekund, da se zgodi crossfade. preveri, da si na koncu pretoka!</b>
<?php
}
?>
<br>
metapodatki o komadu in o prej predvajanih komadih:
<br>
<pre>
<?= htmlspecialchars(implode("\n", array_reverse(explode("\n", $metadata)))) ?>
</pre>