HTML Packages & IndexedDB

Before completing please check that the time, date and timezone have been correctly set on the device running the Player.

To be completed by the original poster:

Player Version

3.x.x

Issue

I have a windows player (v2.x.x and v3.x.x - the behaviour is the same) with a layout displaying a web page contained in an ‘HTML package’ widget and I am attempting to use IndexedDB to act as a store for caching specific images I wish to display on the page.

The images are referenced by a name provided by an external data source and using the API I query the Xibo CMS media library to find, download and store and hopefully retrieve the image for display.

An example of what I am trying to achieve is as follows:
The data source will provide the name ‘MB’, the IndexedDB storage is searched for a file named ‘MB’ if this fails a call to the API will search the media library for the ‘MB’ file. If it is found it will be downloaded and stored in the IndexedDB (FYI I am using the LocalForage javascript library for this) for immediate loading the next time it is required. (possibly 30 seconds or less later)

The displays using this layout may well be in remote locations with intermittent 3/4G connection and the SIMS could also have a limited data allowance, so a form of local caching is required.

My issue is that when I test the ‘HTML package’ in a browser directly the image is downloaded, stored and can be retrieved from the IndexedDB for subsequent usage. However when I run the package within the player, the logging I have indicates that it is successfully downloading and saving the file but the next time it is needed it cannot find it in the IndexedDB and downloads it again.

Is it possible to use IndexedDB to cache data locally by tweaking the setting, or bearing in mind I have to reference the files by name could I use another method, if so what?

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.