"Play Trailer" using JSON RPC
#1
I'm a newbie to JSON and am starting to learn some things. I think I understand correctly that
jsonrpc?request={"jsonrpc":"2.0","method":"Input.ExecuteAction","params":{"action":"red"}}
and ALL other messages are limited to "pre-defined" methodcalls (namespaces), parameteres etc.
I would like to "Play Trailer" while scrolling thru Movie Library (using JSON RPC) with an Android running iRule.
iRule is just a graphic remote control that is user configurable. (check it out its pretty cool)
I have edited the confluence skin to include a button that plays the associated trailer (from the movies library view)
<control type="button" id="61">
<onclick>PlayMedia("$INFO[ListItem.Trailer]")</onclick>
I' cannot get this to work via remote control mapping (keyboard.xml & lirc.xml) for an ir remote (clicking the gui button works ok) and I've tried the following:
<red>SendClick(61)</red> in keyboard.xml with no luck. I blindly tried jsonrpc?request={"jsonrpc":"2.0","method":"Input.ExecuteAction","params":{"action":"sendclick(61)"}}
but I didn't expect that to work anyway. i DID read the documentation (i know that particular action isn't listed)
Would the DB entry need to be queried first and then the actual url for the trailer be requested to play? If so, how do I do this?
Can I have a "hard coded" request with a param as a variable based on the returned value from the query?
That sounds a bit convoluted (to me anyway) Is there a "simple" way to "Play Trailer" of the highlighted library item using JSON RPC?
btw: I'm using mySQL and I have a youtube trailer entry for each & every movie.

Thanks for any help.

OK, so I built a "temporary workaround" with a macro.
{"jsonrpc":"2.0","method":"Input.ExecuteAction","params":{"action":"info"}}
(delay 0.5 seconds)
{"jsonrpc":"2.0","method":"Input.ExecuteAction","params":{"action":"right"}}
(delay 0.2 seconds)
{"jsonrpc":"2.0","method":"Input.ExecuteAction","params":{"action":"right"}}
(delay 0.2 seconds)
{"jsonrpc":"2.0","method":"Input.ExecuteAction","params":{"action":"right"}}
(delay 0.2 seconds)
{"jsonrpc":"2.0","method":"Input.ExecuteAction","params":{"action":"right"}}
(delay 0.2 seconds)
{"jsonrpc":"2.0","method":"Input.ExecuteAction","params":{"action":"select"}}

I would MUCH rather not have the unattractive gui activity BUT it DOES work!!! Still, ANY help would be greatly appreciated, if anything it would give me a better understanding of the API. thanks.
Reply
#2
I found this thread when searching how to play a trailer from JSON-RPC. I know it's too late since the message is from 2013 but for the next person finding this topic, here's how I do it:
Code:
{"jsonrpc":"2.0", "method":"Player.Open", "params":{"item":{"file":"plugin://plugin.video.youtube/?action=play_video&videoid=HFeWsDpy9y0"}},"id":"2"}

I was also trying to execute the youtube addon then I found the answer on this thread:
https://forum.kodi.tv/showthread.php?tid...pid1293308

And now I'm feeling stupid for not trying this in the first place Big Grin
Reply

Logout Mark Read Team Forum Stats Members Help
"Play Trailer" using JSON RPC0