Kodi Community Forum

Full Version: HTTP API to JSON
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3
Hi,
Just before upgrading to Frodo, I noted that the HTTP API has been removed.
Luckily I haven't upgraded yet as my remote control works with API.

The problem is that I have a keyboard.xml file in my setup and I use my remote to send keyboard keys to XBMC.
What is the equivalent of the HTTP API SendKey command in JSON?

(Please do not tell me to use Event Server as is too complex for me so it's not an option.)

My remote is Philips Pronto TSU9600 (programming in javascript language)

thanks
The best you can do is use Input.ExecuteAction to send a specific action you want to perform (and not a key). As all keys are mapped to an action you should be able to do almost anything apart from actually typing text.
(2012-12-23, 14:58)Montellese Wrote: [ -> ]The best you can do is use Input.ExecuteAction to send a specific action you want to perform (and not a key). As all keys are mapped to an action you should be able to do almost anything apart from actually typing text.

Good. Can you please confirm that I can do everything that is listed in my keymap file?
Here it is:
<key id=1111>ZoomOut</key>
<key id=1112>ZoomIn</key>
<key id=1113>ZoomNormal</key>
<f1>ToggleWatched</f1>
<f2>XBMC.ActivateWindow(videolibrary,tvshowtitles)</f2>
<f3>XBMC.ActivateWindow(musiclibrary)</f3>
<f4>XBMC.ActivateWindow(MyPictures)</f4>
<f5>XBMC.ActivateWindow(Favourites)</f5>
<f6>XBMC.ActivateWindow(Home)</f6>
<f7>XBMC.ActivateWindow(settings)</f7>
<f11>XBMC.ActivateWindow(videolibrary,movietitles)</f11>
<f12>XBMC.ShutDown()</f12>
<y>XBMC.ActivateWindow(videolibrary,MusicVideoTitles)</y>
</keyboard>
</global>
<FullscreenVideo>
<keyboard>
<c>OSD</c>
<e>AudioNextLanguage</e>
<h>SubtitleDelayMinus</h>
<j>SubtitleDelayPlus</j>
<k>AudioDelayMinus</k>
<g>AudioDelayPlus</g>
</keyboard>
</FullscreenVideo>
<FullscreenInfo>
<keyboard>
<c>OSD</c>
</keyboard>
</FullscreenInfo>
<PlayerControls>
<keyboard>
<c>close</c>
</keyboard>
</PlayerControls>
<Visualisation>
<keyboard>
<c>ActivateWindow(MusicOSD)</c>
</keyboard>
</Visualisation>
<MusicOSD>
<keyboard>
<c>Close</c>
</keyboard>
</MusicOSD>
<VisualisationSettings>
<keyboard>
<c>Close</c>
</keyboard>
</VisualisationSettings>
<VisualisationPresetList>
<keyboard>
<c>Close</c>
</keyboard>
</VisualisationPresetList>
<VideoOSD>
<keyboard>
<c>Close</c>
</keyboard>
</VideoOSD>
<VideoMenu>
<keyboard>
<c>OSD</c>
<e>AudioNextLanguage</e>
<h>SubtitleDelayMinus</h>
<j>SubtitleDelayPlus</j>
<k>AudioDelayMinus</k>
<g>AudioDelayPlus</g>
</keyboard>
</VideoMenu>
</keymap>


thanks

heh, this might be a really silly idea of me,
but what if you just test all of the above
and let us know which ones don't work? ;-)
Pfft, the insanity ronie!
(2012-12-23, 19:21)ronie Wrote: [ -> ]heh, this might be a really silly idea of me,
but what if you just test all of the above
and let us know which ones don't work? ;-)

Or...
http://wiki.xbmc.org/index.php?title=JSO...put.Action for a list of supported actions Smile
(2012-12-23, 19:21)ronie Wrote: [ -> ]heh, this might be a really silly idea of me,
but what if you just test all of the above
and let us know which ones don't work? ;-)

Hi ronie,
I appreciate that, but please look from my side too: I was very happy with my setup: with simple programming skills I managed to control my XBMC with my remote control.
Now for some reasons, that for sure are valid, but that I don't understand, I found myself in a situation where I have to reprogram my remote, and maybe it won't even work (I am not even sure that it will work easily as it was working with HTTP).

I know that you and the rest of the developer team is doing a fabulous job, but still cannot understand what was the reason to remove a practical and simple protocol like the HTTP. You could have just left it as it is now.

So here was my main concern: if I upgrade and start learning the JSON, will my simple needs be satisfied with the JSON?
Are all the functions that I need supported?

That's all.
thanks to all.

No we could not have left http in
(2012-12-25, 21:15)Martijn Wrote: [ -> ]No we could not have left http in

ofc we could, we chose not to
And 3 Years of alerting and Json presence is quite enough Smile

(2012-12-26, 09:02)Tolriq Wrote: [ -> ]And 3 Years of alerting and Json presence is quite enough Smile

Fair enough.
So after digging into the documentation I haven't been able to find the following commands in JSON: Confused

Can you help me finding the JSON commands for accomplishing these tasks?

AudioNextLanguage
AudioDelayMinus
AudioDelayPlus
ShowSubtitles
NextSubtitle
SubtitleDelayMinus
SubtitleDelayPlus
ToggleWatched
PageUp (for scrolling lists)
PageDown (for scrolling lists)
Screenshot (Print)
BigStepForward
BigStepBack
StepBack
StepForward


Further questions:
1. What are the commands in JSON V4 (EDEN) for "INPUT.SHOWOSD" and "INPUT.CONTEXTMENU"


(2012-12-26, 13:48)elite1967 Wrote: [ -> ]Can you help me finding the JSON commands for accomplishing these tasks?

they are all listed in the wiki as far is i can see:
(2012-12-23, 23:55)N3MIS15 Wrote: [ -> ]http://wiki.xbmc.org/index.php?title=JSO...put.Action for a list of supported actions Smile

(2012-12-26, 13:48)elite1967 Wrote: [ -> ]Further questions:
1. What are the commands in JSON V4 (EDEN) for "INPUT.SHOWOSD" and "INPUT.CONTEXTMENU"
i don't think any of those are available in eden.
the input.action method was added in frodo.
(2012-12-26, 16:15)ronie Wrote: [ -> ]
(2012-12-26, 13:48)elite1967 Wrote: [ -> ]Can you help me finding the JSON commands for accomplishing these tasks?

they are all listed in the wiki as far is i can see:
(2012-12-23, 23:55)N3MIS15 Wrote: [ -> ]http://wiki.xbmc.org/index.php?title=JSO...put.Action for a list of supported actions Smile

(2012-12-26, 13:48)elite1967 Wrote: [ -> ]Further questions:
1. What are the commands in JSON V4 (EDEN) for "INPUT.SHOWOSD" and "INPUT.CONTEXTMENU"
i don't think any of those are available in eden.
the input.action method was added in frodo.

Ronie,
thanks.
I see now how I can do it. I was looking in the wrong place.

I will try to update my code and try to see if it works.


(2012-12-26, 09:02)Tolriq Wrote: [ -> ]And 3 Years of alerting and Json presence is quite enough Smile

Tolriq,
Well, don't take me wrong, but to be fair, if INPUT.ACTION has been added only in Frodo, it would have been impossible to upgrade to JSON earlier. Right?

(2012-12-26, 18:37)elite1967 Wrote: [ -> ]Well, don't take me wrong, but to be fair, if INPUT.ACTION has been added only in Frodo, it would have been impossible to upgrade to JSON earlier. Right?

well yes and no. but it's not quite how things go around these places :-)
during the development of json-rpc we've asked people to test it and report functions that are missing.

if anyone would've mentioned during the development cycle of eden that the input method was missing,
we might have gotten to it earlier.

anyways...i'm glad you've figured it out, and once again,
should you come across something that doesn't work, please let us know. ;-)
(2012-12-26, 18:48)ronie Wrote: [ -> ]
(2012-12-26, 18:37)elite1967 Wrote: [ -> ]Well, don't take me wrong, but to be fair, if INPUT.ACTION has been added only in Frodo, it would have been impossible to upgrade to JSON earlier. Right?

well yes and no. but it's not quite how things go around these places :-)
during the development of json-rpc we've asked people to test it and report functions that are missing.

if anyone would've mentioned during the development cycle of eden that the input method was missing,
we might have gotten to it earlier.

anyways...i'm glad you've figured it out, and once again,
should you come across something that doesn't work, please let us know. ;-)

Ronie, you and the rest of the team are doing a great job and I don't want to criticize it.
So again: THANKS.

One more question: I have 4 buttons on my remote that sends the UP/LEFT/DOWN/RIGHT keyboard commands.
So if I am in the GUI, with these buttons I can navigate, but with the same buttons, during playback, I can StepForward or StepBack.
In JSON, will the same happen? I mean, If I send the action INPUT.RIGHT, what will be the behavior during playback? Will be STEPFORWARD?

thanks
Pages: 1 2 3