Activate remote control of HD Image/Video Player V2

Hi,

Is it possible to enable remote control of the HD Image/Video Player V2 package?

Previously I used this option in the HD Image/Video Player Next Gen package, and currently I use the “interactive” option in the Scheduled Player package, with a call through the api. But I need to migrate it to a setup that uses the HD Image/Video Player V2 package.

Thanks, :slightly_smiling_face:

Hi,

Is this possible, is it in process, is it complicated?

I need to know if it is possible to activate that option, to develop automation.

Thank you.

Working on that this week. It’s s bit more complicated that in other packages due to how they form a peer group, but I’m getting there. It will use the tags applied to either the slot of the assets to select which content to play. Hope to have a release soon.

1 Like

There is now a release candidate for the remote control feature. It’s in the next branch of the package. You can import it here.

All plugins can now receive RPC calls. The “MainPlayer”, responsible for controlling the top-level playback now exposes the following functions:

  • play_next: Switches to the next scheduled item after a very short ~0.5s delay
  • add_filter: Adds a filter to the playback that restricts which of the items in the playlist should be played. You can filter on tags set on either the assets or extra tags set on the slot. Filter can be either active for a set number of content cycles (in which case the next added filter becomes active) or run indefinitely until replaced or removed.
  • set_filter: Same, but removes all existing filters first.
  • reset_filter: Removes all filters. The playlist plays as configured in the setup.

How to use:

Using the API:

curl -u:$API_KEY \
   https://info-beamer.com/api/v1/device/$DEVICE_ID/service/root/plugin-rpc \
   'data=["MainPlayer", "play_next"]'

This will call the method play_next on the MainPlayer object. It will cause it to interrupt the currently playing item and play the next as soon as possible. As there is a bit of synchronization required due to the package potentially communicating with other device within the same playback group, this might take a short moment, but not more than 1 second.

curl -u:$API_KEY \
   https://info-beamer.com/api/v1/device/$DEVICE_ID/service/root/plugin-rpc \
   'data=["MainPlayer", "set_filter", [["test"]], 3]'

The set_filter call takes two arguments, the last one is optional. The first is a list of list of strings. Strings are tag value and the list form a condition that decides if a playlist item becomes active. The inner list is logically anded, while the out list of list ors the inner lists. So [["ad"], ["promotion", "friday"]] selects all items that have either the “ad” tag or both the “promotion” and “friday” tags. In the above example, this selects any item that has at least the “test” tag.

The second argument (3) in the example sets the number of playback cycles this filter remains active. Once a playlist starts from the beginning, the counter is decreased and once it reaches zero, the filter is removed.

These calls can also be triggered from the network, assuming the “Remote Control” setting in the setup is switched to “Allow network control”. Via port 3000 UDP you can send messages in the following format, which is basically what the API calls above directly translates to:

plugin-rpc:["MainPlayer","play_next"]

Right now there isn’t any message source filtering, so anyone reaching UDP port 3000 on a Pi could trigger that.

I think that should do it. Feedback welcome.

1 Like

Hi Florian,

Thanks for this remote control update.

I’ve been testing and it works very well as described, however I need the option to play an asset that is not within the usual schedule, that is, previously (with the player next gen package) it was possible to assign an asset by setting its schedule to “Never”, and only when it was called by the command it was activated. Currently with the remote control api calls I can’t make this possible. The Player V2 setups I use with playlists, but I can’t assign an extra tag to the playlist slot, that way I could use, for example, a
["MainPlayer", "set_filter", [["test_tag"]]]
all the time and then reset it so that the content I want to activate appears. Or the option of ["MainPlayer", "play_next"] that takes effect in a slot with a schedule of “Never”.

Is it possible to do what I describe? Or maybe I’m missing something and there’s another way to do it?

Thanks.