Thank you for your donation!


Cloudsmith graciously provides open-source package management and distribution for our project.


Receive is Webradio playing
#6
I am newbie to moodeaudio and mpd.
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
}
Only radio needs stop.
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.
Reply


Messages In This Thread
Receive is Webradio playing - by mezcal - 07-22-2018, 06:12 AM
RE: Receive is Webradio playing - by Tim Curtis - 07-22-2018, 05:46 PM
RE: Receive is Webradio playing - by Tim Curtis - 07-22-2018, 07:06 PM
RE: Receive is Webradio playing - by mezcal - 07-22-2018, 08:26 PM

Forum Jump: