Background Updating for Widgets

Use Case

Imagine you have a ticker placed in a region at the bottom of a Layout. The ticker is set to refresh from source once per every 30 minutes.

The rest of the layout is designed for video and images, which are queued in a playlist inside another region. These videos amount to 4 hours of playback.

The ticker doesn’t have a duration set (or has a very low duration) and region loop isn’t selected. You don’t want the ticker to reload during playback, you just want it to keep on ticking over.

Problem

Current functionality dictates that widget content is only refreshed from the CMS when it reloads. This happens at the end of the video/image region playlist as that is when the layout is considered “expired”. The first 30 minutes of content is fresh, the next 3:30 mins is cached.

Workaround

Set the duration of the ticker to 30 minutes and set the region to loop. It will reload with new data every 30 minutes. The downside of this is that the region “refreshes” and loads back the same content. Android “lazy loads” content from the CMS so that the refresh is less noticeable, but also means that the new data will 30 minutes out of step (2nd refresh queues the download of new content, shows cache, 3rd refresh queues the download of new content, shows cache from 2nd refresh, etc).

Suggested Solution

Provide a mechanism for background refreshing of content - which is to say that the player sets up a timer for the “update interval” defined by the widget. Each update interval it asks the CMS for new content for that widget, extracts “items” and pumps those into the already running widget. Each widget has functionality to update the current content with the newly provided content.

The outcome is a refreshed widget without expiring the content.