Developer Tips & Tricks – Retrieving the iframe ID of a Playlist Item

January 11, 2012

Every item (Gadget, text, image etc.) that you can add to a Placeholder using our open source digital signage software, gets rendered inside of an iframe when the Presentation is previewed or run on a Display. You might find yourself needing to interact with that item from the Presentation's HTML. Luckily, there is a handy Javascript utility function you can use that makes this easier.

Get started with Rise Vision

To retrieve all of the iframe IDs for a particular Placeholder, just call getPlaceholderIFrameIds, passing in the ID of the Placeholder as a parameter. For example, calling this function for a Placeholder named ph0 would look like this:

getPlaceholderIFrameIds("ph0");

This will return an array containing the iframe IDs, the order of which corresponds to the order of the items in the Placeholder.

I have used this function before when I've needed to run some code inside a Gadget from the Presentation itself, or to pause Gadgets in multi-page Presentations when they are not visible, and start them again when they are. Do let us know in the forum if you come up with some other clever ways of using this.