PHP Wrapper for XBMC JSON-RPC and HTTP-API
#31
Hello,
Sorry for my bad language.
I'm reed readmi
$xbmcJson->NAMESPACE->COMMAND(array(PARAM1 => VALUE1, PARAM2 => VALUE2, etc..));
I'm write
PHP Code:
if (!empty($catch)) {
            
//msg("error", "Kodi Connect Error", $catch, '');
            
echo 'Kodi Connect Error';
        } else {
            try {
                
$limits = array("start" => 0"end" => 5);
                
$sort = array("order" => "descending""method" => "dateadded");
                
$propertis = array("properties" => "artist""duration""album""track");


                
$TopSongs $xbmcJson->AudioLibrary->GetSongs(
                        array(
                            
"limits" => $limits,
                            
"sort" => $sort,
                            
"properties" => "artist"
                        
)
                );
            } catch (
Exception $ex) {
                echo 
$ex->getMessage();
            }

            echo 
"<pre>";
            
print_r($TopSongs->songs);
            echo 
"</pre>";
// Notice: Invalid params.(-32602)
        

But I'm write
PHP Code:
$TopSongs $xbmcJson->AudioLibrary->GetSongs(
                        array(
                            
"limits" => $limits,
                            
"sort" => $sort,
                        )
                ); 
No error. What write
PHP Code:
$propertis = array("properties" => "artist""duration""album""track"); 
Huh
Reply
#32
Hi all,

Could anyone point me into the right direction to use the correct syntax to get the following data

Code:
{
    "jsonrpc": "2.0",
    "method": "Player.GetItem",
    "params": {
        "properties": [
            "title",
            "album",
            "artist",
            "season",
            "episode",
            "duration",
            "showtitle",
            "tvshowid",
            "thumbnail",
            "file",
            "fanart",
            "streamdetails"
        ],
        "playerid": 0
    },
    "id": "VideoGetItem"
}

I am fairly new to this and I don't now how to use the command according to the instruction set below by Kai

JSON-RPC API (http://wiki.xbmc.org/index.php?title=JSON_RPC)
Commands are sent using the following syntax:

Code:
$xbmcJson->NAMESPACE->COMMAND(array(PARAM1 => VALUE1, PARAM2 => VALUE2, etc..));

I know the bit where I need to use the namespace Player and the command GetItem, however I do not know how to incorporate the parameters correctly.
Reply

Logout Mark Read Team Forum Stats Members Help
PHP Wrapper for XBMC JSON-RPC and HTTP-API2