JSON blocking/timeout with Player.Open

  Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
mattm Offline
Junior Member
Posts: 2
Joined: Feb 2017
Reputation: 0
Post: #1
When starting a playlist of images using Player.Open thru a JSON request, I get no reply until the player is stopped.
Is this correct behaviour ?

This is rather annoying as it causes plugin code to completely hang.
First observed using the python api, I confirmed with curl as well.
I'm running Kodi 17.0 under Ubuntu Linux.

The request which hangs is:
{"jsonrpc":"2.0","method":"Player.Open","params":{"item":{"playlistid":2}},"id":1}

Thank you for your help.
find quote
ncarthy Offline
Member
Posts: 52
Joined: Aug 2010
Reputation: 0
Location: London
Post: #2
There are quite a few RPC calls that you can make to Kodi that cause the api to stall. Just use a fire-and-forget method to send this command. You don't really care for the response anyway as it is likely to just be "OK".

Another example of an apparent hang is if you open a ISO file that has multiple tracks. The UI pops up a window asking you which track you want to open and the api will not respond to the command until this choice is made.

Another example is if you activate the Favourites window. {"id":1,"jsonrpc":"2.0","method":"GUI.ActivateWindow","params":{"window":"favourites"}}

Just send any ActivateWindow or Player.Open commands async
find quote
mattm Offline
Junior Member
Posts: 2
Joined: Feb 2017
Reputation: 0
Post: #3
Thanks for the explanation.
Cant seem to find an asynchronous option directly using the pythonAPI executeJSONRPC function but I'll work around it some other way.
find quote