One button to enable and disable subtitles?

Surely that exists??

Does any one know? Ive seen some documents and theres about 10 key presses to turn them off! Crazy.

Thanks

If using an OSMC remote you could remap an existing button to the Subtitles on/off key, but then you lose the original function of that key. If using another remote with an available “free” button you could add that function to the button. The keyboard ‘t’ key is what you’re looking for.

It takes a bit of reading to understand how to do it manually but it’s actually pretty easy.
Kodi Keymap

But if you install the Kodi addon called Keymap Editor you can do it from the comfort of your couch.

Cheers
Robert

Hi there, im going to turn it on and off using a home automation system, so i jjust need to know the command.

inputaction I believe is what ill send, just not sure on the command…

Doesn’t look good unless things have changed outside this thread.

https://forum.kodi.tv/showthread.php?tid=107522

While subtitle on/off is T so if you can sent T via openhub it should work

1 Like

Thanks, Ill see what I can find in the way of sending key strokes…

It looks like json does support Subtitles: https://kodi.wiki/view/JSON-RPC_API/v4#Player.SetSubtitle

Also read: http://habitech.s3.amazonaws.com/PDFs/STR/STREAM_Box%20Note%20-%20JSON%20API%20Examples%20for%20ContentPlayer%20(Isengard).pdf

Has examples for turning subtitles on/off.

Here is a simple curl command you can run:

Subs on:

curl -X POST -H "Content-Type: application/json" -d '{"jsonrpc":"2.0","id":1,"method":"Player.SetSubtitle","params":{"playerid":1,"subtitle":"on"}}' http://ip.of.osmc.system:8080/jsonrpc

Off:

curl -X POST -H "Content-Type: application/json" -d '{"jsonrpc":"2.0","id":1,"method":"Player.SetSubtitle","params":{"playerid":1,"subtitle":"off"}}' http://ip.of.osmc.system:8080/jsonrpc

You may need to change the port from 8080 to what ever your Kodi is configured to use.

1 Like

That appears to have worked at least via CLI, ill test it when I’m home.

kris@openhab2:/etc/openhab2$ curl -X POST -H “Content-Type: application/json” -d ‘{“jsonrpc”:“2.0”,“id”:1,“method”:“Player.SetSubtitle”,“params”:{“playerid”:1,“subtitle”:“off”}}’ http://192.168.0.12:8080/jsonrpc
{“id”:1,“jsonrpc”:“2.0”,“result”:“OK”}kris@openhab2:/etc/openhab2$

GET\x20jsonrpc?request={"jsonrpc":"2.0","method":"Input.ExecuteAction","params":{"action":"showsubtitles"}}

This is the string from my control system

Thanks guys. Got it working with api and json