JSON beginners help...
#1
Hi guys!

I'm currently working on a little home automation project and I want to integrate XBMC in it. I currently listen to JSON events and take actions accordingly, but I also want to control XBMC in some situations and I can't seem to get it right. I try for instance to pause the player using the following command, but it doesn't work.

{"jsonrpc":"2.0","method":"Player.PlayPause","params":{"playerid":1},"id":1}

What am I doing wrong? It doesn't work and I get no response at all. Is it some permission issue?
Reply
#2
I am not sure how you send the command. On my side I use curl to send a POST via HTTP. Here is a sample command (which runs from command line)
Code:
curl -s -u xbmc:xbmc -X POST -d '{"jsonrpc": "2.0", "method": "Player.GetItem", "params": {"playerid":1 }, "id": 1}' http://localhost:8080/jsonrpc
Reply
#3
I send it using telnet for testing purposes and I tried sending another command for getting some information and it works. I'm just not sure if my syntax is incorrect for Player.PlayPause or if there are some permissions that have to be set somehow to be able to control the player. Do I have to login somehow perhaps?
Reply
#4
There are a number of possible reasons. If this is Frodo make sure you are sending
Code:
Content-Type: application/json
header. Look at the xbmc.log to see if there is an error. A pastebin etc. of the log might be in order if you're getting nowhere.
Image
AWXi - Ajax web interface. Wiki
Reply
#5
He's using a TCP socket so the Content-Type doesn't matter because it's not HTTP. I can't see anything obviously wrong with your request. So a debug log of XBMC when you run your request would be necessary to see if XBMC actually receives the request or not. Maybe you are using the wrong "playerid" but in that case you should still receive an error as a response. No response is only done in case of client-side notifications but as you provide "id": 1 in your request that's not the case either.
Always read the online manual (wiki), FAQ (wiki) and search the forum before posting.
Do not e-mail Team Kodi members directly asking for support. Read/follow the forum rules (wiki).
Please read the pages on troubleshooting (wiki) and bug reporting (wiki) before reporting issues.
Reply
#6
Saw that after Smile
Image
AWXi - Ajax web interface. Wiki
Reply
#7
Hi, can't resume movie. When I start movie and stop later. Can't continue from last position. I find methods but doesn't work :

{"jsonrpc": "2.0", "method": "Player.Open", "params": { "item": { "file": "Y:/Avatar.3DBD/Avatar.mkv"} , "options":{ "resume":true } }, "id": 1}

any idea ? Thx by advance
Reply
#8
I just tested it with a few movies and episodes I have a resume point and it works fine for every one of those independent of whether I use the path to the file or the movieid/episodeid in Player.Open. Are you sure that you have a resume point for that specific video? Depending on how you scanned it into the library the path XBMC uses to store the resume point might be different (e.g. "Y:/Avatar.3DBD/"). Did playback start at all or did you receive an error?
Always read the online manual (wiki), FAQ (wiki) and search the forum before posting.
Do not e-mail Team Kodi members directly asking for support. Read/follow the forum rules (wiki).
Please read the pages on troubleshooting (wiki) and bug reporting (wiki) before reporting issues.
Reply
#9
(2012-09-30, 08:51)Montellese Wrote: I just tested it with a few movies and episodes I have a resume point and it works fine for every one of those independent of whether I use the path to the file or the movieid/episodeid in Player.Open. Are you sure that you have a resume point for that specific video? Depending on how you scanned it into the library the path XBMC uses to store the resume point might be different (e.g. "Y:/Avatar.3DBD/"). Did playback start at all or did you receive an error?


When I'm on movie I press 'I' button and can check the path. Also when I click on movie thru movie wall, he ask me if I resume or play stat (play resume with this way is fine). After when use this methods the movie restart and resquest reply me :
{
"id": 1,
"jsonrpc": "2.0",
"result": "OK"
}

Use the last nightly build.

Oups!!

Find.

When re-scan my movie list with smb path and use follow method, it's working but no mapping network letter:

{"jsonrpc": "2.0", "method": "Player.Open", "params": { "item": { "file": "smb://DISKSTATION/video/Avatar.3DBD/Avatar.mkv"} , "options":{ "resume":true } }, "id": 1}

Sorry for my english, and thx for your help.
Reply

Logout Mark Read Team Forum Stats Members Help
JSON beginners help...0