HTML Development
HTML Best Practices
HTML Caching
7min
this page covers how to use caching techniques to display html content brightsign players offer novel solutions through brightauthor\ connected, brightauthor, and brightscript, as well as support for common node js® and javascript caching solutions storage and memory before discussing html caching techniques, it is important to understand the storage and memory limitations of the players all brightsign players run html content on a chromium engine by default, chromium reserves 1gb plus 10% of the total size of the player's storage device for memory players also have limited memory to run html graphics and javascript this amount varies between player models; consult html content restrictions docid\ xleid0o22laz9spxtbd8v for more detail to change the storage values through brightauthor\ connected go to the admin tab open preferences > storage check enable storage limit now space can be allocated for both html graphics and javascript make sure that when using absolute , the specified segments should be neither larger nor smaller than the absolute size of your storage device when using percent , the percentages must add up to 100% to change the storage values through brightauthor go to edit > preferences > storage check limit storage space by function now space can be allocated for both html graphics and javascript make sure that when using specify absolute size , the specified segments should be neither larger nor smaller than the absolute size of your storage device when using specify percentages , the percentages must add up to 100% these limitations are shared across all rohtmlwidget instances, where rohtmlwidget docid\ xljq5 yhdma2ssmpzimtk is the brightscript object that handles all html processes caching capabilities brightsign players offer a flexible toolset for caching html content the sections below discuss novel brightsign solutions and how to enable and use more common methods through node js and javascript brightsign solutions brightsign players offer two html caching solutions local storage the sd card for each player can store html content for playback this method eliminates any connectivity or latency issues that may arise from networked solutions, but it must be done on a player by player basis this can make local storage unattractive when dealing with a large fleet of devices the assetpool brightscript object the assetpool is a sharded hash directory and is recommended for large file count applications the assetpool is filled by assetfetcher objects that can acquire content online and store it for later playback in either sha1, besha1, or md5 hash protocols consult content management objects docid\ v2knk8ys07kipgdqq5x8i for more information about assetpool node js and javascript solutions brightsign players also support node js and javascript caching techniques to use node js if you are using brightauthor\ connected, node js can be initialized through the state properties docid 2eh0 u7xstxqw emiiign user interface if you are using brightauthor, node js must first be enabled through the brightscript rohtmlwidget docid\ xljq5 yhdma2ssmpzimtk object once node js is running on the player, users can use any javascript api or caching method to cache content recommended content acquisition methods are xmlhttprequest and fetch with service worker keep the memory limitations in mind for example, xmlhttprequest will cause some player models to crash if it is used to download files larger than 100 200mb if xmlhttprequest's storage reservation will exceed your memory limitation, we recommend using the fetch api you cannot use service workers to cache video content brightsign players use our media player infrastructure for later video playback, not the chromium network brightsign recommends indexeddb https //developer mozilla org/en us/docs/web/api/indexeddb api/using indexeddb for storage use it to cache content playback according to these instructions https //developer mozilla org/en us/docs/learn/javascript/client side web apis/client side storage#storing complex data via indexeddb see an html/javascript test download example on node js docid\ vlskfvzequ04pd58rvxam our html widget cannot cache videos listed in the appcache manifest because of differences between the chrome desktop and brightsign device video playback architecture please use service worker and indexeddb to cache content instead of appcache, which is now deprecated using blobs brightsign video players can play blob urls referring to items in indexeddb and html5 filesystem api however it cannot play blob urls referring to javascript objects in memory see this video browser storage html example https //archbee doc uploads s3 amazonaws com/0prk6so2dy9ldu77jb8d1/iytljrfuhh3ruhv xuddj indexdb playback example zip