A question regarding the API…
I tried to determine whether the player is currently stopped or running. The example from the setup file http://moode/command/?cmd=get_currentsong returns only „[]“, and all commands that I send to the mpd return nothing.
Looking at the source (/var/www/command/indexp.php), the explanation is pretty simple. Data is only returned when an error occurs, otherwise nothing. The following crude fix returns at least the answers:
With that e.g., the cmd=status returns a string that contains the state of the player.
But I naively assume that there is another, better way to do this.
Cheers, Joe
I tried to determine whether the player is currently stopped or running. The example from the setup file http://moode/command/?cmd=get_currentsong returns only „[]“, and all commands that I send to the mpd return nothing.
Looking at the source (/var/www/command/indexp.php), the explanation is pretty simple. Data is only returned when an error occurs, otherwise nothing. The following crude fix returns at least the answers:
Code:
41 if (stripos($resp, 'Error:')) {
42 echo $resp;
43 } else {
44 echo $resp;
45 }
With that e.g., the cmd=status returns a string that contains the state of the player.
But I naively assume that there is another, better way to do this.
Cheers, Joe