-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
126 lines (120 loc) · 3.99 KB
/
index.html
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>LinkPlayBot</title>
<script type="text/javascript">
if (localStorage.getItem('device_ip')) {
var dev_ip = localStorage.getItem('device_ip');
} else {
var dev_ip = '192.168.1.1';
}
var radio_api = 'http://'+dev_ip+'/httpapi.asp?command=';
function send(command)
{
var xhr = new XMLHttpRequest();
url = radio_api + command;
xhr.open("GET", url, true);
xhr.send(null);
return false;
}
function play(stream) {
command = 'setPlayerCmd:play:' +stream;
send(command);
}
function volume(value) {
command = 'setPlayerCmd:vol:'+value;
send(command);
}
function save_ip(device_ip) {
localStorage.setItem('device_ip', device_ip);
var dev_ip = device_ip;
location.reload();
}
</script>
<style>
body {
background: #000000;
color: #ffffff;
}
button {
border: 1px solid #ffffff;
background: #000000;
color: #ffffff;
padding: 6px 15px;
}
button:hover {
background: #ffffff;
color: #000000;
cursor: pointer;
}
#playlist, #url {
background: #ffffff;
color: #000000;
padding: 6px;
}
#slider {
min-width: 200px;
}
</style>
</head>
<body>
<h1>LinkPlayBot</h1>
<label for="device_ip">Device IP:</label><br>
<input type="text" name="device_ip" id="device_ip" placeholder="192.168.1.1" value="">
<button onclick="save_ip(document.getElementById('device_ip').value);">Save</button>
<br><br>
<label for="radio">Station:</label>
<select name="radio" id="radio" onchange="play(this.value)">
<option value="https://cast.brg.ua:443/powerfm96.aacp">POWER FM</option>
<option value="http://online.kissfm.ua/KissFM_HD">KISS FM</option>
<option value="https://cast.radiogroup.com.ua:443/nrj320">RADIO NRJ</option>
<option value="http://listen6.myradio24.com:9000/5390">KEXXX FM</option>
<option value="https://cast.radiogroup.com.ua:443/jamfm320">JAM FM</option>
<option value="https://cast.radiogroup.com.ua:443/loungefm320">LOUNGE FM</option>
<option value="https://cast.radiogroup.com.ua:443/chillout320">Chill Out</option>
<option value="http://online.radiorelax.ua/RadioRelax">RELAX</option>
<option value="https://listen5.myradio24.com:443/atmo">ATMOSFERA</option>
<option value="http://radio.ukraudio.com:8000/channel2">NISAJA</option>
</select>
<br><br>
<button onclick="send('setPlayerCmd:play');" width="40%">Play</button>
<button onclick="send('setPlayerCmd:pause');" width="40%">Pause</button>
<br><br>
<label for="slider">Volume</label>
<input type= "range" class="slider" id="slider" value="0" maxlength="100" width="100%">
<br><br>
<label for="playlist">M3U Playlist URL:</label><br>
<input type="url" name="playlist" id="playlist" placeholder="http://example.com/playlist.m3u">
<button onclick="send('setPlayerCmd:playlist:' + document.getElementById('playlist').value + ':m3u');">Load</button>
<br><br>
<button onclick="send('setPlayerCmd:prev');">< Prev</button>
<button onclick="send('setPlayerCmd:next');">Next ></button>
<br><br>
<label for="url">Stream URL:</label><br>
<input type="url" name="url" id="url" placeholder="http://example.com/stream">
<button onclick="play(document.getElementById('url').value);">Play</button>
<br><br>
Preset
<button onclick="send('MCUKeyShortClick:1');">1</button>
<button onclick="send('MCUKeyShortClick:2');">2</button>
<button onclick="send('MCUKeyShortClick:3');">3</button>
<button onclick="send('MCUKeyShortClick:4');">4</button>
<button onclick="send('MCUKeyShortClick:5');">5</button>
<button onclick="send('MCUKeyShortClick:6');">6</button>
<br><br><br>
<button onclick="send('setPlayerCmd:switchmode:wifi');">WiFi</button>
<button onclick="send('setPlayerCmd:switchmode:bluetooth');">BT</button>
<button onclick="send('setPlayerCmd:switchmode:line-in');">AUX</button>
<br><br><br>
opencartbot © 2021
<script type="text/javascript">
document.getElementById('device_ip').value = dev_ip;
slider.onchange = () => {
volume(slider.value);
}
</script>
</body>
</html>