Player.OnPause Method not Found
#1
I am trying to get the OnPause state of a player but I keep getting a "Method not Found" error.

I am simply using...

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

Have I got this totally wrong?

Eden with JSON v4.
Image
Reply
#2
Player.OnPause is a notification and not a method. You can receive notifications by listening to JSON-RPC's TCP socket (port 9090 by default). If you want to know whether a player is playing or paused you need to use Player.GetProperties and retrieve the "speed" property. If it is 0 the player is paused otherwise it is playing. If you want to pause the player you need to use Player.PlayPause.
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
#3
You got it totally wrong Smile

Those are only available as notifications not commands, to get the state of the player you need to first get Player.GetActivePlayers then Player.GetProperties.

You should check http://wiki.xbmc.org/index.php?title=JSON-RPC_API/v4 and just do an JSONRPC.Introspect to get more accurate / detailed informations.

Edit : hum was slow to write this :p
Reply
#4
(2012-07-26, 15:21)Montellese Wrote: Player.OnPause is a notification and not a method. You can receive notifications by listening to JSON-RPC's TCP socket (port 9090 by default). If you want to know whether a player is playing or paused you need to use Player.GetProperties and retrieve the "speed" property. If it is 0 the player is paused otherwise it is playing. If you want to pause the player you need to use Player.PlayPause.

Thank you. Didin't even think about that option! As I'm only using HTTP (not investigated TCP, yet) this will be the only option to me right now.
Image
Reply

Logout Mark Read Team Forum Stats Members Help
Player.OnPause Method not Found0