Code Library

Web Storage & Status API

· By Media La Vista

Web Storage API

Two storage mechanisms on SpinetiX players, each limited to 4 MB:

ObjectPersistenceCleared On
localStoragePermanentlocalStorage.clear(), Control Center Operations > Reset, or the reset-webstorage configuration key. Survives reboot and publish
sessionStorageSemi-permanentPlayer restart or publish

JavaScript Usage

localStorage.setItem('key', 'value');
var val = localStorage.getItem('key');
localStorage.removeItem('key');

// Store objects as JSON
var data = { name: 'John', score: 100 };
localStorage.setItem('player', JSON.stringify(data));
var restored = JSON.parse(localStorage.getItem('player'));

REST API (firmware 4.3.0+)

Reads and writes localStorage from external clients over HTTP(S). Not available on HMP300 and DiVA. Needs the SYSTEMS Feature Set.

MethodEndpointPurpose
GET/webstorage List all variables
GET/webstorage/{key} or /webstorage?name={key} Get value
POST/webstorage Update one or more variables from a form
POST/webstorage/{key} or /webstorage?name={key} Update one variable with the POST content
POST/webstorage/{key}?expect={value} Update only if the current value equals value
DELETE/webstorage/{key} Delete a variable
PURGE/webstorage/ Delete all variables (firmware 4.6.1+)

The REST API is off by default: enable the security token access to the Webstorage API in Control Center under Advanced Applications > API Security. Authentication: the security token (Bearer header or access_token parameter), or a user with content authoring or admin rights. TLS-SRP and HTTP Basic are supported.

Status API

Monitor player status: identification, temperature, uptime, network, screen, storage.

Endpoint: GET http(s)://[player_address]/status/info

$(function() {
  $.get('http://player/status/info', function(data) {
    var doc = $.parseXML(data);
    var temp = $(doc.documentElement).find('temp').text();
    $.textArea({}).text("Temp: " + temp + "°C").addTo('svg');
  }, 'text');
});

Related Pages

SpinetiX Wiki Reference
localStorage, sessionStorage, REST API for external access, and player status monitoring.

Need Help With Your Project?

Media La Vista provides Tier 1–3 local support across the Middle East. 10-minute response for Partner Club members.

This page is available in English only
هذه الصفحة متوفرة باللغة الإنجليزية فقط
NS
Media La Vista support
Typically replies natively
مرحباً بكم في دعم SpinetiX عبر واتساب

كيف يمكنني مساعدتكم في حلول اللوحات الرقمية، أو البنية التحتية AV/IT، أو منتجات SpinetiX؟
Hello and welcome to SpinetiX Support on WhatsApp.

How can I help you with digital signage solutions, AV/IT infrastructure, or SpinetiX products?