Same problem here.
I made a php webapp to start a playlist from any phone/tablet in my house.
The Apache server runs in a different computer than Kodi, although they are in the same subnet.
I used to use this http request:
Code:
http://kodi:username@ipaddress/jsonrpc?request={"jsonrpc":"2.0","method":"Player.Open","params":{"item":{"file":"plalylist,m3u"}},"id":1}
With Leia I get this error:
Code:
{"error":{"code":-32099,"message":"Bad client permission."},"id":1,"jsonrpc":"2.0"}
I understand that is caused by the fact that for security reasons, Kodi no longer accepts certain http requests.
All the proposed solutions don't work.
- I can't use curl because i'm not working on the Kodi device, but on my tablet/phone.
- I can't use the POST method, because you need to use ajax in order to send json data with the POST method, and you can't do it from another domain.
In fact I tried this script:
Code:
xhttp.open("POST", "http://kodi:[email protected]/jsonrpc", true);
xhttp.setRequestHeader("Content-type", "application/json");
xhttp.send("{\"jsonrpc\":\"2.0\",\"method\":\"Player.PlayPause\",\"params\":{\"playerid\":1},\"id\":1}");
and I get this error:
Code:
Access to XMLHttpRequest at 'http://kodi:username@KodiIpAddress/jsonrpc' from origin 'http://TabletIpAddress' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.
I wonder how am I supposed to start my playlists from a webapp with Leia.