How to retrieve the current playing asset using API?

Hi,

I wanted to ask if there is any way to retrieve the name of the current playing asset on a particular device at the present moment using the API (preferably in Python).

Looking forward to hearing from you.

Thanks
Arpit

It’s not generally possible to query the playing asset as info-beamer isn’t only a single-asset playback engine. You’ll have to modify the node.lua code to save that information somewhere.

You can then connect to the running info-beamer process via TCP and use the mechanism described here to send out that information like this:

node.event("input", function(line, client)
    node.client_write(client, current_asset_id)
end)

You can then either implement the TCP client to 127.0.0.1:4444 yourself or use ibquery for that:

import ibquery
ib = ibquery.InfoBeamerQuery()
s = ib.node('root').io(raw=True)
print(s.readline()) # this should read the value sent in client_write above

Note that all this only is running on the device. Maybe the easiest way is then to submit that information to an API you run on your backend.