2014-03-01, 21:39
I seem to be getting a Player.OnPlay notification before anything is actually playing occasionally after issuing a Player.Open request. I am using XBMC 12.3 on Windows. I saw a somewhat similar issue here, so I added some error handling code, but that doesn't help. I suspect the notification is sent prematurely, but the debug logs show the player is running at the time my requests come in.
Receive OnPlay, so far so good:
In response to this notification, my application issues a Player.GetItem:
Here is where things go south. Sometimes this works, but other times I get an error:
Ok, so I go into error handling mode and try to get the active player:
And this indicates there are no active players.
Is there something I am missing? Thanks!
Receive OnPlay, so far so good:
Code:
{"jsonrpc":"2.0","method":"Player.OnPlay","params":{"data":{"item":{"id":45,"type":"movie"},"player":{"playerid":1,"speed":1}},"sender":"xbmc"}}
In response to this notification, my application issues a Player.GetItem:
Code:
{ "id" : "Ctrl.GetItem", "jsonrpc" : "2.0", "method" : "Player.GetItem", "params" : { "playerid" : 1, "properties" : [ "title", "duration", "fanart", "thumbnail", "plot" ] } }
Here is where things go south. Sometimes this works, but other times I get an error:
Code:
{"error":{"code":-32100,"message":"Failed to execute method."},"id":"Ctrl.GetItem","jsonrpc":"2.0"}
Ok, so I go into error handling mode and try to get the active player:
Code:
{ "id" : "Ctrl.Init", "jsonrpc" : "2.0", "method" : "Player.GetActivePlayers", "params" : { } }
And this indicates there are no active players.
Code:
{"id":"Ctrl.Init","jsonrpc":"2.0","result":[]}
Is there something I am missing? Thanks!