07-22-2018, 08:26 PM
I am newbie to moodeaudio and mpd.
I have been going through source code.
play/pause button is defined in js/scripts-panels.js:
Only radio needs stop.
I have found in inc/playerlib.php division of formats:
Artist 'Radio station' is adding in command/worker.php
The condition above should be used for webradio. I will try write it in bash.
I think js test for http is case insensitive and php tests are case sensitive.
I have been going through source code.
play/pause button is defined in js/scripts-panels.js:
Code:
if (MPD.json['file'].substr(0, 4).toLowerCase() == 'http') {
var cmd = MPD.json['artist'] == 'Radio station' ? 'stop' : 'pause'; // pause if for upnp url
}
else {
var cmd = 'pause'; // song file
}
I have found in inc/playerlib.php division of formats:
Code:
// radio station
if (isset($song['Name']) || (substr($song['file'], 0, 4) == 'http' && !isset($song['Artist']))) {
}
// UPnP file
elseif (substr($song['file'], 0, 4) == 'http' && isset($song['Artist'])) {
}
// DSD file
elseif (getFileExt($song['file']) == 'dsf' || getFileExt($song['file']) == 'dff') {
}
// file
else {
Artist 'Radio station' is adding in command/worker.php
Code:
if (isset($song['Name']) || (substr($song['file'], 0, 4) == 'http' && !isset($song['Artist']))) {
$artist = 'Radio station';
The condition above should be used for webradio. I will try write it in bash.
I think js test for http is case insensitive and php tests are case sensitive.