Player.SetRepeat / Player.Open.. Help?
#1
Basically what I am trying to achieve is, start a video with Player.Open, and set it to repeat that video until otherwise noted.

From what I can tell from the JSON RPC, the Player.Open takes a repeat parameter as an option, however I cant tell how to use it. In addition to that, the only value that I can see for Player.SetRepeat is Cycle, and from what I can tell just cycles the method of repeat between all, one or none (https://github.com/xbmc/xbmc/commit/5525...cc6e4ef3a2 Starting at SetRepeat).

A little bit of insight on this would be greatly appreciated. Ive been tinkering for 2 days on this API and have barely gotten to be able to play a video. The documentation is not for the faint of heart. Confused
Reply
#2
Untested
Code:
{ "jsonrpc": "2.0", "method": "Player.Open", "params": { "item": { "file": "path/to/your/video" }, "options": { "repeat": "one" } }, "id": 1 }
Obviously you can replace the "file": "path/to/your/video" with something else like "movieid": 1 or whatever you need.

Player.SetRepeat supports multiple values for the "repeat" parameter:
  • "cycle" will cycle through the available repeat functionalities
  • "off" turns repeating off
  • "one" only repeats the current item
  • "all" repeats all items
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
Code:
{"jsonrpc":"2.0","id":1,"method":"Player.Open","params":{"item":{"file":"Media/TPSReport.mp4"},"options":{"repeat":"one"}}}

This returns:

Code:
{"id":1,"jsonrpc":"2.0","result":"OK"}

But at the end of the video it stops, and goes back to the Media Menu. :/

EDIT: Ive tried the 'all' parameter as well, and get nothing. This should be the latest XBMC as well, for your info.
Reply
#4
You're right and I just remembered why. There's a known problem with Player.Open where it doesn't add an item to a playlist and then you obviously can't set a repeat behaviour. Unfortunately the issue is not that easy to fix.

What you can try as a workaround is add your video to the video playlist using Playlist.Add and then use Player.Open to open that playlist with repeat set to "one" or "all".
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
#5
I had a feeling that was going to be the case. Is there a way to do this with one call? Compound the JSON calls if you will..
Reply
#6
You can do a batch request by putting all of your requests into a JSON array and sending it like that. But you'll also get an array of answers.
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
#7
Awesome, I got the repeating to work with Playlists.

Last question, How would you do this batch request your talking of?
Reply
#8
Code:
[
  { "jsonrpc": "2.0", ... },
  { "jsonrpc": "2.0", ... },
  { "jsonrpc": "2.0", ... }
  ...
]
and as a response you'll get
Code:
[
  { "jsonrpc": "2.0", ... },
  { "jsonrpc": "2.0", ... },
  { "jsonrpc": "2.0", ... },
  ...
]
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
#9
Awesome! This is extremely powerful for my usage. Thanks for your help, I appreciate it very much!
Reply

Logout Mark Read Team Forum Stats Members Help
Player.SetRepeat / Player.Open.. Help?0