Input.Right for remote
#1
Guys, this is probably not the right place (or maybe it is) to post, but I could think of a better place to ask this question.

On windows phone there's no remote which is able to fast forward video by 30 seconds. The only option is (analog seek?) the one which moves video by minutes.
On iPhone, the official remote functions as expected, during video playback right/left buttons forward/rewind by 30 seconds.

I want to repeat same behaviour on my WP remote. It's using JSON-RPC interface and sends through request for "Input.Right" and "Input.Left" as expected ofcourse.
All I need is to be able to map those actions to skip forward/back, preferably via configuration, but I'm not opposed to changing the code and building if needed (just for myself).
I've looked around the keyboard mapping and remote key mapping (the xml files) but looking at the source JSON-RPC interface directly sends actions? And there's not keyboard mapping/translation involved.

Is there a way to define somewhere what action does depending on whether video is playing (Just video, don't care about the rest really Smile ). Is there configuration file somewhere, can I script it.. Pretty much I need a pointer in the right direction?
Reply
#2
So far I traced the action from JSON-RCP to CApplication::OnAction where from what I see the left and right move actions are not handled.
Perhaps that's where I can some trickery? Map those to onKey() calls for left and right arrows?
Reply
#3
The Input.Left/Right/Up/Down JSON-RPC calls aren't mapped to any actions (except moving left/right/up/down) on purpose because the client developer would otherwise depend on the keymap of the user which could result in completely unexpected and odd behaviour.

You can either use Input.ExecuteAction with the proper action or Player.Seek with "smallforward" or "smallbackward". If this is working fine on the official iOS remote you can ask joethefox or look into the code on github to see how he's done it.
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
#4
I guess I'm just not aware what JSON-RPC actions are supposed to be. The way I figured it was that when press keyboard arrows and they work for both navigation and stepping back and forth, so should the JSON-RPC interface when sending through Input.Right/Left.
Again, the way I see it, is that it's no different to the keyboard I have attached to the computer.

I dug around the button translation code and I see what it's doing, I also traced through the ACTION_MOVE_LEFT/RIGHT from the JSON-RPC and I do see that it's not handled indeed.
Kodi is a huge project with a soooo many tricky things (I suppose Smile ) but my use case is easy and straightforward, and I'm also not opposed making my own build of it. In fact that's exactly what I've done.... Here're my changes

JSONRPC_STATUS CInputOperations::SendAction(int actionID, bool wakeScreensaver /* = true */, bool waitResult /* = false */)
{
if(!wakeScreensaver || !handleScreenSaver())
{
if (actionID == ACTION_MOVE_RIGHT)
g_application.OnKey(CKey(61571));
else if (actionID == ACTION_MOVE_LEFT)
g_application.OnKey(CKey(61570));
else
CApplicationMessenger::Get().SendAction(CAction(actionID), WINDOW_INVALID, waitResult);
}
return ACK;
}


That just sends through right and left keys. I'll probably add up and down too.. That works for me and I don't really need much more from it. But I do admit that's a bit dodgy.


Regarding the remote though, it can't just send Player.Seek because then it would need to keep track if video is playing etc.. I don't know how official iOS remote does it, perhaps it reads some property and changes between navigation and Player.Seek?
Reply
#5
Oh, I didn't realize that iPhone remote control code is also available... Neat.. I'll see what that does when I get a chance...
However the problem remains that WP remotes are really lacking this essential functionality.. And I'm sure I'm not the only one suffering from that, but I don't have direct control of their source code, whereas here I can "tweak" things to my liking Smile
Anyway, I should probably contact the developers directly or something
Reply

Logout Mark Read Team Forum Stats Members Help
Input.Right for remote0